uniqueUnitItems: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Page creation - missing r1) |
Lou Montana (talk | contribs) m (Fix example) |
||
Line 36: | Line 36: | ||
|r1= [[HashMap]] <!-- ''TBD'' --><!-- [[Array]] of [[HashMap]]s in format key: containerName ([[String]]) → value: amount ([[Number]]) --> | |r1= [[HashMap]] <!-- ''TBD'' --><!-- [[Array]] of [[HashMap]]s in format key: containerName ([[String]]) → value: amount ([[Number]]) --> | ||
|x1= <code>[[private]] _unitUniqueItems = [[uniqueUnitItems]] [0, 2, 2 | |x1= <code>[[private]] _unitUniqueItems = [[uniqueUnitItems]] [<nowiki/>[[player]], 0, 2, 2, 2, [[true]]]; | ||
[[if]] (_unitUniqueItems [[getOrDefault]] ["FirstAidKit", | [[if]] (_unitUniqueItems [[getOrDefault]] ["FirstAidKit", 0] > 5) [[then]] { [[hint]] "I'm rich if FAK to give!"; };</code> | ||
|seealso= [[getUnitLoadout]] | |seealso= [[getUnitLoadout]] | ||
}} | }} |
Revision as of 16:51, 21 July 2021
Description
- Description:
- Returns hashmap of all items in units inventory as [classname, count] pairs.
- Groups:
- Unit Inventory
Syntax
- Syntax:
- uniqueUnitItems [unit, weaponItems, uniform, vest, backpack, assignedItems]
- Parameters:
- unit: Object
- weaponItems: Number
- uniform: Number
- vest: Number
- backpack: Number
- assignedItems: Boolean
- Return Value:
- HashMap
Examples
- Example 1:
private _unitUniqueItems = uniqueUnitItems [player, 0, 2, 2, 2, true]; if (_unitUniqueItems getOrDefault ["FirstAidKit", 0] > 5) then { hint "I'm rich if FAK to give!"; };
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