getWeaponClipSize
GET_WEAPON_CLIP_SIZE0x583BE370B1EC6EB4The GTA V native GET_WEAPON_CLIP_SIZE of the WEAPON namespace, as LS:MP client scripts call it: the global function getWeaponClipSize, in JavaScript and in Lua.
getWeaponClipSize(weaponHash: Hash): numbergetWeaponClipSize(weaponHash: Hash): integerUsage
JavaScript
const result = getWeaponClipSize(weaponHash);Lua
local result = getWeaponClipSize(weaponHash)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
weaponHash | Hash | number | integer |
Returns
int JavaScript number, Lua integerNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
// Returns the size of the default weapon component clip.
Use it like this:
char cClipSize[32];
Hash cur;
if (getCurrentPedWeapon(playerPed, &cur, 1))
{
if (isWeaponValid(cur))
{
int iClipSize = getWeaponClipSize(cur);
sprintf_s(cClipSize, "ClipSize: %.d", iClipSize);
vDrawString(cClipSize, 0.5f, 0.5f);
}
}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_WEAPON_CLIP_SIZE(Hash weaponHash)- Hash
0x583BE370B1EC6EB4