add integration for emergencydispatch
This commit is contained in:
1 parent
a15a79603b
commit
c6759228a3
2 files changed
+43
No files matched your search
@@ -0,0 +1,25 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('emergencydispatch') == 'missing' then return end
|
||||
Dispatch = Dispatch or {}
|
||||
|
||||
---This will send an alert to currently supported dispatch systems.
|
||||
---@param data table The data to send to the dispatch system.
|
||||
---@return nil
|
||||
Dispatch.SendAlert = function(data)
|
||||
local ped = PlayerPedId()
|
||||
|
||||
local job = data.job or data.jobs[0] or 'police'
|
||||
local message = data.message or "An Alert Has Been Made"
|
||||
local coords = data.coords or GetEntityCoords(ped)
|
||||
|
||||
-- The last boolean argument is unknown. The developer always uses true.
|
||||
TriggerServerEvent('emergencydispatch:emergencycall:new', job, message, coords, true)
|
||||
end
|
||||
|
||||
---This will get the name of the in use resource.
|
||||
---@return string
|
||||
Dispatch.GetResourceName = function()
|
||||
return 'emergencydispatch'
|
||||
end
|
||||
|
||||
return Dispatch
|
||||
Reference in new issue
Block a user