GetTeamByIndex

Category: Teams
Since engine version: 1.0 OC

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 index);

Parameter

index:
Index into the list of teams.

Example

for(var i = 0; i < GetTeamCount(); i++)
  Log("Welcome in the game, players from team %s", GetTeamName(GetTeamByIndex(i)));
Welcomes all players in the log file.
See also: GetPlayerTeam, GetTeamColor, GetTeamCount, GetTeamName, Teams
Clonkonaut, 2008-04