Skip to main content

Magazine Ammunition · Server Authority

Magazine Ammunition · Server Authority

The v1.6.9 ammunition model treats the inventory as the authority for reserve rounds.

Reload transaction

When a reload is requested, the server calculates:

needed = magazineSize - currentLoadedAmmo
consumed = min(needed, reserveItemCount)
newLoadedAmmo = currentLoadedAmmo + consumed

Only consumed reserve rounds are removed from inventory.

Example

A pistol has:

Magazine capacity: 17
Loaded rounds:      5
Reserve ammo item:  30

Nord removes 12 rounds from the ammo item and sets the weapon to 17 loaded rounds. The remaining 18 reserve rounds stay in the inventory.

Client synchronization

Client ammo reports are decrease-only from the server's point of view. A client cannot increase authoritative weapon ammo merely by reporting a larger GTA ammo value.

First-use magazine detection

If a weapon instance has no metadata.magazineSize, Nord can use the GTA native clip size as a first-use seed when:

Config.WeaponAmmo.DetectMagazineFromGame = true

Once stored, the metadata value is authoritative for that weapon instance.