26.01.2012, 17:43
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
new team1count, team2count;
for(new i, m = GetMaxPlayers(); i < m; i++)
{
if (IsPlayerConnected(i))
{
if (gTeam[i] == TEAM_ONE) team1count++;
else if (gTeam[i] == TEAM_TWO) team2count++;
}
}
if (gTeam[playerid] == TEAM_ONE)
{
if (team1count > (team2count+1)){
SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
return 0;
}
}
else if (gTeam[playerid] == TEAM_TWO)
{
if ((team1count+1) < team2count){
SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
return 0;
}
}
return 1;
}
Change the gTeams.