GET_MAX_AMMO
Hash
0xDC16122C7A20C933Runtime name
GetMaxAmmoNamespaceWEAPON
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xDC16122C7A20C933Signature
BOOL GET_MAX_AMMO(Ped ped, int* ammo, Hash weaponHash);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
ammo | int* | — |
weaponHash | Hash | — |
Returns BOOL
Usage
local retval, ammo = GetMaxAmmo(ped, weaponHash)
-- always works, by hash
local retval, ammo = Citizen.InvokeNative(0xDC16122C7A20C933, ped, Citizen.PointerValueInt(), weaponHash, Citizen.ReturnResultAnyway())JavaScript and C#
const [retval, ammo] = GetMaxAmmo(ped, weaponHash);
// by hash
const [retval, ammo] = Citizen.invokeNative('0xDC16122C7A20C933', ped, Citizen.pointerValueInt(), weaponHash, Citizen.returnResultAnyway());var ammo = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xDC16122C7A20C933, ped, ammo, weaponHash);
// ammo.GetResult<int>()- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("name")or a backtick literal like`name`. - Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.