Es getplayerteam

From EventScripts Community Encyclopedia


Overview

Syntax: es_getplayerteam <variable> <userid>

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_xgetplayerteam

Description

Stores the user's team in the specified variable.

Parameters

  • variable - Variable which will store the player's team # index
  • userid - User id of the player


Examples

// Get the player's team and display it to everyone
es_getplayerteam playerteam event_var(userid)
if (server_var(playerteam) == "0") then es_xmsg event_var(es_username) is Unassigned
if (server_var(playerteam) == "1") then es_xmsg event_var(es_username) is on the Spectators
if (server_var(playerteam) == "2") then es_xmsg event_var(es_username) is on the Terrorists
if (server_var(playerteam) == "3") then es_xmsg event_var(es_username) is on the Counter-Terrorists


Notes

  • The server could crash if the provieded userid does not exists!
  • variable will equal 0 if the player does not exist.


See also

blog comments powered by Disqus