{"name":"uniqueUnitItems","title":"uniqueUnitItems","type":"command","url":"https://community.bistudio.com/wiki/uniqueUnitItems","revid":310366,"updated":"2022-05-05T17:43:22Z","groups":["Unit Inventory"],"status":"ok","games":{"arma3":"2.06"},"since":"arma3 2.06","arma3_since":"2.06","locality":{"argument":"global"},"description":"Returns hashmap of all items in units inventory as [classname, count] pairs.\n\n> [!NOTE]\n> - *weaponItems*, *uniformItems*, *vestItems*, *backpackItems* arguments use the following Number values:\n>   - 0: do not return value\n>   - 1: returns container only (weapon or container)\n>   - 2: returns container and its content\n> - weapons/containers that are stored inside containers (e.g weapon in backpack) always return all contents if contents for the parent container are enabled.","syntaxes":[{"syntax":"uniqueUnitItems unit","params":[{"name":"unit","type":"Object","type_expr":"Object"}],"returns":{"type":"HashMap","type_expr":"HashMap","description":"in format itemClassname (String) → amount (Number)","text":"HashMap in format itemClassname (String) → amount (Number)"},"form":"unary","right":{"text":"unit"}},{"syntax":"uniqueUnitItems [unit, weaponsItems, uniformItems, vestItems, backpackItems, assignedItems]","params":[{"name":"unit","type":"Object","type_expr":"Object"},{"name":"weaponsItems","type":"Number","optional":true,"default":"2","description":"weapons (including binoculars) and their accessories (flashlight etc), loaded magazines","type_expr":"Number","text":"weaponsItems: Number - (Optional, default 2) weapons (including binoculars) and their accessories (flashlight etc), loaded magazines"},{"name":"uniformItems","type":"Number","optional":true,"default":"2","type_expr":"Number","text":"uniformItems: Number - (Optional, default 2)"},{"name":"vestItems","type":"Number","optional":true,"default":"2","type_expr":"Number","text":"vestItems: Number - (Optional, default 2)"},{"name":"backpackItems","type":"Number","optional":true,"default":"2","type_expr":"Number","text":"backpackItems: Number - (Optional, default 2)"},{"name":"assignedItems","type":"Boolean","optional":true,"default":"true","description":"returns assignedItems as well as headgear and goggles","type_expr":"Boolean","text":"assignedItems: Boolean - (Optional, default true) returns assignedItems as well as headgear and goggles"}],"returns":{"type":"HashMap","type_expr":"HashMap","description":"in format itemClassname (String) → amount (Number)","text":"HashMap in format itemClassname (String) → amount (Number)"},"form":"unary","right":{"text":"[unit, weaponsItems, uniformItems, vestItems, backpackItems, assignedItems]"}}],"examples":[{"code":["private _unitUniqueItems = uniqueUnitItems [player, 0, 2, 2, 2, true];\nif (_unitUniqueItems getOrDefault [\"FirstAidKit\", 0] > 5) then { hint \"I'm rich of FAK to give!\"; };"]},{"code":["private _unitUniqueItems = uniqueUnitItems [cursorObject];"]}],"see_also":["getUnitLoadout"]}