WeaponClient

setPedAmmo

SET_PED_AMMO0x14E56BC5B5DB6A19

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

SignatureJavaScript
setPedAmmo(ped: Ped, weaponHash: Hash, ammo: number, p3: boolean): void
SignatureLua
setPedAmmo(ped: Ped, weaponHash: Hash, ammo: integer, p3: boolean)

Usage

JavaScript
setPedAmmo(ped, weaponHash, ammo, p3);
Lua
setPedAmmo(ped, weaponHash, ammo, p3)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
ammointnumberinteger
p3BOOLbooleanboolean

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 SET_PED_AMMO(Ped ped, Hash weaponHash, int ammo, BOOL p3)
Hash
0x14E56BC5B5DB6A19

Open in the interactive natives reference