SA-MP Forums Archive
teleport - 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: teleport (/showthread.php?tid=131944)



teleport - 02manchestera - 05.03.2010

i was wondering if its possiable to have a auto teleport so every so long it teleports all players to a location


Re: teleport - aircombat - 05.03.2010

u mean on player spawn , he teleports to somewhere?
________
IOLITE VAPORIZER


Re: teleport - 02manchestera - 05.03.2010

No i what i mean is like a event teleport so say at every 30min past al players are teleport to a area for a DM match and after 10 min they are respawned at normal areas


Re: teleport - aircombat - 05.03.2010

use SetTimer
________
Lukumi forum


Re: teleport - 02manchestera - 05.03.2010

wil the time work for all players at once or will it start when they log on



Re: teleport - aircombat - 05.03.2010

if u put it at ongamemodeinit , all will be teleported same time but if u put it on player spawn = different time
________
BUY E CIGARETTE


Re: teleport - aircombat - 05.03.2010

btw i added u to my msn : virus_hesham@Hotmail.com
________
Lovely Wendie99


Re: teleport - 02manchestera - 05.03.2010

Quote:
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(Setplayerpostion, x, y ,z ,[timehere], true


SOmething like that i want but with 4 random spawns also wil this only spawn u there once or what


Re: teleport - aircombat - 05.03.2010

idk how to make it random but i know how to make them go to 1 place

ongamemodeinit
Код:
SetTimer("teleport", 60000, true); //60000 = 1 minute in milli seconds
bottom of script :
Код:
forward teleport();
public tele()
{
SetPlayerPos(playerid,x,y,z);
return 1;
}
________
Smoking Cessation Forums


Re: teleport - Nero_3D - 05.03.2010

SetTimer / Ex only calls public functions, so

pawn Код:
SetTimer("Event", 1000 * 60 * 30, true);
pawn Код:
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!");
    }  
}