Arma 3 Scripting

Command in Team Switch, Event Handlers

onTeamSwitch

Also available as Markdown and JSON, or read the original wiki page.

Warning

This command is deprecated.

Description

Defines an action performed when the team switch is finished. Commandset receives the following special variables: _from object previous unit, _to object current unit. Consecutive use of onTeamSwitch command will overwrite previously set commandset.

Important

This command is deprecated. Since Arma 3 v1.57 a stackable version of this EH is available: TeamSwitch

Note

When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it (with onTeamSwitch { _from enableAI "TeamSwitch" };) so that the unit continues with waypoints.

Syntax

onTeamSwitch commandset

Parameters:

Returns: Nothing

Examples

Example 1

onTeamSwitch { [_from, _to] execVM "myTeamSwitchScript.sqf"; };

See also

Team Switch · enableTeamSwitch · onBriefingTeamSwitch · teamSwitch · teamSwitchEnabled