23.11.2009, 04:59
Quote:
|
Originally Posted by -xy!
|
Код:
new CmdTimer[MAX_PLAYERS]; new bool:CanUseCmd[MAX_PLAYERS]; forward releasecmd(playerid);
Код:
CanUseCmd[playerid] = true;
Код:
if (strcmp("/yourcommand", cmdtext, true) == 0)
{
if(CanUseCmd[playerid] == true)
{
// let your command do what is must do... +
CanUseCmd[playerid] = false;
CmdTimer[playerid] = SetTimerEx("releasecmd", 15000, false, "i", 1, playerid);
} else {
//let the player know he has to wait...
}
return 1;
}
Код:
stock releasecmd(playerid)
{
CanUseCmd[playerid] = true;
KillTimer(CmdTimer[playerid]); //suggest you place this line in the onplayerdisconnect as well
}


