🚨Police alerts
Dispatch system examples
Location: Client/functions.lua
RegisterNetEvent('estrp-shoprobbery:cashregisterrobbery')
AddEventHandler('estrp-shoprobbery:cashregisterrobbery',function(playerCoords,currentStreetName)
local PlayerData = QBCore.Functions.GetPlayerData()
if PlayerData.job.name == "police" then
lib.defaultNotify({
title = 'Store robbery warning',
description = 'Dispatch: Someone is robbing the store! Location: ' .. currentStreetName,
duration = 15000,
status = 'error'
})
-- exports['mythic_notify']:SendAlert('error', 'Dispatch: Someone is robbering the store ' .. currentStreetName , 10000)
RemoveBlip(blipRobbery)
blipRobbery = AddBlipForCoord(playerCoords)
SetBlipSprite(blipRobbery , 161)
SetBlipScale(blipRobbery , 2.0)
SetBlipColour(blipRobbery, 3)
PulseBlip(blipRobbery)
Wait(60000)
RemoveBlip(blipRobbery)
end
end)
function Policenotifyregister()
local playerCoords = GetEntityCoords(PlayerPedId(-1))
local currentStreetName = GetCurrentStreetName()
TriggerServerEvent('estrp-shoprobbery:cashregisterrobbery', playerCoords,currentStreetName)
end
Last updated