SA-MP Forums Archive
How to make a command availalbe only if 1 minute passed - 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: How to make a command availalbe only if 1 minute passed (/showthread.php?tid=80865)



How to make a command availalbe only if 1 minute passed - FreeSoul - 06.06.2009

I want to make a command,but I want it to be used only if one minute passed from the last time it was used.
Like if the minute didn't passed,it will sned something,You must wait X untill you can do that cmd again !

Regards and Thanks in Advance~FreeSoul


Re: How to make a command availalbe only if 1 minute passed - cigo - 06.06.2009

i think you have to make timer!


Re: How to make a command availalbe only if 1 minute passed - JoshTheBoss - 06.06.2009

well, I have absolutely no idea...


Re: How to make a command availalbe only if 1 minute passed - FreeSoul - 06.06.2009

Quote:
Originally Posted by JoshTheBoss
well, I have absolutely no idea...
Now that's nor very helpflul


Re: How to make a command availalbe only if 1 minute passed - JoshTheBoss - 06.06.2009

Quote:
Originally Posted by FreeSoul
Quote:
Originally Posted by JoshTheBoss
well, I have absolutely no idea...
Now that's nor very helpflul
sry, just felt like mentioning something dumb


Re: How to make a command availalbe only if 1 minute passed - Vince - 06.06.2009

It's not that hard .. Only thing I need to know is if the timer has to be set on a global level, or per player.

pawn Код:
#define seconds 60

new bool:disabled;

if(!strcmp("/whatever", cmdtext, true))
{
  if(disabled == true) return SendClientMessage(playerid, COLOR_RED, "You can't do that command now!");
 
  // Commandlines
 
  SetTimer("EnableCommand", 1000*seconds, false);
  disabled = true;
  return 1;
}

forward EnableCommand();
public EnableCommand()
{
  disabled = false;
}