magazinesAmmo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - ">Posted on December ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-12-$1")
 
(38 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 0.76


|0.76|Game version=
|gr1= Unit Inventory
____________________________________________________________________________________________


| 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.
|gr2= Vehicle Inventory


<br><br>'''Output format''':
|descr= 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.


<br>[[magazine1],[magazine2],[magazine3]...[magazineN]]
|s1= [[magazinesAmmo]] vehicle


<br><br>'''Magazine format''':
|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]]


<br>0: Magazine class name
|r1= [[Array]] of [[Array]]s in format:
* [[String]]: magazine class name
* [[Number]]: magazine ammo count


<br>1: Magazine current ammo count |DESCRIPTION=
|s2= [[magazinesAmmo]] [vehicle, includeEmpty]
____________________________________________________________________________________________


| [[magazinesAmmo]] vehicle |SYNTAX=
|s2since= arma3 2.00


|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=
|p21= vehicle: [[Object]] - unit or vehicle.


| [[Array]] |RETURNVALUE=
|p22= includeEmpty: [[Boolean]] - (Optional, default [[false]]) [[true]] to include empty magazines


| s2= [[magazinesAmmo]] [vehicle, includeEmpty] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Since Arma 3 v1.99.146475)|SYNTAX2=
|r2= [[Array]] of [[Array]]s in format:
 
* [[String]]: magazine class name
|p21= [vehicle, includeEmpty]: [[Array]] |PARAMETER21=
* [[Number]]: magazine ammo count
|p22= vehicle: [[Object]] - unit or vehicle.  |PARAMETER22=
|p23= includeEmpty (Optional): [[Boolean]] - [[true]] to include empty magazines. Default: [[false]]  |PARAMETER23=
 
| r2=[[Array]] |RETURNVALUE2=
   
   
|x1=<code>_magazinesAmmo = [[magazinesAmmo]] [[player]];
|x1= <sqf>_magazinesAmmo = magazinesAmmo player;
/*
/*
[
[
Line 44: Line 40:
["HandGrenade",1]
["HandGrenade",1]
]
]
<nowiki>*/</nowiki></code>|EXAMPLE1=
*/</sqf>


|x2=<code>_magazinesAmmo = [[magazinesAmmo]] Mi_48;
|x2= <sqf>_magazinesAmmo = magazinesAmmo Mi_48;
/*
/*
[
[
Line 54: Line 50:
["38Rnd_80mm_rockets",38]
["38Rnd_80mm_rockets",38]
]
]
<nowiki>*/</nowiki></code>|EXAMPLE2=
*/</sqf>
____________________________________________________________________________________________


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


<h3 style='display:none'>Notes</h3>
<dl class="command_description">
<dl class='command_description'>
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
</dl>


<h3 style='display:none'>Bottom Section</h3>
<dt></dt>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
<dd class="notedate">Posted on 2014-12-20 - 14:41 (UTC)</dd>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on December 20, 2014 - 14:41 (UTC)</dd>
<dt class="note">[[User:Actium|Actium]]</dt>
<dt class="note">[[User:Actium|Actium]]</dt>
<dd class="note">
<dd class="note">
Line 84: Line 65:
--[[User:Actium|Actium]] ([[User talk:Actium|talk]]) 15:41, 20 December 2014 (CET)
--[[User:Actium|Actium]] ([[User talk:Actium|talk]]) 15:41, 20 December 2014 (CET)
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 00:13, 14 May 2023

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]
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:
magazinesAmmoFull magazinesAmmoCargo magazinesDetail magazines magazinesTurret

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
Posted on 2014-12-20 - 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)