Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 50a79b0

Browse files
committed
refactor(client): print when weapon is disarmed by game
Since we've have a billion issues posted complaining about default game behaviour.
1 parent 868eeb3 commit 50a79b0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

client.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ local function useSlot(slot, noAnim)
530530
SetCurrentPedWeapon(playerPed, data.hash, false)
531531

532532
if data.hash ~= GetSelectedPedWeapon(playerPed) then
533+
lib.print.info(('%s cannot be used in current context (default game behaviour)'):format(item.name))
533534
return lib.notify({ type = 'error', description = locale('cannot_use', data.label) })
534535
end
535536

@@ -1393,6 +1394,7 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven
13931394
end
13941395

13951396
if weaponHash ~= currentWeapon.hash then
1397+
lib.print.info(('%s cannot be used in current context (default game behaviour)'):format(currentWeapon.name))
13961398
currentWeapon = Weapon.Disarm(currentWeapon, true)
13971399
end
13981400
end

0 commit comments

Comments
 (0)