Random Player select
#7

If he uses random(MAX_PLAYERS), it's like he uses random(500), so it could be that playerid 455, which is probably not online, receives the money o.O.
Top of the script:
pawn Код:
forward RandMoney();
Under GameModeInit:
pawn Код:
SetTimer("RandMoney", 30000, 1);
Somewhere in the script:
pawn Код:
public RandMoney()
{
      new PCount;
      for(new i; i<GetMaxPlayers(); i++)
      {
            if(IsPlayerConnected(i)) PCount++;
      }
      GivePlayerMoney(random(PCount), 3000);
}
Or like the guy over this post, who was faster xD ^^
Reply


Messages In This Thread
Random Player select - by Jay. - 22.07.2010, 18:43
Re: Random Player select - by Яσскѕтая - 22.07.2010, 18:49
Re: Random Player select - by Jay. - 22.07.2010, 18:52
Re: Random Player select - by Jay. - 22.07.2010, 18:55
Re: Random Player select - by [SVRPG]Falcon - 22.07.2010, 18:57
Re: Random Player select - by [XST]O_x - 22.07.2010, 19:14
Re: Random Player select - by Last_Stand_Guardian - 22.07.2010, 19:19
Re: Random Player select - by Jay. - 22.07.2010, 19:27
Re: Random Player select - by Last_Stand_Guardian - 22.07.2010, 19:32
Re: Random Player select - by Jay. - 22.07.2010, 19:35

Forum Jump:


Users browsing this thread: 1 Guest(s)