Documentation, deprecated old points, removed incomplete clothing bridge.
Documentation added, deprecated old points, removed incomplete clothing bridge. I migrated the points into the new system and added deprecation notices. Cleaned some white spaces because they made me unhappy. Added GetStreetNameAtCoords as it may be useful to return a string for others. Added support for lb-tablet dispatch alerts (thank you loaf)
This commit is contained in:
1 parent
3e936d2c1c
commit
6bdee6ad91
27 files changed
+276
-411
No files matched your search
@@ -0,0 +1,38 @@
|
||||
if GetResourceState('lb-tablet') ~= 'started' then return end
|
||||
Dispatch = Dispatch or {}
|
||||
|
||||
local function getPriorityLevel(priority)
|
||||
if priority == 1 then
|
||||
return 'low'
|
||||
elseif priority == 2 then
|
||||
return 'medium'
|
||||
elseif priority == 3 then
|
||||
return 'high'
|
||||
else
|
||||
return 'medium'
|
||||
end
|
||||
end
|
||||
|
||||
Dispatch.SendAlert = function(data)
|
||||
local streetName, _ = Utility.GetStreetNameAtCoords(data.coords)
|
||||
local priority = getPriorityLevel(data.priority)
|
||||
if type(data.jobs) == 'table' then
|
||||
data.jobs = data.jobs[1]
|
||||
end
|
||||
if data.time and data.time > 1000 then
|
||||
data.time = math.floor((data.time / 1000) + 0.5)
|
||||
end
|
||||
local alertData = {
|
||||
priority = priority,
|
||||
code = data.code or '10-80',
|
||||
title = 'Dispatch Alert!',
|
||||
description = data.message,
|
||||
location = {
|
||||
label = streetName,
|
||||
coords = vec2(data.coords.x, data.coords.y)
|
||||
},
|
||||
time = data.time or 10000,
|
||||
job = data.jobs,
|
||||
}
|
||||
TriggerServerEvent("community_bridge:server:dispatch:sendAlert", alertData)
|
||||
end
|
||||
Reference in new issue
Block a user