From bcbc6666f8a5b2e5bb8c44e78efd9153492eafa4 Mon Sep 17 00:00:00 2001 From: PugDev23 Date: Mon, 16 Sep 2024 20:32:27 -0700 Subject: [PATCH 1/3] Fix mistake with addBlip function Old: addBlip(data, Config.Blips[data.codeName] or data) New: addBlip(data, Config.Blips[data.codeName] or data.alert) --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 1833570..e476235 100644 --- a/client/main.lua +++ b/client/main.lua @@ -277,7 +277,7 @@ RegisterNetEvent('ps-dispatch:client:notify', function(data, source) } }) - addBlip(data, Config.Blips[data.codeName] or data) + addBlip(data, Config.Blips[data.codeName] or data.alert) RespondToDispatch:disable(false) OpenDispatchMenu:disable(true) From 3d0f26b5bb48cf03d1257a65bb2eee7bd6ed3664 Mon Sep 17 00:00:00 2001 From: PugDev23 Date: Mon, 16 Sep 2024 20:33:19 -0700 Subject: [PATCH 2/3] Fixed false being a string making it true Fixed false being a string making it true in the CustomAlert function --- client/alerts.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/alerts.lua b/client/alerts.lua index b394083..5811ca7 100644 --- a/client/alerts.lua +++ b/client/alerts.lua @@ -32,8 +32,8 @@ local function CustomAlert(data) length = data.length or 2, -- How long it stays on the map sound = data.sound or "Lose_1st", -- Alert sound sound2 = data.sound2 or "GTAO_FM_Events_Soundset", -- Alert sound - offset = data.offset or "false", -- Blip / radius offset - flash = data.flash or "false" -- Blip flash + offset = data.offset or false, -- Blip / radius offset + flash = data.flash or false -- Blip flash }, jobs = { 'leo' }, } From 33284c5ce0badb704f78d4e3e69a49cc39ab72ad Mon Sep 17 00:00:00 2001 From: PugDev23 Date: Tue, 16 Dec 2025 08:23:23 -0500 Subject: [PATCH 3/3] Update eventhandlers.lua --- client/eventhandlers.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/eventhandlers.lua b/client/eventhandlers.lua index 1fc24bc..12f905d 100644 --- a/client/eventhandlers.lua +++ b/client/eventhandlers.lua @@ -1,5 +1,19 @@ local timer = {} +--- Safely checks a boolean export on a started resource. +---@param res string Resource name +---@param exp string Export function name +---@return boolean +local function InMinigame(res, exp) + if GetResourceState(res) ~= "started" then return false end + + local ok, result = pcall(function() + return exports[res] and exports[res][exp] and exports[res][exp]() + end) + + return ok and result == true +end + ---@param name string -- The name of the timer ---@param action function -- The function to execute when the timer is up ---@vararg any -- Arguments to pass to the action function @@ -39,6 +53,7 @@ local function BlacklistedWeapon(ped) end AddEventHandler('CEventGunShot', function(witnesses, ped) + if InMinigame("pug-paintball", "IsInPaintball") or InMinigame("pug-battleroyale", "IsInBattleRoyale") then return end if IsPedCurrentWeaponSilenced(cache.ped) then return end if inNoDispatchZone then return end if BlacklistedWeapon(cache.ped) then return end