getAmmoInClip
GET_AMMO_IN_CLIP0x2E1202248937775CThe 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.
getAmmoInClip(ped: Ped, weaponHash: Hash): [ok: boolean, ammo: number]getAmmoInClip(ped: Ped, weaponHash: Hash): boolean, integerUsage
JavaScript
const [ok, ammo] = getAmmoInClip(ped, weaponHash);Lua
local ok, ammo = getAmmoInClip(ped, weaponHash)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
weaponHash | Hash | number | integer |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | ok | BOOL | boolean | boolean | The native’s own return value. |
| 2 | ammo | int | number | integer | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
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
BOOL GET_AMMO_IN_CLIP(Ped ped, Hash weaponHash, int* ammo)- Hash
0x2E1202248937775C