Random choose player
#2

pawn Код:
stock GetRandomPlayer()
{
  new yplayer[MAX_PLAYERS+1];
  for (new y = 0; y != MAX_PLAYERS; y ++) {
    if (IsPlayerConnected(y)) {
      yplayer[0] ++;
      yplayer[yplayer[0]] = y;
    }
  }
  return yplayer[random(yplayer[0])+1];
}
Reply


Messages In This Thread
Random choose player - by Nonameman - 03.06.2010, 11:23
Re: Random choose player - by iStarzz - 03.06.2010, 11:29
Re: Random choose player - by Nonameman - 03.06.2010, 11:31
Re: Random choose player - by iStarzz - 03.06.2010, 11:33

Forum Jump:


Users browsing this thread: 2 Guest(s)