Files
community_bridge/modules/dispatch/tk_dispatch/client/client.lua
T
MrNewb 90c65dc55e Add GetResourceName function to all modules
Introduces a standardized GetResourceName function to banking, clothing, dispatch, doorlock, framework, fuel, helptext, housing, and other modules. This function returns the name of the in-use resource, improving resource identification and interoperability across the codebase.
2025-09-10 12:27:12 -04:00

29 lines
825 B
Lua

---@diagnostic disable: duplicate-set-field
if GetResourceState('tk_dispatch') == 'missing' then return end
Dispatch = Dispatch or {}
Dispatch.SendAlert = function(data)
exports.tk_dispatch:addCall({
title = data.message,
code = data.code or '10-80',
priority = 'Priority 3',
coords = data.coords or GetEntityCoords(PlayerPedId()),
showLocation = true,
showGender = false,
playSound = true,
blip = {
color = data.blipData.color or 3,
sprite = data.blipData.sprite or 1,
scale = data.blipData.scale or 0.8,
},
jobs = data.jobs or {'police'},
})
end
---This will get the name of the in use resource.
---@return string
Dispatch.GetResourceName = function()
return 'tk_dispatch'
end
return Dispatch