WeaponClient

setPedInfiniteAmmo

SET_PED_INFINITE_AMMO0x3EDCB0505123623B

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

SignatureJavaScript
setPedInfiniteAmmo(ped: Ped, toggle: boolean, weaponHash: Hash): void
SignatureLua
setPedInfiniteAmmo(ped: Ped, toggle: boolean, weaponHash: Hash)

Usage

JavaScript
setPedInfiniteAmmo(ped, toggle, weaponHash);
Lua
setPedInfiniteAmmo(ped, toggle, weaponHash)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
toggleBOOLbooleanboolean
weaponHashHashnumberinteger

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_INFINITE_AMMO(Ped ped, BOOL toggle, Hash weaponHash)
Hash
0x3EDCB0505123623B

Open in the interactive natives reference