setPedAmmo
SET_PED_AMMO0x14E56BC5B5DB6A19The GTA V native SET_PED_AMMO of the WEAPON namespace, as LS:MP client scripts call it: the global function setPedAmmo, in JavaScript and in Lua.
setPedAmmo(ped: Ped, weaponHash: Hash, ammo: number, p3: boolean): voidsetPedAmmo(ped: Ped, weaponHash: Hash, ammo: integer, p3: boolean)Usage
JavaScript
setPedAmmo(ped, weaponHash, ammo, p3);Lua
setPedAmmo(ped, weaponHash, ammo, p3)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
weaponHash | Hash | number | integer |
ammo | int | number | integer |
p3 | BOOL | boolean | boolean |
Returns
Nothing. In JavaScript the call evaluates to undefined.
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
void SET_PED_AMMO(Ped ped, Hash weaponHash, int ammo, BOOL p3)- Hash
0x14E56BC5B5DB6A19