magazinesAmmoFull: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Add since template usage)
Line 11: Line 11:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Returns array of arrays of all vehicle's magazines with extended information about them. Magazine type is available for loaded magazines only, otherwise it is -1.
| Returns array of arrays of all vehicle's magazines with extended information about them.
 
{{Important | This command does not return empty magazines from containers, only from the weapon. Use [[magazinesAmmoCargo]] instead.}} |DESCRIPTION=
 
<br><br>'''Output format''':
<br>[[magazine1],[magazine2],[magazine3]...[magazineN]]
 
<br><br>'''Magazine format''':
<br>0: Magazine class name
<br>1: Magazine current ammo count
<br>2: Magazine state (true - loaded, false - not loaded)
<br>3: Magazine type (-1 - n/a, 0 - grenade, 1 - primary weapon mag, 2 - handgun mag, 4 - secondary weapon mag, 4096 - binocular weapon mag, 65536 - vehicle mag)
<br>4: Magazine location ("Vest", "Uniform", "Backpack", "") or corresponding [[currentMuzzle]] <br><br>
{{Important | This command does not return empty magazines from containers, only from the weapon. Use <tt>[[magazinesAmmoCargo]] &lt;container&gt;</tt> instead}} |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[magazinesAmmoFull]] vehicle |SYNTAX=
| [[magazinesAmmoFull]] vehicle |SYNTAX=


|p1= vehicle: [[Object]] - unit or vehicle|PARAMETER1=  
|p1= vehicle: [[Object]] - unit or vehicle |PARAMETER1=
 
|r1= [[Array]] of [[Array]]s in format:
* [[String]]: magazine class name
* [[Number]]: magazine ammo count
* [[Boolean]]: is magazine loaded
* [[Number]]: magazine type:
** -1 = n/a (default if magazine is not loaded)
** 0 - grenade
** 1 - primary weapon mag
** 2 - handgun mag
** 4 - secondary weapon mag
** 4096 - binocular weapon mag
** 65536 - vehicle mag
* [[String]]: magazine location: "Vest", "Uniform", "Backpack", "" or [[currentMuzzle]] if the magazine is loaded |RETURNVALUE=


| [[Array]] |RETURNVALUE=  
|s2= [[magazinesAmmoFull]] [vehicle, includeEmpty] {{since|arma3|1.99.146475|y}} |SYNTAX2=


| s2= [[magazinesAmmoFull]] [vehicle, includeEmpty] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Since Arma 3 v1.99.146475)|SYNTAX2=
|p21= vehicle: [[Object]] - unit or vehicle |PARAMETER21=


|p21= [vehicle, includeEmpty]: [[Array]]  |PARAMETER21=
|p22= includeEmpty: [[Boolean]] - (Optional, default [[false]]) [[true]] to include empty magazines |PARAMETER22=
|p22= vehicle: [[Object]] - unit or vehicle.  |PARAMETER22=
|p23= includeEmpty (Optional): [[Boolean]] - [[true]] to include empty magazines. Default: [[false]]  |PARAMETER23=  


| r2=[[Array]] |RETURNVALUE2=  
|r2= same as [[#Syntax|Primary Syntax]] |RETURNVALUE2=  
   
   
|x1=<code>_magazinesAmmoFull = [[magazinesAmmoFull]] [[player]];
|x1= <code>_magazinesAmmoFull = [[magazinesAmmoFull]] [[player]];
/*
{{codecomment|/*
[
[
["30Rnd_65x39_caseless_mag",30,false,-1,"Uniform"],
["30Rnd_65x39_caseless_mag",30,false,-1,"Uniform"],
Line 52: Line 53:
["16Rnd_9x21_Mag",16,true,2,"hgun_P07_F"]
["16Rnd_9x21_Mag",16,true,2,"hgun_P07_F"]
]
]
<nowiki>*/</nowiki></code>|EXAMPLE1=
<nowiki/>*/}}</code> |EXAMPLE1=


|x2=<code>_magazinesAmmoFull = [[magazinesAmmoFull]] Mi_48;
|x2= <code>_magazinesAmmoFull = [[magazinesAmmoFull]] Mi_48;
/*
{{codecomment|/*
[
[
["250Rnd_30mm_APDS_shells",250,false,-1,""],
["250Rnd_30mm_APDS_shells",250,false,-1,""],
Line 62: Line 63:
["38Rnd_80mm_rockets",38,true,65536,"rockets_Skyfire"]
["38Rnd_80mm_rockets",38,true,65536,"rockets_Skyfire"]
]
]
<nowiki>*/</nowiki></code>|EXAMPLE2=
<nowiki/>*/}}</code>|EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


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


