WeaponClient

addPedAmmoByType

ADD_PED_AMMO_BY_TYPE0x2472622CE1F2D45F

The GTA V native ADD_PED_AMMO_BY_TYPE of the WEAPON namespace, as LS:MP client scripts call it: the global function addPedAmmoByType, in JavaScript and in Lua.

SignatureJavaScript
addPedAmmoByType(ped: Ped, ammoTypeHash: Hash, ammo: number): void
SignatureLua
addPedAmmoByType(ped: Ped, ammoTypeHash: Hash, ammo: integer)

Usage

JavaScript
addPedAmmoByType(ped, ammoTypeHash, ammo);
Lua
addPedAmmoByType(ped, ammoTypeHash, ammo)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
ammoTypeHashHashnumberinteger
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_PED_AMMO_BY_TYPE(Ped ped, Hash ammoTypeHash, int ammo)
Hash
0x2472622CE1F2D45F
Introduced
Game build 1103 legacy numbering
Formerly
_ADD_PED_AMMO _ADD_AMMO_TO_PED_BY_TYPE

Open in the interactive natives reference