> For the complete documentation index, see [llms.txt](https://estscripts.gitbook.io/info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://estscripts.gitbook.io/info/other-documentations/union-depository-heist/police-alerts.md).

# Police alerts

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

## Dispatch system examples

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

#### Location: Client/functions\_targets\_open

{% code fullWidth="true" %}

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

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

{% endcode %}

{% endtab %}

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

{% code fullWidth="true" %}

```lua
function Policenotify()
        local playerCoords = GetEntityCoords(PlayerPedId(-1))
        local gender = IsPedMale(PlayerPedId(-1)) and 'male' or 'female'
        exports['core_dispatch']:addCall(
            "66-6", --dont mind the call number xD
            "Union Depository is being robbed",
            {
                {icon = "fa-venus-mars", info = gender}
    
            },
            {playerCoords.x, playerCoords.y, playerCoords.z},
        "police",
        3000,
        11,
        5,
        true
        )
    end
```

{% endcode %}
{% endtab %}

{% tab title="Linden Outlawalert" %}

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

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

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/union-depository-heist/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.
