magazinesAmmo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma3 |Game name=
| arma3


|0.76|Game version=
|0.76


|gr1= Unit Inventory |GROUP1=
|gr1= Unit Inventory


|gr2= Vehicle Inventory |GROUP2=
|gr2= Vehicle Inventory


| Returns 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. |DESCRIPTION=
| Returns 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.


| [[magazinesAmmo]] vehicle |SYNTAX=
| [[magazinesAmmo]] vehicle


|p1= vehicle: [[Object]] - unit or vehicle or container. When transport is supplied, the command returns vehicle's magazines not the cargo. When container is supplied, the command behaves identically to [[magazinesAmmoCargo]] |PARAMETER1=
|p1= vehicle: [[Object]] - unit or vehicle or container. When transport is supplied, the command returns vehicle's magazines not the cargo. When container is supplied, the command behaves identically to [[magazinesAmmoCargo]]


| [[Array]] of [[Array]]s in format:
| [[Array]] of [[Array]]s in format:
* [[String]]: magazine class name
* [[String]]: magazine class name
* [[Number]]: magazine ammo count |RETURNVALUE=
* [[Number]]: magazine ammo count


|s2= [[magazinesAmmo]] [vehicle, includeEmpty] {{Since|arma3|1.99.146475|y}} |SYNTAX2=
|s2= [[magazinesAmmo]] [vehicle, includeEmpty] {{Since|arma3|1.99.146475|y}}


|p21= vehicle: [[Object]] - unit or vehicle.  |PARAMETER21=
|p21= vehicle: [[Object]] - unit or vehicle.  |PARAMETER21=
Line 27: Line 27:
|r2=  [[Array]] of [[Array]]s in format:
|r2=  [[Array]] of [[Array]]s in format:
* [[String]]: magazine class name
* [[String]]: magazine class name
* [[Number]]: magazine ammo count |RETURNVALUE2=
* [[Number]]: magazine ammo count
   
   
|x1= <code>_magazinesAmmo = [[magazinesAmmo]] [[player]];
|x1= <code>_magazinesAmmo = [[magazinesAmmo]] [[player]];
Line 39: Line 39:
["HandGrenade",1]
["HandGrenade",1]
]
]
<nowiki/>*/}}</code>|EXAMPLE1=
<nowiki/>*/}}</code>


|x2=<code>_magazinesAmmo = [[magazinesAmmo]] Mi_48;
|x2=<code>_magazinesAmmo = [[magazinesAmmo]] Mi_48;
Line 49: Line 49:
["38Rnd_80mm_rockets",38]
["38Rnd_80mm_rockets",38]
]
]
<nowiki/>*/}}</code> |EXAMPLE2=
<nowiki/>*/}}</code>


| [[magazinesAmmoFull]], [[magazinesAmmoCargo]], [[magazinesDetail]], [[magazines]], [[magazinesTurret]] |SEEALSO=
| [[magazinesAmmoFull]], [[magazinesAmmoCargo]], [[magazinesDetail]], [[magazines]], [[magazinesTurret]]
}}
}}



Revision as of 02:06, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns 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.
Groups:
Unit InventoryVehicle Inventory

Syntax

Syntax:
magazinesAmmo vehicle
Parameters:
vehicle: Object - unit or vehicle or container. When transport is supplied, the command returns vehicle's magazines not the cargo. When container is supplied, the command behaves identically to magazinesAmmoCargo
Return Value:
Array of Arrays in format:

Alternative Syntax

Syntax:
magazinesAmmo [vehicle, includeEmpty] Template:Since
Parameters:
vehicle: Object - unit or vehicle.
includeEmpty: Boolean - (Optional, default false) true to include empty magazines
Return Value:
Array of Arrays in format:

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

See also:
magazinesAmmoFullmagazinesAmmoCargomagazinesDetailmagazinesmagazinesTurret

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

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)