Line 79: Line 77:


<h3 style='display:none'>Bottom Section</h3>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
<!-- CONTINUE Notes -->
Line 92: Line 87:
--[[User:Actium|Actium]] ([[User talk:Actium|talk]]) 15:40, 20 December 2014 (CET)
--[[User:Actium|Actium]] ([[User talk:Actium|talk]]) 15:40, 20 December 2014 (CET)
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on February 10, 2015 - 04:40 (UTC)</dd>
<dd class="notedate">Posted on February 10, 2015 - 04:40 (UTC)</dd>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
Line 107: Line 98:
This is the case of WY-55 Hellcat. This function returns an empty array.
This is the case of WY-55 Hellcat. This function returns an empty array.
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on April 5, 2019 - 22:28 (UTC)</dd>
<dd class="notedate">Posted on April 5, 2019 - 22:28 (UTC)</dd>
<dt class="note">[[User:Yuval|Yuval]]</dt>
<dt class="note">[[User:Yuval|Yuval]]</dt>

Revision as of 23:30, 23 December 2020

Hover & click on the images for description

Description

Description:
Returns array of arrays of all vehicle's magazines with extended information about them.
This command does not return empty magazines from containers, only from the weapon. Use magazinesAmmoCargo instead.
Groups:
Unit InventoryVehicle Inventory

Syntax

Syntax:
magazinesAmmoFull vehicle
Parameters:
vehicle: Object - unit or vehicle
Return Value:
Array of Arrays in format:
  • String: magazine class name
  • Number: magazine ammo count
  • Boolean: is magazine loaded
  • Number: magazine type:
    • -1 = n/a (default if magazine is not loaded)
    • 0 - grenade
    • 1 - primary weapon mag
    • 2 - handgun mag
    • 4 - secondary weapon mag
    • 4096 - binocular weapon mag
    • 65536 - vehicle mag
  • String: magazine location: "Vest", "Uniform", "Backpack", "" or currentMuzzle if the magazine is loaded

Alternative Syntax

Syntax:
magazinesAmmoFull [vehicle, includeEmpty] Template:since
Parameters:
vehicle: Object - unit or vehicle
includeEmpty: Boolean - (Optional, default false) true to include empty magazines
Return Value:
same as Primary Syntax

Examples

Example 1:
_magazinesAmmoFull = magazinesAmmoFull player; /* [ ["30Rnd_65x39_caseless_mag",30,false,-1,"Uniform"], ["30Rnd_65x39_caseless_mag",30,false,-1,"Vest"], ["16Rnd_9x21_Mag",16,false,-1,"Vest"], ["SmokeShellGreen",1,true,0,"SmokeShellGreenMuzzle"], ["Chemlight_green",1,true,0,"ChemlightGreenMuzzle"], ["HandGrenade",1,true,0,"HandGrenadeMuzzle"], ["30Rnd_65x39_caseless_mag",30,true,1,"arifle_MX_ACO_pointer_F"], ["16Rnd_9x21_Mag",16,true,2,"hgun_P07_F"] ] */
Example 2:
_magazinesAmmoFull = magazinesAmmoFull Mi_48; /* [ ["250Rnd_30mm_APDS_shells",250,false,-1,""], ["250Rnd_30mm_HE_shells",250,true,65536,"gatling_30mm"], ["8Rnd_LG_scalpel",8,true,65536,"missiles_SCALPEL"], ["38Rnd_80mm_rockets",38,true,65536,"rockets_Skyfire"] ] */

Additional Information

See also:
See also needed

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:40 (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:40, 20 December 2014 (CET)
Posted on February 10, 2015 - 04:40 (UTC)
Pierre MGI
As Actium said, this function seems to extract data from: configfile >> "CfgVehicles" >> _the_vehicle_you_want >> "Turrets" >> "MainTurret">> "magazines". Some vehicles return an empty field {} because magazines are in straight in: configfile >> "CfgVehicles" >> _the_vehicle_you_want >> "magazines" (often dedicated to flares only). This is the case of WY-55 Hellcat. This function returns an empty array.
Posted on April 5, 2019 - 22:28 (UTC)
Yuval
This command does not include magazines loaded into weapons stored inside player's backpack (or every other container).