WeaponClient

setPedAmmoByType

SET_PED_AMMO_BY_TYPE0x5FD1E1F011E76D7E

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

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

Usage

JavaScript
setPedAmmoByType(ped, ammoTypeHash, ammo);
Lua
setPedAmmoByType(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 SET_PED_AMMO_BY_TYPE(Ped ped, Hash ammoTypeHash, int ammo)
Hash
0x5FD1E1F011E76D7E

Open in the interactive natives reference