From b70becf753777b623494a4651b9ba27bec00963e Mon Sep 17 00:00:00 2001 From: Cata_a <108532800+Cata-a1138@users.noreply.github.com> Date: Tue, 26 Aug 2025 23:32:14 +0800 Subject: [PATCH 1/2] fix(weapon/client): infinite ammo not working on petrolcan and fireextinguisher --- client.lua | 2 +- modules/weapon/client.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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..55ddcb8ca3 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) From 68ca504dfc62ab577e44accb8f2bcac15ec2ac6a Mon Sep 17 00:00:00 2001 From: Cata_a <108532800+Cata-a1138@users.noreply.github.com> Date: Fri, 27 Feb 2026 19:09:31 +0800 Subject: [PATCH 2/2] fix(weapon/client): prevent infinite ammo exploit when switching from petrolcan or fireextinguisher --- modules/weapon/client.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/weapon/client.lua b/modules/weapon/client.lua index 55ddcb8ca3..1bdf46c90b 100644 --- a/modules/weapon/client.lua +++ b/modules/weapon/client.lua @@ -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