Timer
#2

Try something like this:

pawn Код:
new HasUsedCommandShop[MAX_PLAYERS]; // at the top of the script
forward CommandShopTimer(playerid);
Under the command:

pawn Код:
if(HasUsedCommandShop[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "Please wait until you can use this command again.");
And under the command if it was successful, use:

pawn Код:
HasUsedCommandShop[playerid] = 1;
SetTimerEx("CommandShopTimer", time here in milliseconds, false, "i", playerid);
And then, make a public for the command:

pawn Код:
public CommandShopTimer(playerid)
{
     HasUsedCommandShop[playerid] = 0;
     SendClientMessage(playerid, COLOR_WHITE, "You can now use the command again.");
     return 1;
}
Reply


Messages In This Thread
Timer - by AnonScripter - 24.09.2013, 21:09
Re: Timer - by DanishHaq - 24.09.2013, 21:30
Re: Timer - by =KempeR= - 24.09.2013, 21:42
Re: Timer - by AnonScripter - 24.09.2013, 22:25
Re: Timer - by Krakuski - 24.09.2013, 22:29
Re: Timer - by DanishHaq - 24.09.2013, 22:43
Re: Timer - by =KempeR= - 24.09.2013, 22:54
Re: Timer - by AnonScripter - 24.09.2013, 23:02
Re: Timer - by AnonScripter - 24.09.2013, 23:25
Re: Timer - by =KempeR= - 24.09.2013, 23:37

Forum Jump:


Users browsing this thread: 1 Guest(s)