can i random SetTimer? - 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: can i random SetTimer? (
/showthread.php?tid=635333)
can i random SetTimer? -
parames3010 - 05.06.2017
can i random SetTimer how?
i want random time of SetTimer around 1000-10000
SetTimer("message",
1000, false);
public message(playerid)
{
print("test....");
}
Please help, thanks
Re: can i random SetTimer? -
DeeadPool - 05.06.2017
This should work:
PHP код:
SetTimer("message", RandomEx(1000, 10000), false);
forward message();
public message() // There should be no "playerid" in the brackets! If you want to use playerid, u gotta use SetTimerEx
{
print("test....");
}
RandomEx(min, max)
{
return random(max - min) + min;
}
If you don't understand the code, feel free to ask me an explanation of it.
Re: can i random SetTimer? -
parames3010 - 05.06.2017
Thanks you bro, it work +REP