Random Player
#5

pawn Код:
stock GetRandomID()
{
  new randn = random(MAX_PLAYERS);
   
  if(IsPlayerConnected(randn)) return randn;
   
  else
  {
     return GetRandomID();
  }
}
Example:
pawn Код:
public RandPlayer1()
{
  GivePlayerWeapon(GetRandomID(), 16, 5);
  SetPlayerArmour(GetRandomID(), 100);
  SendClientMessageToAll(COLOR_YELLOW, "[Random: A Random Player has been given ''5 Grenades'' and ''Full Armor'']");
  return 1;
}
Reply


Messages In This Thread
Random Player - by Trooper[Y] - 03.05.2009, 18:32
Re: Random Player - by HB - 03.05.2009, 18:34
Re: Random Player - by Trooper[Y] - 03.05.2009, 18:41
Re: Random Player - by HB - 03.05.2009, 18:44
Re: Random Player - by Lewwy - 03.05.2009, 18:52
Re: Random Player - by Trooper[Y] - 03.05.2009, 18:59

Forum Jump:


Users browsing this thread: 1 Guest(s)