little help delay teleport or /class
#1

Hi how do I make delay teleport or class delay? Coz I am currently making a DM server and I don't want them to abuse teleport or switch class when they get hit or almost killed.

Let say if a player use a command teleport, then wait start 10 seconds countdown teleport to which player choose a place. If player who use the teleport got hit while countdown is being process then cancel the teleport.
Reply
#2

I would make it something like this, try to modify it to your needs:
Код:
// top of the script 
new TeleportTime[MAX_PLAYERS];

// on gamemodeinit
SetTimer("OneSecTimer",1000,true);

// under onplayerconnect
TeleportTime[playerid] = -1;

// under your command
TeleportTime[playerid] = 10;

public OneSecTimer()
{
     foreach(Player, i)
     {
           if(TeleportTime[i] > 0 && TeleportTime[i] != -1)
           TeleportTime[i] --;
           else if(TeleportTime[i] == 0)
           // place here a stock or something for teleporting
      }
}
// and onplayertakedamage
if(TeleportTime[playerid] > 0) 
TeleportTime[playerid] = 0;
Reply
#3

Quote:
Originally Posted by dominik523
Посмотреть сообщение
I would make it something like this, try to modify it to your needs:
Код:
// top of the script 
new TeleportTime[MAX_PLAYERS];

// on gamemodeinit
SetTimer("OneSecTimer",1000,true);

// under onplayerconnect
TeleportTime[playerid] = -1;

// under your command
TeleportTime[playerid] = 10;

public OneSecTimer()
{
     foreach(Player, i)
     {
           if(TeleportTime[i] > 0 && TeleportTime[i] != -1)
           TeleportTime[i] --;
           else if(TeleportTime[i] == 0)
           // place here a stock or something for teleporting
      }
}
// and onplayertakedamage
if(TeleportTime[playerid] > 0) 
TeleportTime[playerid] = 0;
Why it just teleport me without the countdown?
Reply
#4

Did you put anything here?
Код:
public OneSecTimer()
{
     foreach(Player, i)
     {
           if(TeleportTime[i] > 0 && TeleportTime[i] != -1)
           TeleportTime[i] --;
           else if(TeleportTime[i] == 0)
           {
                 TeleportTime[i] = -1;
                 SetPlayerPos.... and so on
           }
      }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)