addAmmoToPed
ADD_AMMO_TO_PED0x78F0424C34306220The GTA V native ADD_AMMO_TO_PED of the WEAPON namespace, as LS:MP client scripts call it: the global function addAmmoToPed, in JavaScript and in Lua.
addAmmoToPed(ped: Ped, weaponHash: Hash, ammo: number): voidaddAmmoToPed(ped: Ped, weaponHash: Hash, ammo: integer)Usage
JavaScript
addAmmoToPed(ped, weaponHash, ammo);Lua
addAmmoToPed(ped, weaponHash, ammo)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
weaponHash | Hash | number | integer |
ammo | int | number | integer |
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 ADD_AMMO_TO_PED(Ped ped, Hash weaponHash, int ammo)- Hash
0x78F0424C34306220