uniqueUnitItems: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Fix example) |
Lou Montana (talk | contribs) m (Fix fix) |
||
Line 37: | Line 37: | ||
|x1= <code>[[private]] _unitUniqueItems = [[uniqueUnitItems]] [<nowiki/>[[player]], 0, 2, 2, 2, [[true]]]; | |x1= <code>[[private]] _unitUniqueItems = [[uniqueUnitItems]] [<nowiki/>[[player]], 0, 2, 2, 2, [[true]]]; | ||
[[if]] (_unitUniqueItems [[getOrDefault]] ["FirstAidKit", 0] > 5) [[then]] { [[hint]] "I'm rich | [[if]] (_unitUniqueItems [[getOrDefault]] ["FirstAidKit", 0] > 5) [[then]] { [[hint]] "I'm rich of FAK to give!"; };</code> | ||
|seealso= [[getUnitLoadout]] | |seealso= [[getUnitLoadout]] | ||
}} | }} |
Revision as of 16:52, 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 of 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