From 41c90f90828ed85ca1f01153dc5938f949f6efdf Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Thu, 11 Sep 2025 17:34:54 -0400 Subject: [PATCH] Add wasabi_mdt dispatch integration Introduces client and server modules for dispatch integration with the wasabi_mdt resource. Provides functions to send alerts and retrieve the resource name, enabling compatibility with the wasabi_mdt dispatch system. --- modules/dispatch/wasabi_mdt/client/client.lua | 23 +++++++++++++++++++ modules/dispatch/wasabi_mdt/server/server.lua | 10 ++++++++ 2 files changed, 33 insertions(+) create mode 100644 modules/dispatch/wasabi_mdt/client/client.lua create mode 100644 modules/dispatch/wasabi_mdt/server/server.lua 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