SA-MP Forums Archive
A question about +random(number) - 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: A question about +random(number) (/showthread.php?tid=284532)



A question about +random(number) - Moron - 19.09.2011

Код:
SetPlayerScore(playerid,GetPlayerScore(playerid)+random(3)+1);
Okay so as I understand a player gets +1 score and +random(3) score. But is +random(3) from 1-3 or from 0-3 score?


Re: A question about +random(number) - =WoR=Varth - 19.09.2011

0-2.


Re: A question about +random(number) - Moron - 19.09.2011

What? Maybe you mean 0-3


Re: A question about +random(number) - Xyrex - 19.09.2011

No, from 0 to 2.

Random gets a random number between 0 and the number-1.


Re: A question about +random(number) - =WoR=Varth - 19.09.2011

https://sampwiki.blast.hk/wiki/Random


Re: A question about +random(number) - Jefff - 19.09.2011

random(3) -> 0-2
(random(3)+1) -> 1-3