GetTeamByIndex

Category: Teams
Since engine version: 4.9.6.0 CR

Description

Returns the indicated team number. This function guarantees that for values from 0 to GetTeamCount()-1 a valid team number will be returned (notice that there may be "gaps" between team numbers in case some team have been removed from the game). This makes it easier to process all teams in a loop.

Syntax

int GetTeamByIndex (int iIndex);

Parameter

iIndex:
Index into the list of teams

Example

for(var i = 0; i < GetTeamCount(); i++)
  Log("Willkommen im Spiel, Spieler von %s", GetTeamName(GetTeamByIndex(i)));
Welcomes all players in the log file.
See also: GetPlayerTeam, GetTeamColor, GetTeamConfig, GetTeamCount, GetTeamName, Teams
Clonkonaut, April 2008