🚨Police alerts

Adding other types of police alerts

Dispatch system examples

Location: Client/functions_open.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)

Last updated