assignTeam: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Fix Wikipedia link)
Line 58: Line 58:
|x1= <sqf>_soldier2 assignTeam "RED";</sqf>
|x1= <sqf>_soldier2 assignTeam "RED";</sqf>


|x2= In a unit's init script in the editor you should use the following. Or else you might experience {{Wikipedia|Race condition|race conditions}}.  
|x2= In a unit's init script in the editor you should use the following. Or else you might experience {{Link|https://en.wikipedia.org/wiki/Race_condition|race conditions}}.  
<sqf>this spawn { _this assignTeam "RED" };</sqf>
<sqf>this spawn { _this assignTeam "RED" };</sqf>


|seealso= [[assignedTeam]] [[dissolveTeam]] [[unassignTeam]]
|seealso= [[assignedTeam]] [[dissolveTeam]] [[unassignTeam]]
}}
}}

Revision as of 00:53, 24 February 2023

Hover & click on the images for description

Description

Description:
Assigns 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. In order to operate properly, the command requires specific conditions:
  • the command requires player to be fully initialised
  • the unit getting assigned must be either player himself or a unit in player's group
The colour of the assigned team for a unit is seen on the group management UI as well as squad radar.
Possible teams and values
Team White Red Green Blue Yellow
Value "MAIN" "RED" "GREEN" "BLUE" "YELLOW"
In older versions of the game (Arma 2?) the effect of this command is local LELocal.
Groups:
Groups

Syntax

Syntax:
unit assignTeam team
Parameters:
unit: Object
team: String
Return Value:
Nothing

Examples

Example 1:
_soldier2 assignTeam "RED";
Example 2:
In a unit's init script in the editor you should use the following. Or else you might experience race conditions.
this spawn { _this assignTeam "RED" };

Additional Information

See also:
assignedTeam dissolveTeam unassignTeam

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note