diff --git a/client.lua b/client.lua index 413f4a9ea7..1278f213c9 100644 --- a/client.lua +++ b/client.lua @@ -1511,7 +1511,7 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven currentWeapon.metadata.ammo = (weaponAmmo < currentAmmo) and 0 or currentAmmo if currentAmmo <= 0 then - SetPedInfiniteAmmo(playerPed, false, currentWeapon.hash) + SetPedInfiniteAmmoClip(playerPed, false) end else currentAmmo = GetAmmoInPedWeapon(playerPed, currentWeapon.hash) diff --git a/modules/weapon/client.lua b/modules/weapon/client.lua index c4943fc617..1bdf46c90b 100644 --- a/modules/weapon/client.lua +++ b/modules/weapon/client.lua @@ -82,7 +82,7 @@ function Weapon.Equip(item, data, noWeaponAnim) if item.group == `GROUP_PETROLCAN` or item.group == `GROUP_FIREEXTINGUISHER` then item.metadata.ammo = item.metadata.durability - SetPedInfiniteAmmo(playerPed, true, data.hash) + SetPedInfiniteAmmoClip(playerPed, true) end TriggerEvent('ox_inventory:currentWeapon', item) @@ -101,6 +101,10 @@ function Weapon.Disarm(currentWeapon, noAnim) TriggerServerEvent('ox_inventory:updateWeapon') SetPedAmmo(cache.ped, currentWeapon.hash, 0) + if currentWeapon.group == `GROUP_PETROLCAN` or currentWeapon.group == `GROUP_FIREEXTINGUISHER` then + SetPedInfiniteAmmoClip(cache.ped, false) + end + if client.weaponanims and not noAnim then if cache.vehicle and vehicleIsCycle(cache.vehicle) then goto skipAnim