A question about +random(number)
#1

Код:
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?
Reply
#2

0-2.
Reply
#3

What? Maybe you mean 0-3
Reply
#4

No, from 0 to 2.

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

https://sampwiki.blast.hk/wiki/Random
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)