itemsWithMagazines: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|1.04|Game version=
|version1= 1.04
|arg= global|Multiplayer Arguments=
|arg= global


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


| Returns combined array including all unit's stored [[items]] and all unit's stored [[magazines]] and all unit's '''stored''' [[weapons]]. Loaded magazines such as [[currentMagazine]], [[primaryWeaponMagazine]], [[secondaryWeaponMagazine]], [[handgunMagazine]], [[binocularMagazine]] as well as [[assignedItems]] are excluded. |DESCRIPTION=
|descr= Returns combined array including all unit's stored [[items]] and all unit's stored [[magazines]] and all unit's '''stored''' [[weapons]]. Loaded magazines such as [[currentMagazine]], [[primaryWeaponMagazine]], [[secondaryWeaponMagazine]], [[handgunMagazine]], [[binocularMagazine]] as well as [[assignedItems]] are excluded.
____________________________________________________________________________________________


| '''itemsWithMagazines''' unit |SYNTAX=
|s1= [[itemsWithMagazines]] unit


|p1= unit: [[Object]] |PARAMETER1=
|p1= unit: [[Object]]
| [[Array]] |RETURNVALUE=
|r1= [[Array]]


 
|x1= <sqf>
|x1= <code>[[itemsWithMagazines]] [[player]]
private _res1 = itemsWithMagazines player;
//is essentially the same as
// ... is essentially the same as ...
[[items]] [[player]] + [[magazines]] [[player]]</code>
private _res2 = items player + magazines player;
 
</sqf>
<code>[
Example result:
<sqf>
[
"FirstAidKit", //item
"FirstAidKit", //item
"30Rnd_65x39_caseless_mag", //magazine
"30Rnd_65x39_caseless_mag", //magazine
Line 28: Line 27:
"Chemlight_green", //magazine
"Chemlight_green", //magazine
"HandGrenade", //magazine
"HandGrenade", //magazine
"ToolKit", //item
"ToolKit", //item
"MineDetector" //item
"MineDetector" //item
]</code>|EXAMPLE1=
]
 
</sqf>
____________________________________________________________________________________________


| [[items]], [[removeAllItemsWithMagazines]] |SEEALSO=
|seealso= [[items]] [[removeAllItemsWithMagazines]] [[backpacks]]
 
|  |MPBEHAVIOUR=
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<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}}}}]]

Latest revision as of 19:43, 3 September 2024

Hover & click on the images for description

Description

Description:
Returns combined array including all unit's stored items and all unit's stored magazines and all unit's stored weapons. Loaded magazines such as currentMagazine, primaryWeaponMagazine, secondaryWeaponMagazine, handgunMagazine, binocularMagazine as well as assignedItems are excluded.
Groups:
Unit Inventory

Syntax

Syntax:
itemsWithMagazines unit
Parameters:
unit: Object
Return Value:
Array

Examples

Example 1:
private _res1 = itemsWithMagazines player; // ... is essentially the same as ... private _res2 = items player + magazines player;
Example result:
[ "FirstAidKit", //item "30Rnd_65x39_caseless_mag", //magazine "16Rnd_9x21_Mag", //magazine "Chemlight_green", //magazine "HandGrenade", //magazine "ToolKit", //item "MineDetector" //item ]

Additional Information

See also:
items removeAllItemsWithMagazines backpacks

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