WeaponClient1 output

getAmmoInClip

GET_AMMO_IN_CLIP0x2E1202248937775C

The GTA V native GET_AMMO_IN_CLIP of the WEAPON namespace, as LS:MP client scripts call it: the global function getAmmoInClip, in JavaScript and in Lua.

SignatureJavaScript
getAmmoInClip(ped: Ped, weaponHash: Hash): [ok: boolean, ammo: number]
SignatureLua
getAmmoInClip(ped: Ped, weaponHash: Hash): boolean, integer

Usage

JavaScript
const [ok, ammo] = getAmmoInClip(ped, weaponHash);
Lua
local ok, ammo = getAmmoInClip(ped, weaponHash)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1okBOOLbooleanbooleanThe native’s own return value.
2ammointnumberintegeroutput

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Reference

Namespace
Weapon WEAPON
In the game
BOOL GET_AMMO_IN_CLIP(Ped ped, Hash weaponHash, int* ammo)
Hash
0x2E1202248937775C

Open in the interactive natives reference