Forcing Teams!
Tutorial by Gerbil!
This tutorial will make it so anyone joining a team or ctf
game will automatically be assigned to the team with fewer
players.
Open g_client.c and goto line 695 in the
ClientConnect function. Add the following line of code:
int team;
Move down to about line 747 and change this function:
if ( g_gametype.integer >= GT_TEAM &&
client->sess.sessionTeam != TEAM_SPECTATOR ) {
BroadcastTeamChange( client, -1 );
}
so it looks like this:
if ( g_gametype.integer >= GT_TEAM )
{
team = PickTeam(clientNum);
client->sess.sessionTeam = team;
BroadcastTeamChange(client, team);
}
This calls the PickTeam function wich returns the team
number of the team with fewer players.
client->sess.sessionTeam = team; makes sure the player is
assigned to the team returned by PickTeam;
|