uniqueUnitItems: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix example)
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 FAK to give!"; };</code>
[[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

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.06.

Description

Description:
Returns hashmap of all items in units inventory as [classname, count] pairs.
weaponItems, uniform, vest, backpack arguments use the following Number values:
  • 0: do not return value
  • 1: returns container's name (weapon or container)
  • 2: returns container and contents
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