14.04.2009, 02:18
You wanted the server to figure out how many players needed to be on each team? You need mod for that.
pawn Код:
stock CountPlayers()
{
new count = 0;
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
count++;
}
}
return count;
}
new CurPlayers = CountPlayers();
if(!CurPlayers % 4)
{
//The amount of players in the server is evenly dividable by 4
}
else
{
//You have extras ( at most 3 ) that don't fit on a team
}