magazinesAmmo

From Bohemia Interactive Community
Revision as of 20:37, 11 September 2016 by SilentSpike_bi_wiki (talk | contribs) (works on boxes too)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Introduced with Arma 3 version 0.76
  

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
0.76

Description

Description:
Returns array of arrays of all vehicle's magazines and their ammo count (also works on supply boxes). When applied to a unit (soldier), the command behaves differently and will omit magazines already loaded into unit's weapons. Use magazinesAmmoFull to return all magazines.

Output format:
[[magazine1],[magazine2],[magazine3]...[magazineN]]

Magazine format:
0: Magazine class name
1: Magazine current ammo count

Syntax

Syntax:
magazinesAmmo vehicle
Parameters:
vehicle: Object - unit or vehicle.
Return Value:
Array

Examples

Example 1:
_magazinesAmmo = magazinesAmmo player; /* [ ["30Rnd_65x39_caseless_mag",30], ["30Rnd_65x39_caseless_mag",30], ["16Rnd_9x21_Mag",16], ["SmokeShellGreen",1], ["Chemlight_green",1], ["HandGrenade",1] ] */
Example 2:
_magazinesAmmo = magazinesAmmo Mi_48; /* [ ["250Rnd_30mm_APDS_shells",250], ["250Rnd_30mm_HE_shells",250], ["8Rnd_LG_scalpel",8], ["38Rnd_80mm_rockets",38] ] */

Additional Information

Multiplayer:
-
See also:
magazinesAmmoFullmagazinesAmmoCargomagazinesDetailmagazinesmagazinesTurret

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section

Posted on December 20, 2014 - 14:41 (UTC)
Actium
When used on vehicles this will only return all magazines associated with a single turretPath (which one depends on the actual armament of the vehicle, usually the first armed turretPath or alternatively turretPath [-1]).
If you want to get all turrets' magazines, use allTurrets and magazinesTurret. --Actium (talk) 15:41, 20 December 2014 (CET)