Files
community_bridge/modules/dispatch/bub-mdt/client/client.lua
T

19 lines
691 B
Lua
Raw Normal View History

---@diagnostic disable: duplicate-set-field
2025-05-18 23:45:37 -04:00
if GetResourceState('bub-mdt') == 'missing' then return end
2025-02-05 20:43:44 -05:00
Dispatch = Dispatch or {}
Dispatch.SendAlert = function(data)
2025-07-28 01:37:52 -04:00
local ped = PlayerPedId()
2025-02-05 20:43:44 -05:00
local alertData = {
code = data.code or '10-80',
offense = data.message,
2025-07-28 01:37:52 -04:00
coords = data.coords or GetEntityCoords(ped),
2025-02-05 20:43:44 -05:00
info = { label = data.code or '10-80', icon = data.icon or 'fas fa-question' },
blip = data.blipData.sprite or 1,
isEmergency = data.priority == 1 and true or false,
2025-07-28 01:37:52 -04:00
blipCoords = data.coords or ped and GetEntityCoords(ped) or { x = 0, y = 0},
2025-02-05 20:43:44 -05:00
}
exports["bub-mdt"]:CustomAlert(alertData)
end
return Dispatch