migrate cache.ped to PlayerPedId()
This commit is contained in:
1 parent
eb8a7e4449
commit
88b4daa2e8
7 files changed
+30
-21
No files matched your search
@@ -5,15 +5,16 @@ Dispatch = Dispatch or {}
|
||||
---@param data table The data to send to the dispatch system.
|
||||
---@return nil
|
||||
Dispatch.SendAlert = function(data)
|
||||
local ped = PlayerPedId()
|
||||
TriggerServerEvent('community_bridge:Server:DispatchAlert', {
|
||||
sprite = data.blipData.sprite or 161,
|
||||
color = data.blipData.color or 1,
|
||||
scale = data.blipData.scale or 0.8,
|
||||
vehicle = data.vehicle or nil,
|
||||
plate = data.vehicle and GetVehicleNumberPlateText(data.vehicle) or nil,
|
||||
ped = data.ped or cache.ped,
|
||||
pedCoords = data.pedCoords or GetEntityCoords(cache.ped),
|
||||
coords = data.coords or GetEntityCoords(cache.ped),
|
||||
ped = data.ped or ped,
|
||||
pedCoords = data.pedCoords or GetEntityCoords(ped),
|
||||
coords = data.coords or GetEntityCoords(ped),
|
||||
message = data.message or "An Alert Has Been Made",
|
||||
code = data.code or '10-80',
|
||||
icon = data.icon or 'fas fa-question',
|
||||
|
||||
@@ -3,14 +3,15 @@ if GetResourceState('bub-mdt') == 'missing' then return end
|
||||
Dispatch = Dispatch or {}
|
||||
|
||||
Dispatch.SendAlert = function(data)
|
||||
local ped = PlayerPedId()
|
||||
local alertData = {
|
||||
code = data.code or '10-80',
|
||||
offense = data.message,
|
||||
coords = data.coords or GetEntityCoords(cache.ped),
|
||||
coords = data.coords or GetEntityCoords(ped),
|
||||
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,
|
||||
blipCoords = data.coords or cache.ped and GetEntityCoords(cache.ped) or { x = 0, y = 0},
|
||||
blipCoords = data.coords or ped and GetEntityCoords(ped) or { x = 0, y = 0},
|
||||
}
|
||||
exports["bub-mdt"]:CustomAlert(alertData)
|
||||
end
|
||||
|
||||
@@ -3,6 +3,7 @@ if GetResourceState('linden_outlawalert') == 'missing' then return end
|
||||
Dispatch = Dispatch or {}
|
||||
|
||||
Dispatch.SendAlert = function(data)
|
||||
local ped = PlayerPedId()
|
||||
TriggerServerEvent('wf-alerts:svNotify', {
|
||||
dispatchData = {
|
||||
displayCode = data.code or '211',
|
||||
@@ -14,7 +15,7 @@ Dispatch.SendAlert = function(data)
|
||||
info = data.message or "Alert"
|
||||
},
|
||||
caller = 'Anonymous',
|
||||
coords = data.coords or GetEntityCoords(cache.ped)
|
||||
coords = data.coords or GetEntityCoords(ped)
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user