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



Command available - shoru93 - 28.11.2009

How do I make a command be available only after 10 seconds, for example if I type /tp to someone, then I can use /tp again only after 10 seconds.


Re: Command available - M4S7ERMIND - 28.11.2009

Make a variable
pawn Код:
new bool:variable[MAX_PLAYERS] = { true, ... };
pawn Код:
//Under the command
if(variable[playerid] != false) {
  SetPlayerPos(x, y, z..
  SetTimerEx("AllowTeleport", 10000, 0, "i", playerid);
  variable[playerid] = false;
}else SendClientMessage("you can teleport once every 10 seconds..
pawn Код:
forward AllowTeleport(playerid);

public AllowTeleport(playerid) return variable[playerid] = true;




Re: Command available - shoru93 - 28.11.2009

How exactely, its about /countdown not /tp sry.