fix for compatibility in kartik-mdt
repack job table as it needs a boolean
This commit is contained in:
1 parent
4e15466814
commit
11a82194a9
1 file changed
+7
-2
@@ -3,12 +3,17 @@ if GetResourceState('kartik-mdt') == 'missing' then return end
|
|||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
Dispatch.SendAlert = function(data)
|
Dispatch.SendAlert = function(data)
|
||||||
|
local repackJobsBools = {}
|
||||||
|
for k, v in pairs(data.jobs) do
|
||||||
|
if v then
|
||||||
|
repackJobsBools[k] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
local alertOptions = {
|
local alertOptions = {
|
||||||
title = data.message or "Alert",
|
title = data.message or "Alert",
|
||||||
code = data.code or '10-80',
|
code = data.code or '10-80',
|
||||||
description = data.message,
|
description = data.message,
|
||||||
type = "Alert",
|
type = "Alert",
|
||||||
-- sound = "gunshots",
|
|
||||||
coords = data.coords,
|
coords = data.coords,
|
||||||
blip = {
|
blip = {
|
||||||
radius = 100.0,
|
radius = 100.0,
|
||||||
@@ -17,7 +22,7 @@ Dispatch.SendAlert = function(data)
|
|||||||
scale = data.blipData.scale or 0.8,
|
scale = data.blipData.scale or 0.8,
|
||||||
length = 2
|
length = 2
|
||||||
},
|
},
|
||||||
jobs = data.jobs or {"police"},
|
jobs = repackJobsBools,
|
||||||
}
|
}
|
||||||
exports['kartik-mdt']:CustomAlert(alertOptions)
|
exports['kartik-mdt']:CustomAlert(alertOptions)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user