WeaponClient

getMaxAmmoInClip

GET_MAX_AMMO_IN_CLIP0xA38DCFFCEA8962FA

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

SignatureJavaScript
getMaxAmmoInClip(ped: Ped, weaponHash: Hash, p2: boolean): number
SignatureLua
getMaxAmmoInClip(ped: Ped, weaponHash: Hash, p2: boolean): integer

Usage

JavaScript
const result = getMaxAmmoInClip(ped, weaponHash, p2);
Lua
local result = getMaxAmmoInClip(ped, weaponHash, p2)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
p2BOOLbooleanboolean

Returns

int JavaScript number, Lua integer

Notes

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

p2 is mostly 1 in the scripts.
Full list of weapons by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/weapons.json

Reference

Namespace
Weapon WEAPON
In the game
int GET_MAX_AMMO_IN_CLIP(Ped ped, Hash weaponHash, BOOL p2)
Hash
0xA38DCFFCEA8962FA

Open in the interactive natives reference