{"name":"groupSelectUnit","title":"groupSelectUnit","type":"command","url":"https://community.bistudio.com/wiki/groupSelectUnit","revid":330040,"updated":"2022-08-15T15:25:02Z","groups":["Interaction"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Selects a unit from player's group. If player is the leader, the effect of this command is similar to player pressing <kbd>F1</kbd>, <kbd>F2</kbd>, <kbd>F3</kbd> etc to highlight units in his squad, after which the unit command menu is shown.\nIf leader is AI, player will get usual communication menu to interact with the leader.","syntaxes":[{"syntax":"player groupSelectUnit [unit, select]","params":[{"name":"player","type":"Object","type_expr":"Object"},{"name":"unit","type":"Object","type_expr":"Object"},{"name":"select","type":"Boolean","type_expr":"Boolean"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"player"},"right":{"text":"[unit, select]"}}],"examples":[{"text":"After leaving menu, deselect all units (command menu is not opened → no selection)\n\n```sqf\n{\n    player groupSelectUnit [_x, false];\n} forEach (groupSelectedUnits player);\n```","code":["{\n\tplayer groupSelectUnit [_x, false];\n} forEach (groupSelectedUnits player);"]},{"text":"Select all units when player is the leader:\n\n```sqf\n{\n    player groupSelectUnit [_x, true];\n} forEach units player;\n```","code":["{\n\tplayer groupSelectUnit [_x, true];\n} forEach units player;"]},{"text":"Open communication with group leader:\n\n```sqf\nplayer groupSelectUnit [leader player, true];\n```","code":["player groupSelectUnit [leader player, true];"]}],"see_also":["groupSelectedUnits"]}