diff --git a/client/main.lua b/client/main.lua index a95f61a..5ad1d09 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..0f1af73 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, 'partial') 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)