Need some help - timer & random spawn - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need some help - timer & random spawn (
/showthread.php?tid=99682)
Need some help - timer & random spawn -
Striker_Moe - 29.09.2009
Hey there.
Iґve been thinking about some nice feature. You get spawned into a random Virtual World, a timer gets activated and when the timer is over, you get setted to the standard Virtual World 0. This would prevent spawn blocking and killing. But.. howto?
I dont know how to make random virtual world sets at spawn, and neither I know how to set the timer after it (with playerid)
Can someone help?
Re: Need some help - timer & random spawn -
coole210 - 29.09.2009
SetVirtualWorld(playerid,random(1,50));
Re: Need some help - timer & random spawn -
Striker_Moe - 29.09.2009
SetTimerEx("spawn", 5000, 0, "i", playerid);
SetPlayerVirtualWorld(playerid,random(1,50));
Iґve got that on OnPlayerSpawn, but the player remains in virtual world 0. Why?
Re: Need some help - timer & random spawn -
Correlli - 29.09.2009
You should learn how the random is working:
https://sampwiki.blast.hk/wiki/Random
Only max. value can be putted in. If you want min. and max. value, search for custom made function on this forum.
Re: Need some help - timer & random spawn -
coole210 - 29.09.2009
pawn Код:
minrand(min, max) //by ******
{
return random(max - min) + min;
}