How to make a command availalbe only if 1 minute passed
#1

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
Reply
#2

i think you have to make timer!
Reply
#3

well, I have absolutely no idea...
Reply
#4

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

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
Reply
#6

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)