WeaponClientNot in this build1 output

getAmmoInVehicleWeaponClip

_GET_AMMO_IN_VEHICLE_WEAPON_CLIP0x2857938C5D407AFA

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

SignatureJavaScript
getAmmoInVehicleWeaponClip(vehicle: Vehicle, seat: number): [
  ok: boolean,
  ammo: number
]
SignatureLua
getAmmoInVehicleWeaponClip(vehicle: Vehicle, seat: integer): boolean, integer
⚠
Not in this game build

The global exists, but the native is not part of the game build LS:MP runs: calling it does nothing and returns undefined in JavaScript, nil in Lua. It never throws. See Coverage.

Usage

JavaScript
const [ok, ammo] = getAmmoInVehicleWeaponClip(vehicle, seat);
Lua
local ok, ammo = getAmmoInVehicleWeaponClip(vehicle, seat)

Parameters

ParameterTypeJavaScriptLua
vehicleVehiclenumberinteger
seatintnumberinteger

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1okBOOLbooleanbooleanThe native’s own return value.
2ammointnumberintegeroutput

Reference

Namespace
Weapon WEAPON
In the game
BOOL _GET_AMMO_IN_VEHICLE_WEAPON_CLIP(Vehicle vehicle, int seat, int* ammo)
Hash
0x2857938C5D407AFA
Introduced
Game build 3407 legacy numbering

Open in the interactive natives reference