Difference between revisions of "ammo"
Jump to navigation Jump to search
m (Text replacement - "</dl> <dl class="command_description"> " to "")
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
|(6 intermediate revisions by the same user not shown)|
|Line 36:||Line 36:|
|x1= <>_count = player ammo "M16"; //returns 30 in case of a full magazine</>
|x2= <>_count = player ammo "M203Muzzle";</>
|x3= <>_count = player ammo primaryWeapon player;</>
|seealso= [[setAmmo]] [[someAmmo]] [[magazines]]
Latest revision as of 11:21, 13 May 2022
- Check how many rounds are left in the currently loaded magazine in the given muzzle. Since Arma v1.56 the command also returns ammo for units in vehicles.
- Unit Inventory
- unit ammo muzzle
- unit: Object
- muzzle: String - muzzle of a weapon. See the topic Weapons for reference about possible values.
- Return Value:
- Example 1:
- Example 2:
- Example 3:
- Posted on February 17, 2012
- OA 1.60: The command works (now?) also for units in vehicles. However only for the vehicle's gunners' weapons - aka those returned by "weapons vehicle".
- Posted on August 30, 2018 - 15:42 (UTC)
- Actually the command wants the currentMuzzle (gunner _vehicle) as parameter - not the weapon class. Most of the time both are the same. However when you have custom modes for the weapons, this is likely not true.