The Lab
WEAPON native

GET_MAX_AMMO

returns BOOL3 paramsbuild 1207

Writes the maximum ammo the ped can carry for the weapon weaponHash to ammo. Returns true on success.

Signature

C
BOOL GET_MAX_AMMO(Ped ped, int* ammo, Hash weaponHash); // 0xDC16122C7A20C933 b1207

Parameters

#NameType
1pedPed
2ammoint* (out pointer)
3weaponHashHash

Facts

Facts about GET_MAX_AMMO
Name
GET_MAX_AMMO
Hash
0xDC16122C7A20C933
Namespace
Returns
BOOL
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result, ammo = Citizen.InvokeNative(0xDC16122C7A20C933, -- GET_MAX_AMMO
  PlayerPedId(), -- Ped ped
  Citizen.PointerValueInt(), -- int* ammo
  GetHashKey("weapon_revolver_cattleman"), -- Hash weaponHash
  Citizen.ReturnResultAnyway()
)
if result then
  -- ...
end
JavaScript
const [result, ammo] = Citizen.invokeNative("0xDC16122C7A20C933", // GET_MAX_AMMO
  PlayerPedId(), // Ped ped
  Citizen.pointerValueInt(), // int* ammo
  GetHashKey("weapon_revolver_cattleman"), // Hash weaponHash
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var ammoArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0xDC16122C7A20C933, // GET_MAX_AMMO
  API.PlayerPedId(), // Ped ped
  ammoArg, // int* ammo
  (uint)API.GetHashKey("weapon_revolver_cattleman") // Hash weaponHash
);
int ammo = ammoArg.GetResult<int>();
All WEAPON natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.