SA-MP Forums Archive
Random prize - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Random prize (/showthread.php?tid=503310)



Random prize - AhmedMohamed - 29.03.2014

how to make random prize??
I wanna the define only:
pawn Код:
new //what's here?



Re: Random prize - AhmedMohamed - 29.03.2014

for example:
pawn Код:
GivePlayerMoney(playerid,5000);//rand1
GivePlayerMoney(playerid,7000);//rand2
GivePlayerMoney(playerid,10000);//rand3
GivePlayerMoney(playerid,20000);//rand4



Re: Random prize - RenovanZ - 29.03.2014

pawn Код:
new rand = random(5);
switch(rand)
{
     case 0: GivePlayerMoney(playerid, xxx);
     case 1: GivePlayerMoney(playerid, xxx);
     //and so on
}