Skip to content

Commit

Permalink
refactor(client): adjust prints on weapon hash mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Nov 9, 2024
1 parent 39c50fb commit 4c530d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +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))
lib.print.info(('failed to equip %s (cause unknown)'):format(item.name))
return lib.notify({ type = 'error', description = locale('cannot_use', data.label) })
end

Expand Down Expand Up @@ -1401,7 +1401,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))
lib.print.info(('%s was forcibly unequipped (caused by game behaviour or another resource)'):format(currentWeapon.name))
currentWeapon = Weapon.Disarm(currentWeapon, true)
end
end
Expand Down

0 comments on commit 4c530d0

Please sign in to comment.