From 50a79b08eae4cd6dac105ae32dadf0c122f3d4e2 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Sun, 1 Sep 2024 10:39:37 +1000 Subject: [PATCH] refactor(client): print when weapon is disarmed by game Since we've have a billion issues posted complaining about default game behaviour. --- client.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client.lua b/client.lua index 3ceb1e019..6b2ece9c3 100644 --- a/client.lua +++ b/client.lua @@ -530,6 +530,7 @@ local function useSlot(slot, noAnim) SetCurrentPedWeapon(playerPed, data.hash, false) if data.hash ~= GetSelectedPedWeapon(playerPed) then + lib.print.info(('%s cannot be used in current context (default game behaviour)'):format(item.name)) return lib.notify({ type = 'error', description = locale('cannot_use', data.label) }) end @@ -1393,6 +1394,7 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven end if weaponHash ~= currentWeapon.hash then + lib.print.info(('%s cannot be used in current context (default game behaviour)'):format(currentWeapon.name)) currentWeapon = Weapon.Disarm(currentWeapon, true) end end