> For the complete documentation index, see [llms.txt](https://docs.l2s.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.l2s.dev/assets-and-guides/dispatch/integration/police-alerts.md).

# Police Alerts

There are many ready-made functions that you can use directly, or you can create your own alert and link it with any theft script.

## Custom Alert

{% tabs %}
{% tab title="Client" %}

```lua
local playerData = exports['l2s-dispatch']:GetPlayerData()
TriggerServerEvent('l2s-dispatch:server:AddNotification', {
    departments = {'POLICE', 'EMS'}, 
    title = 'Alert Title Here',
    message = playerData.sex..' was testing new alert',
    coords = vec2(playerData.coords.x, playerData.coords.y),
    priority = 1, 
    sound = 1,
    street = playerData.street,
    reply = playerData.source, 
    anonymous = false, 
     blip = {
        sprite = 52, 
        colour = 1,
        scale = 1.0, 
        text = '10-15 - Custom Alert',
    },
    info = { 
        {icon = 'video', text = 'first'}, 
        {icon = 'person', text = playerData.sex}, 
    },
})
```

{% endtab %}

{% tab title="Server" %}

```lua
TriggerEvent('l2s-dispatch:server:AddNotification', {
    departments = {'POLICE', 'EMS'}, 
    title = 'Alert Title Here',
    message = 'This is Test alert msg',
    coords = vec2(x, y),
    priority = 1,
    sound = 1, 
    reply = false, 
    anonymous = false, 
    street = 'Player Street here',
    blip = {
        sprite = 52, 
        colour = 1,
        scale = 1.0, 
        text = '10-15 - Custom Alert',
    },
    info = { 
        {icon = 'video', text = 'first'}, 
        {icon = 'person', text = 'secend'}, 
    },
})
```

{% endtab %}
{% endtabs %}

| Variable Name | Description                                                                                                                                                        |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| departments   | List of departments or hubs that will receive the alert (e.g., 'POLICE', 'EMS'). You can add multiple hubs.                                                        |
| title         | Title of the alert notification or police 10 codes.                                                                                                                |
| message       | Custom message for the alert, including any varibles.                                                                                                              |
| coords        | Coordinates of the alert, retrieved from the player's current position.                                                                                            |
| priority      | Priority level of the alert (1 = High, 3 = Low).                                                                                                                   |
| sound         | Sound level associated with the alert (1 to 3).                                                                                                                    |
| reply         | The source of the player who initiated the alert if the report requires a response to the person (used in 911 reports) (<mark style="color:red;">optional</mark>). |
| anonymous     | Boolean to determine if the alert is anonymous. If set to `true`, no blip will be added (<mark style="color:red;">optional</mark>).                                |
| street        | Player street name                                                                                                                                                 |
| blip          | <p>Table defining the blip details for the alert on the map (not added if anonymous = true).<br><br>If you do not want to add blip, delete this blip array.</p>    |
| sprite        | Icon ID for the  blip. [Icon can be found here](https://docs.fivem.net/docs/game-references/blips/)                                                                |
| colour        | Colour for the blip - [Icon can be found here](https://docs.fivem.net/docs/game-references/blips/)                                                                 |
| scale         | The size of the blip: **`0.1-2.0`**.                                                                                                                               |
| text          | Text label associated with the blip (English).                                                                                                                     |
| info          | Additional custom information, including icons and descriptive text only showing in Respond Calls logs.                                                            |

***

## Ready Alerts Functions

### Panic Button

```lua
--- @param hub String - The hub of current Unit Like POLICE, EMS
exports['l2s-dispatch']:Panic(hub)
TriggerEvent('l2s-dispatch:client:PanicButton', hub) -- Client Event ...
```

### Store Robbery

```lua
exports['l2s-dispatch']:StoreRobbery()
```

***

### House Robbery

```lua
exports['l2s-dispatch']:HouseRobbery()
```

***

### Truck Robbery

```lua
exports['l2s-dispatch']:TruckRobbery()
```

***

### Fleeca Robbery

```lua
exports['l2s-dispatch']:FleecaRobbery()
```

***

### Bobcat Robbery

```lua
exports['l2s-dispatch']:BobcatRobbery()
```

***

### Vangelico Robbery

```lua
exports['l2s-dispatch']:VangelicoRobbery()
```

***

### Paleto Robbery

```lua
exports['l2s-dispatch']:PaletoRobbery()
```

***

### Pacific Robbery

```lua
exports['l2s-dispatch']:PacificRobbery()
```

***

### Union Robbery

```lua
exports['l2s-dispatch']:UnionRobbery()
```

***

### Vehicle Robbery

```lua
exports['l2s-dispatch']:VehicleBurglary()
```

***
