diff --git a/modules/dispatch/wasabi_mdt/client/client.lua b/modules/dispatch/wasabi_mdt/client/client.lua new file mode 100644 index 0000000..29aed8d --- /dev/null +++ b/modules/dispatch/wasabi_mdt/client/client.lua @@ -0,0 +1,23 @@ +---@diagnostic disable: duplicate-set-field +if GetResourceState('wasabi_mdt') == 'missing' then return end +Dispatch = Dispatch or {} + +Dispatch.SendAlert = function(data) + local fallbackCoords = GetEntityCoords(PlayerPedId()) + local alertData = { + type = data.code or '10-80', + title = data.code or '10-80', + description = data.message or "No message provided", + location = {data.coords.x, data.coords.y, data.coords.z} or {fallbackCoords.x, fallbackCoords.y, fallbackCoords.z}, + coords = {data.coords.x, data.coords.y, data.coords.z} or {fallbackCoords.x, fallbackCoords.y, fallbackCoords.z}, + } + exports.wasabi_mdt:CreateDispatch(alertData) +end + +---This will get the name of the in use resource. +---@return string +Dispatch.GetResourceName = function() + return 'wasabi_mdt' +end + +return Dispatch \ No newline at end of file diff --git a/modules/dispatch/wasabi_mdt/server/server.lua b/modules/dispatch/wasabi_mdt/server/server.lua new file mode 100644 index 0000000..d5aad7c --- /dev/null +++ b/modules/dispatch/wasabi_mdt/server/server.lua @@ -0,0 +1,10 @@ +if GetResourceState('wasabi_mdt') == 'missing' then return end +Dispatch = Dispatch or {} + +---This will get the name of the in use resource. +---@return string +Dispatch.GetResourceName = function() + return 'wasabi_mdt' +end + +return Dispatch \ No newline at end of file