attempt to add piotreq_gpt (dispatch compatability)
This commit is contained in:
1 parent
9b2b7de2b4
commit
fd28d9a1a6
2 files changed
+49
No files matched your search
@@ -0,0 +1,10 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
if GetResourceState('piotreq_gpt') == 'missing' then return end
|
||||||
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
|
Dispatch.SendAlert = function(data)
|
||||||
|
if not data then return end
|
||||||
|
TriggerServerEvent('community_bridge:Server:piotreq_gpt', data)
|
||||||
|
end
|
||||||
|
|
||||||
|
return Dispatch
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
if GetResourceState('piotreq_gpt') == 'missing' then return end
|
||||||
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
|
Dispatch.SendAlert = function(src, alertData)
|
||||||
|
-- No clue if this works, but itd be nice to have someone test it.
|
||||||
|
--https://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/police-mdt/dispatch-system
|
||||||
|
exports['piotreq_gpt']:SendAlert(src, {
|
||||||
|
title = alertData.message or "No message provided",
|
||||||
|
code = alertData.code or '10-80',
|
||||||
|
icon = alertData.icon or 'fas fa-question',
|
||||||
|
info = {
|
||||||
|
{icon = alertData.icon or 'fas fa-question', data = alertData.message or "No additional info", isStreet = false},
|
||||||
|
},
|
||||||
|
--jobs = alertData.jobs or "police",
|
||||||
|
blip = { -- optional
|
||||||
|
scale = alertData.blipData and alertData.blipData.scale or 1.0,
|
||||||
|
sprite = alertData.blipData and alertData.blipData.sprite or 161,
|
||||||
|
category = 1, -- default 1
|
||||||
|
color = alertData.blipData and alertData.blipData.color or 84,
|
||||||
|
hidden = false, -- default false (hidden on legend)
|
||||||
|
priority = alertData.priority or 5, -- default 5
|
||||||
|
short = true, -- as short range? default true
|
||||||
|
alpha = 200, -- default 255
|
||||||
|
name = alertData.message or "Dispatch Alert"
|
||||||
|
},
|
||||||
|
type = 'normal', -- default normal
|
||||||
|
canAnswer = true, -- default false
|
||||||
|
maxOfficers = 6, -- default 4
|
||||||
|
time = 10,-- 10 minutes, default 5
|
||||||
|
notifyTime = 8000, -- 8 seconds, default 7
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
RegisterNetEvent('community_bridge:Server:piotreq_gpt', function(data)
|
||||||
|
local src = source
|
||||||
|
Dispatch.SendAlert(src, data)
|
||||||
|
end)
|
||||||
|
|
||||||
|
return Dispatch
|
||||||
Reference in new issue
Block a user