Es changeteam

From EventScripts Community Encyclopedia


Overview

Syntax: es_changeteam <userid> <teamnum>

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Variation of this command that doesn't expand variables: es_xchangeteam

Description

Forces a player to move to another team.

Parameters

  • userid - The userid of the player to switch.
  • teamnum - The team # you want the player to switch to.

Examples

event player_say
{
   if (event_var(text) == gospec) do
   {
      // The user wants to move to spectators.
      es_changeteam event_var(userid) 1
   }
   else do
   {
      if (event_var(text) == otherteam) do
      {
         // The user wants to move to the other team.
         if (event_var(es_userteam) == 2) then es_xchangeteam event_var(userid) 3
         if (event_var(es_userteam) == 3) then es_xchangeteam event_var(userid) 2
      }
   }
}

Notes

  • You can use this command to switch the user to any team!
  • This command was added in v1.2.1.

See also

blog comments powered by Disqus