Refactor Dispatch.SendAlert for clarity

Assigns alert data to a local variable before passing it to exports.tk_dispatch:addCall, improving readability and maintainability.
This commit is contained in:
MrNewb committed 2025-10-19 23:04:54 -04:00
1 parent 664b397404
commit 3a9424659b
1 file changed
+3 -2
@@ -3,7 +3,7 @@ if GetResourceState('tk_dispatch') == 'missing' then return end
Dispatch = Dispatch or {}
Dispatch.SendAlert = function(data)
exports.tk_dispatch:addCall({
local alertData = {
title = data.message,
code = data.code or '10-80',
priority = 'Priority 3',
@@ -17,7 +17,8 @@ Dispatch.SendAlert = function(data)
scale = data.blipData.scale or 0.8,
},
jobs = data.jobs or {'police'},
})
}
exports.tk_dispatch:addCall(alertData)
end
---This will get the name of the in use resource.