Files
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

33 lines
929 B
Lua

---@diagnostic disable: duplicate-set-field
if GetResourceState('cd_dispatch') == 'missing' then return end
Dispatch = Dispatch or {}
Dispatch.SendAlert = function(data)
local plyrData = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = data.jobs,
coords = data.coords,
title = data.message,
message = data.message,
flash = 0,
unique_id = plyrData.unique_id,
sound = 1,
blip = {
sprite = data.blipData.sprite,
scale = data.blipData.scale,
colour = data.blipData.color,
flashes = false,
text = data.message,
time = (data.time / 1000),
radius = 0,
}
})
end
---This will get the name of the in use resource.
---@return string
Dispatch.GetResourceName = function()
return 'cd_dispatch'
end
return Dispatch