uniqueUnitItems: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Fix description) |
Lou Montana (talk | contribs) m (Add primary syntax) |
||
Line 21: | Line 21: | ||
|gr1= Unit Inventory | |gr1= Unit Inventory | ||
|s1= [[uniqueUnitItems]] | |s1= [[uniqueUnitItems]] unit | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] | ||
| | |r1= [[HashMap]] in format itemClassname ([[String]]) → amount ([[Number]]) | ||
| | |s2= [[uniqueUnitItems]] [unit, weaponsItems, uniformItems, vestItems, backpackItems, assignedItems] | ||
| | |p21= unit: [[Object]] | ||
| | |p22= weaponsItems: [[Number]] - (Optional, default 2) weapons (including binoculars) and their accessories (flashlight etc), loaded magazines | ||
| | |p23= uniformItems: [[Number]] - (Optional, default 2) | ||
| | |p24= vestItems: [[Number]] - (Optional, default 2) | ||
|p25= backpackItems: [[Number]] - (Optional, default 2) | |||
|p26= assignedItems: [[Boolean]] - (Optional, default [[true]]) returns [[assignedItems]] as well as [[headgear]] and [[hmd|goggles]] | |||
|r2= [[HashMap]] in format itemClassname ([[String]]) → amount ([[Number]]) | |||
|x1= <code>[[private]] _unitUniqueItems = [[uniqueUnitItems]] [<nowiki/>[[player]], 0, 2, 2, 2, [[true]]]; | |x1= <code>[[private]] _unitUniqueItems = [[uniqueUnitItems]] [<nowiki/>[[player]], 0, 2, 2, 2, [[true]]]; |
Revision as of 18:25, 21 July 2021
Description
- Description:
- Returns hashmap of all items in units inventory as [classname, count] pairs.
- Groups:
- Unit Inventory
Syntax
- Syntax:
- uniqueUnitItems unit
- Parameters:
- unit: Object
- Return Value:
- HashMap in format itemClassname (String) → amount (Number)
Alternative Syntax
- Syntax:
- uniqueUnitItems [unit, weaponsItems, uniformItems, vestItems, backpackItems, assignedItems]
- Parameters:
- unit: Object
- weaponsItems: Number - (Optional, default 2) weapons (including binoculars) and their accessories (flashlight etc), loaded magazines
- uniformItems: Number - (Optional, default 2)
- vestItems: Number - (Optional, default 2)
- backpackItems: Number - (Optional, default 2)
- assignedItems: Boolean - (Optional, default true) returns assignedItems as well as headgear and goggles
- Return Value:
- HashMap in format itemClassname (String) → amount (Number)
Examples
- Example 1:
private _unitUniqueItems = uniqueUnitItems [player, 0, 2, 2, 2, true]; if (_unitUniqueItems getOrDefault ["FirstAidKit", 0] > 5) then { hint "I'm rich of FAK to give!"; };
- Example 2:
private _unitUniqueItems = uniqueUnitItems [cursorObject];
Additional Information
- See also:
- getUnitLoadout
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