From 5ef25c2f46d06b1fd0ef65539d9deeb78e9960b7 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 18 Feb 2022 01:42:26 +1100 Subject: [PATCH] fix(ambulancejob): return callback when removing items Otherwise the client event won't trigger and respawn the player --- [esx_addons]/esx_ambulancejob/server/main.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/[esx_addons]/esx_ambulancejob/server/main.lua b/[esx_addons]/esx_ambulancejob/server/main.lua index ec62409e..f81b335a 100644 --- a/[esx_addons]/esx_ambulancejob/server/main.lua +++ b/[esx_addons]/esx_ambulancejob/server/main.lua @@ -101,7 +101,8 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function( local xPlayer = ESX.GetPlayerFromId(source) if Config.OxInventory and Config.RemoveItemsAfterRPDeath then - return exports.ox_inventory:ClearInventory(xPlayer.source) + exports.ox_inventory:ClearInventory(xPlayer.source) + return cb() end if Config.RemoveCashAfterRPDeath then @@ -122,7 +123,7 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function( end end - if Config.OxInventory then return end + if Config.OxInventory then return cb() end local playerLoadout = {} if Config.RemoveWeaponsAfterRPDeath then