28.10.2010, 10:11
I had no idea on what to search, i don't want you to post the code just tell me what i need to do and post some wiki pages that will help me, thanks.
new DoCMDagain[MAX_PLAYERS] = 0;
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(command,7,cmdtext);
return 0;
}
dcmd_command(playerid,params[])
{
if(DoCMDagain[playerid] == 0) return SendClientMessage(playerid,color,"You can only use this command each 50 seconds!");
//execute
//your
//command
DoCMDagain[playerid] = 0;
SetTimerEx("CommandAvailibleAgain",5*10000,false,"i",playerid);
return true;
}
forward CommandAvailibleAgain(playerid);
public CommandAvailibleAgain(playerid)
{
DoCMDagain[playerid] = 1;
SendClientMessage(playerid,color,"You can use the command again!");
return true;
}
if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"wait 50 sec");
SetPVarInt(playerid,"CMDABUSE",GetTickCount()+50000);