{"name":"groupSelectUnit","operator":null,"title":"groupSelectUnit","type":"command","url":"https://community.bistudio.com/wiki/groupSelectUnit","revid":330040,"updated":"2022-08-15T15:25:02Z","groups":["Interaction"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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]","since":null,"effect":null,"exec":null,"params":[{"name":"player","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"player: Object"},{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"select","type":"Boolean","optional":false,"default":null,"description":null,"types":["Boolean"],"since":null,"text":"select: Boolean"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"player","types":["Object"]},"right":{"text":"[unit, select]","types":["Array"]}}],"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];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["groupSelectedUnits"],"notes":[],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}