24.01.2010, 14:21
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
for(new p = 0; p < GetMaxPlayers(); p++)
{
if(IsPlayerConnected(p))
{
if (gTeam[p] == TEAM_HOBO)
{
count1++;
}
else if (gTeam[p] == TEAM_RICH)
{
count2++;
}
}
}
if ((count1 > count2) && gTeam[playerid] == TEAM_HOBO)
{
SendClientMessage(playerid, COLOR_RED, "Choose another team to keep the teams even!");
return 0;
}
else if ((count2 > count1) && gTeam[playerid] == TEAM_RICH)
{
SendClientMessage(playerid, COLOR_RED, "Choose another team to keep the teams even!");
return 0;
}
return 1;
}