SA-MP Forums Archive
Timed 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)
+--- Thread: Timed Teleport (/showthread.php?tid=452148)



Timed Teleport - HellKingCro - 20.07.2013

Hello, last few days i am making DM GM for my server. I am making good progress. But i have a problem. I am putting custom DM maps on my server. And player should go to map with command. And here is my problem: I want that when a player enters the command to TP had to wait for 3 sec and then to teleport. But i dont know how to do it, i made TP command. But i dont know how to set timer only for 1 cmd.


Re: Timed Teleport - ScRipTeRi - 20.07.2013

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/dm", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_RED1,"Need Wait 3 seconda fo enter in dm.");
SetTimerEx("GoInDM",3000,0,"i",playerid);
}
return 1;
}

forward GoInDM(playerid);
public GoInDM(playerid)
{
SetPlayerPos(playerid, //your pos );
return 1;
}



Re: Timed Teleport - HellKingCro - 20.07.2013

Thx, so i need to do new timer for every teleport? Cant i do just a timer without PlayerPos. When time expire it go back to the cmd and tp you.