From 5a1a83a226eb9e9d7fe4d382741799e71b0c128f Mon Sep 17 00:00:00 2001 From: Matthew <22198949+mafewtm@users.noreply.github.com> Date: Sat, 10 Aug 2024 20:24:36 -0400 Subject: [PATCH] fix: txAdmin Heal Everyone functionality (#98) * fix: txAdmin Heal Everyone functionality * Update main.lua --- client/main.lua | 3 ++- server/main.lua | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/client/main.lua b/client/main.lua index 0206d0d..043be9f 100644 --- a/client/main.lua +++ b/client/main.lua @@ -193,12 +193,13 @@ end ---heals player wounds. ---@param type? 'full'|any heals all wounds if full otherwise heals only major wounds. -lib.callback.register('qbx_medical:client:heal', function(type) +RegisterNetEvent('qbx_medical:client:heal', function(type) if type == 'full' then resetAllInjuries() else resetMinorInjuries() end + exports.qbx_core:Notify(locale('success.wounds_healed'), 'success') end) diff --git a/server/main.lua b/server/main.lua index 335f547..1382eba 100644 --- a/server/main.lua +++ b/server/main.lua @@ -39,10 +39,7 @@ end) ---@param player table|number local function revivePlayer(player) - if type(player) == 'number' then - player = exports.qbx_core:GetPlayer(player) - end - TriggerClientEvent('qbx_medical:client:playerRevived', player.PlayerData.source) + TriggerClientEvent('qbx_medical:client:playerRevived', player --[[@as number]]) end exports('Revive', revivePlayer) @@ -50,7 +47,7 @@ exports('Revive', revivePlayer) ---removes all ailments, sets to full health, and fills up hunger and thirst. ---@param src Source local function heal(src) - lib.callback.await('qbx_medical:client:heal', src, 'full') + TriggerClientEvent('qbx_medical:client:heal', src, 'full') end exports('Heal', heal) @@ -58,7 +55,7 @@ exports('Heal', heal) ---Removes any injuries with severity 2 or lower. Stops bleeding if bleed level is less than 3. ---@param src Source local function healPartially(src) - lib.callback.await('qbx_medical:client:heal', src, 'partial') + TriggerClientEvent('qbx_medical:client:heal', src, 'partial') end exports('HealPartially', healPartially)