WeaponClient

setAmmoInClip

SET_AMMO_IN_CLIP0xDCD2A934D65CB497

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

SignatureJavaScript
setAmmoInClip(ped: Ped, weaponHash: Hash, ammo: number): boolean
SignatureLua
setAmmoInClip(ped: Ped, weaponHash: Hash, ammo: integer): boolean

Usage

JavaScript
const result = setAmmoInClip(ped, weaponHash, ammo);
Lua
local result = setAmmoInClip(ped, weaponHash, ammo)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
ammointnumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

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
BOOL SET_AMMO_IN_CLIP(Ped ped, Hash weaponHash, int ammo)
Hash
0xDCD2A934D65CB497

Open in the interactive natives reference