Random timer
#1

Hello,i've this timer for stay the player in jail,it's currently 30 seconds.

I need to randomize it from 1 minute to 20,how?

pawn Код:
JailTimerID[playerid] = 30;
Reply
#2

pawn Код:
20 + random(41);
Reply
#3

Use the function Random(MAX_VALUE);
I think it's named something like that.
Reply
#4

Thanks.
Reply
#5

of min 20, max 60 seconds.

if you do it in seconds, it shall look like this:

new jailtimersec=20+random(40)

Let random be 0 and 40. if it's 0, it's 20, and if it's 40, ot's 60. So, there u are.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)