getAmmoInVehicleWeaponClip
_GET_AMMO_IN_VEHICLE_WEAPON_CLIP0x2857938C5D407AFAThe 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.
getAmmoInVehicleWeaponClip(vehicle: Vehicle, seat: number): [
ok: boolean,
ammo: number
]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
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
vehicle | Vehicle | number | integer |
seat | int | number | integer |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | ok | BOOL | boolean | boolean | The native’s own return value. |
| 2 | ammo | int | number | integer | output |
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