Round out players
#6

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
}
Reply


Messages In This Thread
Round out players - by StrickenKid - 13.04.2009, 22:26
Re: Round out players - by StrickenKid - 14.04.2009, 00:56
Re: Round out players - by ICECOLDKILLAK8 - 14.04.2009, 01:08
Re: Round out players - by Backwardsman97 - 14.04.2009, 01:12
Re: Round out players - by StrickenKid - 14.04.2009, 01:25
Re: Round out players - by Backwardsman97 - 14.04.2009, 02:18

Forum Jump:


Users browsing this thread: 4 Guest(s)