05.03.2010, 20:55
i was wondering if its possiable to have a auto teleport so every so long it teleports all players to a location
Originally Posted by [AC
Etch ]
if u put it at ongamemodeinit , all will be teleported same time but if u put it on player spawn = different time |
SetTimer("teleport", 60000, true); //60000 = 1 minute in milli seconds
forward teleport(); public tele() { SetPlayerPos(playerid,x,y,z); return 1; }
SetTimer("Event", 1000 * 60 * 30, true);
forward Event();
public Event()
{
switch(random(1)) //could be removed if <= 1
{
case 0:
{
for(new i; i < MAX_PLAYERS; i++)
{
switch(random(5)) //random(5) returns a number from 0 till 4 (0, 1, 2, 3 or 4)
{
case 0: SetPlayerPos(i, 1.0, 2.0, 3.0);
case 1: SetPlayerPos(i, 2.0, 3.0, 4.0);
case 2: SetPlayerPos(i, 3.0, 4.0, 5.0);
case 3: SetPlayerPos(i, 4.0, 5.0, 1.0);
case 4: SetPlayerPos(i, 5.0, 1.0, 2.0);
default: print("ERROR: Undefined teleport!");
}
}
}
default: print("ERROR: Undefined event!");
}
}