Hello,
I am trying to create a gun package and I am having an issue that I have not been able to solve despite searching for a solution.
The pistol magazine capacity is 12 rounds. When I give the player 12 rounds, the HUD shows:
12/0
Normally, when pressing R again, I want the reserve ammo to work like this:
12/12 → 12/24 → 12/36 → 12/48
However, this is not working correctly.
For example, when the weapon is at:
12/0
and I shoot until it reaches:
6/0
the script takes 6 more bullets directly from the inventory, even though there is no reserve ammo.
So instead of properly storing the ammunition as reserve ammo, the system keeps taking ammunition directly from the inventory whenever the magazine runs out.
My setup:
How can I fix this reserve ammo system so that ammunition is properly transferred to the weapon’s reserve ammo instead of being taken directly from the inventory?
Any help would be greatly appreciated. Thank you.
That’s ox_inventory working as designed, not a misconfiguration. It caps the weapon at one magazine and treats the ammo item in your inventory as the reserve, so the right-hand number stays 0 on purpose.
The relevant bit is in ox_inventory’s client.lua, where it handles using an ammo item:
local clipSize = GetMaxAmmoInClip(playerPed, currentWeapon.hash, true)
local currentAmmo = GetAmmoInPedWeapon(playerPed, currentWeapon.hash)
local _, maxAmmo = GetMaxAmmo(playerPed, currentWeapon.hash)
if maxAmmo < clipSize then clipSize = maxAmmo end
if currentAmmo == clipSize then return end
It won’t load past clipSize, which is why 12/0 never becomes 12/12, and why at 6/0 it pulls 6 from the inventory to top you back to a full clip.
Ammo is also stored per-weapon in metadata.ammo and re-applied with SetPedAmmo on equip, so there’s nowhere for GTA reserve to persist anyway — it’d be wiped on the next equip.
No config toggle for this. You’d be patching that cap and widening what metadata.ammo is allowed to hold, and at that point you’re maintaining a fork.
is this still coming out?