RedM Natives

GET_AMMO_IN_CLIP

Hash0x2E1202248937775C
Runtime nameGetAmmoInClip
NamespaceWEAPON
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x2E1202248937775C

Signature

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

Parameters

NameTypeDescription
pedPed—
ammoint*—
weaponHashHash—

Returns BOOL

Usage

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

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

// by hash
const [retval, ammo] = Citizen.invokeNative('0x2E1202248937775C', ped, Citizen.pointerValueInt(), weaponHash, Citizen.returnResultAnyway());
C#
var ammo = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x2E1202248937775C, 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.

See also

Sources

alloc8or RDR3 NativeDB

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