Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.00

Description

Description:

Checks how many ammunition rounds are left in the currently loaded magazine of the given weapon.

Note: Alternative syntax is available in V1.60+ and V3.4+, but not in V2.x.

Syntax

Syntax:unit ammo weapon
Parameters:
  • unit: Object - Unit or vehicle. Sub-turrets of [0] are checked (for example, [0,0]), but not different turrets (for example, [1]). For that, use the alternative syntax.
  • weapon: String - CfgWeapons class name.
Return Value:Number

Alternative Syntax

Syntax:vehicle ammo [weapon, turret] (V1.60+)
Parameters:
  • vehicle: Object - Vehicle with turrets.
  • weapon: String - CfgWeapons class name.
  • turret: Array - Specific turret to check.
Return Value:Number

Examples

Examples:
_count = someUnit ammo "AK-74"
_count = player ammo (primaryWeapon player)
_count = tank1 ammo ["VBS2_us_m240_veh_coax",[0]]

Additional Information

See also: getVehicleAmmo, someAmmo, magazines
Multiplayer: 
Problems: 

Notes