WeaponClient

addAmmoToPed

ADD_AMMO_TO_PED0x78F0424C34306220

The 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.

SignatureJavaScript
addAmmoToPed(ped: Ped, weaponHash: Hash, ammo: number): void
SignatureLua
addAmmoToPed(ped: Ped, weaponHash: Hash, ammo: integer)

Usage

JavaScript
addAmmoToPed(ped, weaponHash, ammo);
Lua
addAmmoToPed(ped, weaponHash, ammo)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
ammointnumberinteger

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.

Reference

Namespace
Weapon WEAPON
In the game
void ADD_AMMO_TO_PED(Ped ped, Hash weaponHash, int ammo)
Hash
0x78F0424C34306220

Open in the interactive natives reference