{"name":"assignTeam","operator":null,"title":"assignTeam","type":"command","url":"https://community.bistudio.com/wiki/assignTeam","revid":340282,"updated":"2023-04-28T17:04:36Z","groups":["Groups"],"status":"ok","replaced_by":[],"games":[{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"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":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"| Team | Value |\n|---|---|\n| White | \"MAIN\" |\n| Red | \"RED\" |\n| Green | \"GREEN\" |\n| Blue | \"BLUE\" |\n| Yellow | \"YELLOW\" |\n\nAssigns the unit (in case of a vehicle, its commander) to the given team. Team is an option in group control (unit management) menu that allows to split player group in teams and then give bulk order to separate teams.\nIn order to operate properly, the command requires specific conditions:\n- the command requires player to be fully initialised\n- the unit getting assigned must be either player himself or a unit in player's group\nThe colour of the assigned team for a unit is seen on the group management UI as well as squad radar.\n\n> [!IMPORTANT]\n> In older versions of the game (Arma 2?) the effect of this command is **local** Local Effect.","syntaxes":[{"syntax":"unit assignTeam team","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"team","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"team: String"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"team","types":["String"]}}],"examples":[{"text":"```sqf\n_soldier2 assignTeam \"RED\";\n```","code":["_soldier2 assignTeam \"RED\";"]},{"text":"In a unit's init script in the editor spawn should be used, otherwise a [race condition](https://en.wikipedia.org/wiki/Race_condition) may be experienced:\n\n```sqf\nthis spawn { _this assignTeam \"RED\" };\n```","code":["this spawn { _this assignTeam \"RED\" };"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["assignedTeam","dissolveTeam","unassignTeam"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Groups","Introduced with Operation Flashpoint: Elite version 1.00","Operation Flashpoint: Elite: New Scripting Commands","Operation Flashpoint: Elite: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}