> 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/vehicle-chopshop/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\_open.lua

{% code fullWidth="true" %}

```lua

RegisterNetEvent('estrp-chopshop:client:vehicletheft')
AddEventHandler('estrp-chopshop:client:vehicletheft', function(playerCoords, currentStreetName)
    local PlayerData = ESX.GetPlayerData()
    if PlayerData.job.name == "police" then
        -- Notify police about the vehicle theft
        lib.defaultNotify({
            title = 'Vehicle theft',
            description = 'Dispatch: Possible vehicle theft at ' .. currentStreetName,
            duration = 15000,
            status = 'info'
        })

        -- Remove any existing blip for vehicle theft
        if blipvehtheft then
            RemoveBlip(blipvehtheft)
        end

        -- Add a new blip for the vehicle theft location
        blipvehtheft = AddBlipForCoord(playerCoords)
        SetBlipSprite(blipvehtheft, 161)
        SetBlipScale(blipvehtheft, 2.0)
        SetBlipColour(blipvehtheft, 3)
        PulseBlip(blipvehtheft)

        -- Remove the blip after 60 seconds
        Citizen.Wait(60000)
        RemoveBlip(blipvehtheft)
    end
end)
```

{% endcode %}
{% endtab %}

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

{% code fullWidth="true" %}

```lua
RegisterNetEvent('estrp-chopshop:client:vehicletheft')
AddEventHandler('estrp-chopshop:client:vehicletheft', function(playerCoords, currentStreetName)
    local PlayerData = ESX.GetPlayerData()
    local playerCoords = GetEntityCoords(PlayerPedId(-1))
    exports['core_dispatch']:addCall(
     "10-10", 
        "Vehicle is being stolen at " .. currentStreetName,
    {
        {icon="fa-ruler", info=""},
    },
    {
        playerCoords.x ,playerCoords.y ,playerCoords.z 
    },
    "police", 
    3000, 
    11, 
    5,
    false
)
end)
```

{% endcode %}
{% endtab %}

{% tab title="Linden Outlawalert" %}

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

```lua
RegisterServerEvent('estrp-chopshop:server:vehicletheft')
AddEventHandler('estrp-chopshop:server:vehicletheft', function(playerCoords,currentStreetName)
    local data = {displayCode = '10-10', description = 'Vehicle Theft', isImportant = 1, recipientList = {'police'}, length = '20000', infoM = 'fa-info-circle', info = 'Vehicle theft in progress'}
    local dispatchData = {dispatchData = data, caller = 'Local citizen', coords = GetEntityCoords(GetPlayerPed(source))}
    TriggerEvent('wf-alerts:svNotify', dispatchData)
end)
```

{% endtab %}
{% endtabs %}
