itemsWithMagazines: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {2,}\}\}" to " }}")
m (Replaced <code> with <sqf>)
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| arma3
|game1= arma3
|1.04
|version1= 1.04
|arg= global
|arg= global


|gr1= Unit Inventory
|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.
|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
|s1= [[itemsWithMagazines]] unit


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


|x1= <code>[[itemsWithMagazines]] [[player]]
|x1= <sqf>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>
 
Example result:
<code>[
<sqf>[
"FirstAidKit", //item
"FirstAidKit", //item
"30Rnd_65x39_caseless_mag", //magazine
"30Rnd_65x39_caseless_mag", //magazine
Line 24: Line 24:
"Chemlight_green", //magazine
"Chemlight_green", //magazine
"HandGrenade", //magazine
"HandGrenade", //magazine
"ToolKit", //item
"ToolKit", //item
"MineDetector" //item
"MineDetector" //item
]</code>
]</sqf>


| [[items]], [[removeAllItemsWithMagazines]]
|seealso= [[items]] [[removeAllItemsWithMagazines]]
}}
}}
{{GameCategory|arma3|New Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 14:29, 14 May 2022

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

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