249 entity player,
bool use_score);
269 int destination_team_index,
bool is_bot);
273 void LogTeamChange(
float player_id,
float team_number,
int type);
335 entity player,
bool use_score);
One or both teams are invalid.
int Team_GetWinnerAliveTeam()
Returns the winner team.
entity TeamBalance_GetTeamFromIndex(entity balance, int index)
Returns the team entity of the team balance entity at the given index.
string autocvar_g_forced_team_otherwise
entity Entity_GetTeam(entity this)
Returns the team entity of the given entity.
void TeamBalance_JoinBestTeam(entity player)
Assigns the given player to a team that will make the game most balanced.
int Entity_GetTeamIndex(entity this)
Returns the team index of the given entity.
bool Entity_HasValidTeam(entity this)
Returns whether the given entity belongs to a valid team.
bool TeamBalanceTeam_IsAllowed(entity team_ent)
Returns whether the team is allowed.
void TeamBalance_Destroy(entity balance)
Destroy the team balance entity.
entity Team_GetTeamFromIndex(int index)
Returns the global team entity at the given index.
int TeamBalance_CompareTeamsInternal(entity team_a, entity team_index_b, entity player, bool use_score)
Compares two teams for the purposes of game balance.
int Team_GetNumberOfTeamsWithOwnedItems()
Returns the number of teams that own items.
int TeamBalance_GetAllowedTeams(entity balance)
Returns the bitmask of allowed teams.
void setcolor(entity this, int clr)
The team was selected by autobalance.
bool SetPlayerTeam(entity player, int team_index, int type)
Sets the team of the player.
bool autocvar_g_changeteam_banned
Player has manually selected their team.
entity TeamBalance_GetPlayerForTeamSwitch(int source_team_index, int destination_team_index, bool is_bot)
Returns the player who is the most suitable for switching between the given teams.
void Player_SetTeamIndexChecked(entity player, int team_index)
Sets the team of the player with all sanity checks.
void SetPlayerColors(entity player, float _color)
Force the player to spectator team.
int Player_GetForcedTeamIndex(entity player)
Returns the index of the forced team of the given player.
void TeamBalance_BanTeamsExcept(entity balance, int index)
Bans team change to all teams except the given one.
Player is joining spectators. //TODO: Remove?
bool autocvar_g_balance_teams_prevent_imbalance
int TeamBalance_GetLargestTeamIndex(entity balance, int teams)
Returns the index of the team with most players that is contained in the given bitmask of teams...
bool autocvar_teamplay_lockonrestart
int autocvar_teamplay_mode
void KillPlayerForTeamChange(entity player)
Kills player as a result of team change.
float Team_GetTeamScore(entity team_ent)
Returns the score of the team.
void SV_ChangeTeam(entity player, int new_color)
Called when the player changes color with the "color" command.
entity TeamBalance_GetTeam(entity balance, int team_num)
Returns the team entity of the team balance entity that corresponds to the given TEAM_NUM value...
int TeamBalanceTeam_GetNumberOfBots(entity team_ent)
Returns the number of bots in a team.
bool Player_SetTeamIndex(entity player, int index)
Sets the team of the player using its index.
int Team_GetNumberOfOwnedItems(entity team_ent)
Returns the number of items owned by a team.
void TeamBalance_GetTeamCounts(entity balance, entity ignore)
Counts the number of players and various other information about each team.
bool Player_HasRealForcedTeam(entity player)
Returns whether player has real forced team.
bool TeamBalance_IsTeamAllowed(entity balance, int index)
Returns whether the team change to the specified team is allowed.
int Team_GetNumberOfAliveTeams()
Returns the number of alive teams.
int Team_GetNumberOfAlivePlayers(entity team_ent)
Returns the number of alive players in a team.
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings...
First team is less than the second one.
void Player_DetermineForcedTeam(entity player)
Determines the forced team of the player using current global config.
void Player_SetForcedTeamIndex(entity player, int team_index)
Sets the index of the forced team of the given player.
bool TeamBalance_IsTeamAllowedInternal(entity balance, int index)
Returns whether the team change to the specified team is allowed.
int TeamBalance_CompareTeams(entity balance, int team_index_a, int team_index_b, entity player, bool use_score)
Compares two teams for the purposes of game balance.
void Team_SetNumberOfAlivePlayers(entity team_ent, int number)
Sets the number of alive players in a team.
Don't force any team.
int TeamBalanceTeam_GetNumberOfPlayers(entity team_ent)
Returns the number of players (both humans and bots) in a team.
int TeamBalance_FindBestTeams(entity balance, entity player, bool use_score)
Returns the bitmask of the teams that will make the game most balanced if the player joins any of the...
int TeamBalance_FindBestTeam(entity balance, entity player, bool ignore_player)
Finds the team that will make the game most balanced if the player joins it.
void TeamBalance_AutoBalanceBots()
Switches a bot from one team to another if teams are not balanced.
bool autocvar_g_balance_teams
void LogTeamChange(float player_id, float team_number, int type)
int TeamBalance_GetNumberOfPlayers(entity balance, int index)
Returns the number of players (both humans and bots) in a team.
entity Team_GetTeam(int team_num)
Returns the global team entity that corresponds to the given TEAM_NUM value.
int Team_GetWinnerTeam_WithOwnedItems(int min_owned_items)
Returns the winner team.
bool MoveToTeam(entity client, int team_index, int type)
Moves player to the specified team.
void Team_SetTeamScore(entity team_ent, float score)
Sets the score of the team.
void Team_SetNumberOfOwnedItems(entity team_ent, int number)
Sets the number of items owned by a team.
First team the greater than the second one.