28.08.2012, 15:19
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
new team1count, team2count;
for(new i, m = GetMaxPlayers(); i < m; i++)
{
if (IsPlayerConnected(i))
{
if (gTeam[i] == TEAM_GROVE) team1count++;
else if (gTeam[i] == TEAM_BALA) team2count++;
}
}
if (gTeam[playerid] == TEAM_GROVE)
{
if (team1count > (team2count+1)){
SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
return 0;
}
}
else if (gTeam[playerid] == TEAM_BALA)
{
if ((team1count+1) < team2count){
SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
return 0;
}
}
return 1;
}