Need some help - timer & random spawn
#1

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?
Reply
#2

SetVirtualWorld(playerid,random(1,50));
Reply
#3

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?
Reply
#4

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.
Reply
#5

pawn Код:
minrand(min, max) //by ******
{
    return random(max - min) + min;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)