{"name":"assignTeam","title":"assignTeam","type":"command","url":"https://community.bistudio.com/wiki/assignTeam","revid":340282,"updated":"2023-04-28T17:04:36Z","groups":["Groups"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","locality":{"argument":"global","effect":"global"},"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\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\n\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","params":[{"name":"unit","type":"Object","type_expr":"Object"},{"name":"team","type":"String","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit"},"right":{"text":"team"}}],"examples":[{"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\" };"]}],"see_also":["assignedTeam","dissolveTeam","unassignTeam"]}