{"name":"BIS_fnc_unitHeadgear","title":"BIS fnc unitHeadgear","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_unitHeadgear","revid":336872,"updated":"2023-01-04T16:43:48Z","groups":["Inventory"],"status":"ok","games":{"arma3":"1.48"},"since":"arma3 1.48","arma3_since":"1.48","locality":{"argument":"local"},"description":"Randomise headgear and facewear of a character.\n\n> [!IMPORTANT]\n> If the randomization is disabled, only strings parameters will be processed, array will be ignored and considered as false.","syntaxes":[{"syntax":"[unit, headgear, facewear] call BIS_fnc_unitHeadgear","params":[{"name":"unit","type":"Object","type_expr":"Object"},{"name":"headgear","type":"Boolean, String or Array","optional":true,"default":"false","description":"can be one of:\n\n- Boolean - if false, change nothing to the headgear\n- String - valid Headgear class or a valid class from Description.ext CfgUnitTemplates\n- Array - headgear list with individual probability","type_expr":"Boolean | String | Array","text":"headgear: Boolean, String or Array - (Optional, default false) can be one of:\n\n- Boolean - if false, change nothing to the headgear\n- String - valid Headgear class or a valid class from Description.ext CfgUnitTemplates\n- Array - headgear list with individual probability"},{"name":"facewear","type":"Boolean, String or Array","optional":true,"default":"false","description":"can be one of:\n\n- Boolean - if false, change nothing to the facewear\n- String - valid facewear class or a valid class from Description.ext CfgUnitTemplates\n- Array - facewear list with individual probability","type_expr":"Boolean | String | Array","text":"facewear: Boolean, String or Array - (Optional, default false) can be one of:\n\n- Boolean - if false, change nothing to the facewear\n- String - valid facewear class or a valid class from Description.ext CfgUnitTemplates\n- Array - facewear list with individual probability"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true when done"}}],"examples":[{"text":"```sqf\n[this] call BIS_fnc_unitHeadgear;                    // headgear and face wear, same as [this, [], []]\n[this, [], []] call BIS_fnc_unitHeadgear;            // headgear only\n[this, nil, []] call BIS_fnc_unitHeadgear;            // facewear only\n[this, \"myTemplate\"] call BIS_fnc_unitHeadgear;    // class defined in Description.ext - CfgUnitTemplates\n```","code":["[this] call BIS_fnc_unitHeadgear;\t\t\t\t\t// headgear and face wear, same as [this, [], []]\n[this, [], []] call BIS_fnc_unitHeadgear;\t\t\t// headgear only\n[this, nil, []] call BIS_fnc_unitHeadgear;\t\t\t// facewear only\n[this, \"myTemplate\"] call BIS_fnc_unitHeadgear;\t// class defined in Description.ext - CfgUnitTemplates"]}],"see_also":["addGoggles","addHeadgear"]}