SA-MP Forums Archive
Random timer - 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 timer (/showthread.php?tid=340986)



Random timer - Face9000 - 09.05.2012

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;



Re: Random timer - Vince - 09.05.2012

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



Re: Random timer - Ranama - 09.05.2012

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


Re: Random timer - Face9000 - 09.05.2012

Thanks.


Re: Random timer - aco_SRBIJA - 09.05.2012

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.