# Police alerts

{% hint style="info" %}
Adding other types of police alerts
{% endhint %}

## Dispatch system examples

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

#### Location: Client/functions\_open.lua

{% code fullWidth="true" %}

```lua
------- / Robbery notification
RegisterNetEvent('estrp-paletobank:robberyinprogress')
AddEventHandler('estrp-paletobank:robberyinprogress',function(playerCoords,currentStreetName)
    local PlayerData = QBCore.Functions.GetPlayerData()
	if PlayerData.job.name == "police" then
        Notifi({ title = Config.title, text = Text('bankrobbery').. " " .. currentStreetName, duration = 10000, icon = 'fa-solid fa-laptop-code', color = '#ff0000' })
        RemoveBlip(blipbankrobbery)
        blipbankrobbery = AddBlipForCoord(playerCoords)
        SetBlipSprite(blipbankrobbery , 161)
        SetBlipScale(blipbankrobbery , 2.0)
        SetBlipColour(blipbankrobbery, 3)
        PulseBlip(blipbankrobbery)
        Wait(100000)
        RemoveBlip(blipbankrobbery)
        
        end
    end)

function Policenotify()
        local playerCoords = GetEntityCoords(PlayerPedId(-1))
        local currentStreetName = GetCurrentStreetName()
        TriggerServerEvent('estrp-paletobank:robberyinprogress', playerCoords,currentStreetName)
end
```

{% endcode %}
{% endtab %}

{% tab title="Core Dispatch" %}
Location: Client/functions\_open.lua

{% code fullWidth="true" %}

```lua
------- / Robbery notification
--[[RegisterNetEvent('estrp-paletobank:robberyinprogress')
AddEventHandler('estrp-paletobank:robberyinprogress',function(playerCoords,currentStreetName)
    local PlayerData = QBCore.Functions.GetPlayerData()
	if PlayerData.job.name == "police" then
        Notifi({ title = Config.title, text = Text('bankrobbery').. " " .. currentStreetName, duration = 10000, icon = 'fa-solid fa-laptop-code', color = '#ff0000' })
        RemoveBlip(blipbankrobbery)
        blipbankrobbery = AddBlipForCoord(playerCoords)
        SetBlipSprite(blipbankrobbery , 161)
        SetBlipScale(blipbankrobbery , 2.0)
        SetBlipColour(blipbankrobbery, 3)
        PulseBlip(blipbankrobbery)
        Wait(100000)
        RemoveBlip(blipbankrobbery)
        
        end
    end)
]]
function Policenotify()
    local playerCoords = GetEntityCoords(PlayerPedId(-1))
    local currentStreetName = GetCurrentStreetName()
    exports['core_dispatch']:addCall(
     "10-10", 
        "Paleto Bank is being robbed: " .. currentStreetName,
    {
        {icon="fa-ruler", info=""},
    },
    {
        playerCoords.x ,playerCoords.y ,playerCoords.z 
    },
    "police", 
    3000, 
    11, 
    5,
    false
)
end
```

{% endcode %}
{% endtab %}

{% tab title="CD\_Dispatch" %}

#### Location: Client/functions\_open.lua

```lua
------- / Robbery notification
--[[RegisterNetEvent('estrp-paletobank:robberyinprogress')
AddEventHandler('estrp-paletobank:robberyinprogress',function(playerCoords,currentStreetName)
    local PlayerData = QBCore.Functions.GetPlayerData()
	if PlayerData.job.name == "police" then
        Notifi({ title = Config.title, text = Text('bankrobbery').. " " .. currentStreetName, duration = 10000, icon = 'fa-solid fa-laptop-code', color = '#ff0000' })
        RemoveBlip(blipbankrobbery)
        blipbankrobbery = AddBlipForCoord(playerCoords)
        SetBlipSprite(blipbankrobbery , 161)
        SetBlipScale(blipbankrobbery , 2.0)
        SetBlipColour(blipbankrobbery, 3)
        PulseBlip(blipbankrobbery)
        Wait(100000)
        RemoveBlip(blipbankrobbery)
        
        end
    end)
]]
function Policenotify()
     local data = exports['cd_dispatch']:GetPlayerInfo()
        TriggerServerEvent('cd_dispatch:AddNotification', {
            job_table = {'police', }, 
            coords = data.coords,
            title = '10-15 - Paleto Bank Robbery',
            message = 'Paleto Bank security alarm went off!', 
            flash = 0,
            unique_id = data.unique_id,
            sound = 1,
            blip = {
                sprite = 431, 
                scale = 1.2, 
                colour = 3,
                flashes = true, 
                text = '112 - Paleto Bank',
                time = 5,
                radius = 0,
            }
        })
end
```

{% endtab %}

{% tab title="Linden Outlawalert" %}

#### Location: Server/functions\_serv\_open.lua

```lua
RegisterServerEvent('estrp-paletobank:robberyinprogress')
AddEventHandler('estrp-paletobank:robberyinprogress', function(playerCoords,currentStreetName)
local data = {displayCode = '10-10', description = 'Paleto Bank Robbery', isImportant = 1, recipientList = {'police'}, length = '20000', infoM = 'fa-info-circle', info = 'Paleto Bank is being robbed'}
local dispatchData = {dispatchData = data, caller = 'Bank Security System', coords = GetEntityCoords(GetPlayerPed(source))}
TriggerEvent('wf-alerts:svNotify', dispatchData)
end)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://estscripts.gitbook.io/info/other-documentations/paleto-bank-robbery-default/police-alerts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
