RedM Natives

GET_MAX_AMMO

Hash0xDC16122C7A20C933
Runtime nameGetMaxAmmo
NamespaceWEAPON
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xDC16122C7A20C933

Signature

BOOL GET_MAX_AMMO(Ped ped, int* ammo, Hash weaponHash);

Parameters

NameTypeDescription
pedPed—
ammoint*—
weaponHashHash—

Returns BOOL

Usage

Lua
local retval, ammo = GetMaxAmmo(ped, weaponHash)

-- always works, by hash
local retval, ammo = Citizen.InvokeNative(0xDC16122C7A20C933, ped, Citizen.PointerValueInt(), weaponHash, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, ammo] = GetMaxAmmo(ped, weaponHash);

// by hash
const [retval, ammo] = Citizen.invokeNative('0xDC16122C7A20C933', ped, Citizen.pointerValueInt(), weaponHash, Citizen.returnResultAnyway());
C#
var ammo = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xDC16122C7A20C933, ped, ammo, weaponHash);
// ammo.GetResult<int>()
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.