items: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]2(\|.*)\]\]" to "{{GameCategory|arma2|Scripting Commands}}")
No edit summary
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2 |Game name=
|game1= arma2
|1.00|Game version=
|version1= 1.00
|arg= global|Multiplayer Arguments=


|gr1= Unit Inventory |GROUP1=
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Returns an array of names of all unit's stored items, including [[weapons]] but excluding [[magazines]] (see [[itemsWithMagazines]]) and [[assignedItems]]. |DESCRIPTION=
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| [[items]] unit |SYNTAX=
|game4= arma3
|version4= 0.50


|p1= unit: [[Object]]  |PARAMETER1=  
|arg= global


| [[Array]] |RETURNVALUE=  
|gr1= Unit Inventory


|descr= Returns an array of names of all unit's stored items, including [[weapons]] but excluding [[magazines]] (see [[itemsWithMagazines]]) and [[assignedItems]].


|x1= <code>_itemsPlayer <nowiki>=</nowiki> [[items]] [[player]]; </code>|EXAMPLE1=
|s1= [[items]] unit


|x2= <code>[[player]] [[sideChat]] [[format]] ["%1", [[items]] [[player]]];</code>|EXAMPLE2=
|p1= unit: [[Object]]


____________________________________________________________________________________________
|r1= [[Array]]


| [[itemsWithMagazines]], [[assignedItems]], [[primaryWeaponItems]], [[secondaryWeaponItems]] |SEEALSO=  
|x1= <sqf>_itemsPlayer = items player;</sqf>


| |MPBEHAVIOUR=  
|x2= <sqf>player sideChat format ["%1", items player];</sqf>
____________________________________________________________________________________________
 
|seealso= [[itemsWithMagazines]] [[assignedItems]] [[primaryWeaponItems]] [[secondaryWeaponItems]] [[backpacks]]
}}
}}


{{GameCategory|arma2|Scripting Commands}}
{{Note
{{GameCategory|arma3|Scripting Commands}}
|user= comp_uter15776
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
|timestamp= 20220119160104
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|text= When using '''items''' on a player; any equipped primary/secondary weapon/launchers, as well as certain throwables i.e. chemlights, smokes, grenades etc. are ''not'' returned.
For weapons and launchers that aren't stored inside a uniform, backpack or vest use '''weaponsItems'''. For throwables use '''magazines'''.
}}

Latest revision as of 00:43, 1 February 2023

Hover & click on the images for description

Description

Description:
Returns an array of names of all unit's stored items, including weapons but excluding magazines (see itemsWithMagazines) and assignedItems.
Groups:
Unit Inventory

Syntax

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

Examples

Example 1:
_itemsPlayer = items player;
Example 2:
player sideChat format ["%1", items player];

Additional Information

See also:
itemsWithMagazines assignedItems primaryWeaponItems secondaryWeaponItems 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
comp_uter15776 - c
Posted on Jan 19, 2022 - 16:01 (UTC)
When using items on a player; any equipped primary/secondary weapon/launchers, as well as certain throwables i.e. chemlights, smokes, grenades etc. are not returned. For weapons and launchers that aren't stored inside a uniform, backpack or vest use weaponsItems. For throwables use magazines.