> For the complete documentation index, see [llms.txt](https://hane-mod-studio.gitbook.io/hane-mod-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hane-mod-studio.gitbook.io/hane-mod-studio/hane-scripts/hane-dispatch/alert-types.md).

# Alert Types

All alert types are defined in `shared/alerts.lua`. Each alert can be triggered via exports or internal events.

***

### Alert Structure

Each alert in `Alerts.Types` has the following properties:

```lua
['shooting'] = {
    code = 'CODE 13A',
    title = 'Automatic Weapon Fired',
    priority = 'high',
    blip = { sprite = 110, color = 1, scale = 1.0 },
    duration = 60,
    jobs = { 'police', 'sheriff' },
    jobOverrides = {
        ['sheriff'] = {
            code = '413',
            title = 'Shots Fired - Automatic'
        }
    }
}
```

| Property       | Type   | Description                                                                  |
| -------------- | ------ | ---------------------------------------------------------------------------- |
| `code`         | string | Alert code displayed in the UI                                               |
| `title`        | string | Alert title text                                                             |
| `priority`     | string | `'high'`, `'medium'`, or `'low'`                                             |
| `blip`         | table  | Map blip configuration (`sprite`, `color`, `scale`)                          |
| `duration`     | number | How long the alert stays active (seconds)                                    |
| `jobs`         | table  | Which jobs receive the alert                                                 |
| `jobOverrides` | table  | Per-job overrides for `code` and `title` (e.g., different codes for Sheriff) |

***

### Available Alert Types

#### 🔫 Weapons & Violence

| Key                 | Code     | Title                  | Priority | Jobs            |
| ------------------- | -------- | ---------------------- | -------- | --------------- |
| `shooting`          | CODE 13A | Automatic Weapon Fired | high     | police, sheriff |
| `pistol_shooting`   | CODE 13  | Shots Fired            | medium   | police, sheriff |
| `fight`             | CODE 10  | Fight In Progress      | low      | police, sheriff |
| `assault`           | CODE 64  | Assault                | medium   | police, sheriff |
| `domestic_violence` | CODE 64D | Domestic Violence      | high     | police, sheriff |
| `murder`            | CODE 54A | Murder                 | high     | police, sheriff |
| `hostage`           | CODE 91  | Hostage Situation      | high     | police, sheriff |
| `riot`              | CODE 98  | Riot / Civil Unrest    | high     | police, sheriff |

#### 🚗 Vehicle Related

| Key                | Code     | Title                    | Priority | Jobs            |
| ------------------ | -------- | ------------------------ | -------- | --------------- |
| `vehicle_theft`    | CODE 35  | Stolen Vehicle           | medium   | police, sheriff |
| `carjacking`       | CODE 35A | Vehicle Carjacking       | high     | police, sheriff |
| `vehicle_lockpick` | CODE 35B | Vehicle Lockpick Attempt | low      | police, sheriff |
| `vehicle_hotwire`  | CODE 35C | Vehicle Hotwire Attempt  | medium   | police, sheriff |
| `speeding`         | CODE 55  | Excessive Speeding       | low      | police, sheriff |
| `dui`              | CODE 55D | Driving Under Influence  | medium   | police, sheriff |
| `hit_and_run`      | CODE 50A | Hit and Run              | high     | police, sheriff |

#### 🏪 Robberies

| Key               | Code     | Title                 | Priority | Jobs            |
| ----------------- | -------- | --------------------- | -------- | --------------- |
| `bank_robbery`    | CODE 90  | Bank Robbery          | high     | police, sheriff |
| `store_robbery`   | CODE 90  | Store Robbery         | medium   | police, sheriff |
| `jewelry_robbery` | CODE 90  | Jewelry Store Robbery | high     | police, sheriff |
| `house_robbery`   | CODE 31  | House Robbery         | medium   | police, sheriff |
| `grand_theft`     | CODE 31A | Grand Theft           | medium   | police, sheriff |

#### 🏥 Medical & Emergency

| Key                | Code    | Title                    | Priority | Jobs                       |
| ------------------ | ------- | ------------------------ | -------- | -------------------------- |
| `injured_person`   | CODE 52 | Injured Person           | high     | ambulance                  |
| `officer_down`     | CODE 99 | Emergency (Officer Down) | high     | police, ambulance, sheriff |
| `traffic_accident` | CODE 50 | Traffic Accident         | medium   | police, ambulance, sheriff |
| `dead_body`        | CODE 54 | Dead Body Found          | high     | police, ambulance, sheriff |
| `explosion`        | CODE 80 | Explosion Reported       | high     | police, ambulance, sheriff |
| `fire`             | CODE 70 | Fire Reported            | high     | ambulance, sheriff         |
| `suicide`          | CODE 56 | Suicide Attempt          | high     | police, ambulance, sheriff |
| `mental_health`    | CODE 96 | Mental Health Crisis     | medium   | police, ambulance, sheriff |

#### 👤 Other

| Key                  | Code     | Title              | Priority | Jobs            |
| -------------------- | -------- | ------------------ | -------- | --------------- |
| `suspicious_person`  | CODE 37  | Suspicious Person  | low      | police, sheriff |
| `suspicious_vehicle` | CODE 37V | Suspicious Vehicle | low      | police, sheriff |
| `drug_activity`      | CODE 85  | Drug Activity      | medium   | police, sheriff |
| `property_damage`    | CODE 91P | Property Damage    | low      | police, sheriff |
| `harassment`         | CODE 64H | Harassment         | low      | police, sheriff |
| `child_abuse`        | CODE 64C | Child Abuse        | high     | police, sheriff |
| `sexual_assault`     | CODE 64S | Sexual Assault     | high     | police, sheriff |

***

### Adding Custom Alert Types

To add a new alert type, add a new entry to `Alerts.Types` in `shared/alerts.lua`:

```lua
['custom_alert'] = {
    code = 'CODE 100',
    title = 'My Custom Alert',
    priority = 'medium',
    blip = { sprite = 1, color = 1, scale = 0.8 },
    duration = 60,
    jobs = { 'police', 'ambulance' },
    jobOverrides = {}
}
```

Then trigger it from any script using:

```lua
exports['hane_dispatch']:SendAlert('custom_alert', {
    coords = vector3(x, y, z),
    street = 'Street Name',
    zone = 'Zone Name',
})
```

***

### Weapon Classification

Shooting detection automatically classifies weapons:

| Category     | Example Weapons                               |
| ------------ | --------------------------------------------- |
| Pistol       | Standard pistols                              |
| SMG          | Micro SMG, SMG, Combat PDW, Machine Pistol    |
| Rifle        | Assault Rifle, Carbine Rifle, Special Carbine |
| Machine Gun  | MG, Combat MG                                 |
| Sniper       | Sniper Rifle, Heavy Sniper                    |
| Shotgun      | Pump Shotgun, Sawed-Off                       |
| Heavy Weapon | RPG, Minigun, Grenade Launcher                |
| Throwable    | Grenades, Molotov, Sticky Bomb                |

Automatic weapons (SMGs, Rifles, Machine Guns) trigger `shooting` alerts, while pistols and other weapons trigger `pistol_shooting` alerts.
