Double-O-Seven
Unregistered
pawn Код:
#define DELAY 20000 // 20 seconds...
new LastCommandUsed[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
LastCommandUsed[playerid]=GetTickCount()-DELAY;
//etc.
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp("/tehcmds",cmdtext,true))
{
if(GetTickCount()-LastCommandUsed[playerid]<DELAY)
return SendClientMessage(playerid,0xFF0000FF,"YOU CAN'T USE THAT OFTEN TEH COMMAND!!! D:");
LastCommandUsed[playerid]=GetTickCount();
SendClientMessage(playerid,0x00FF00FF,"You can use teh command in 20 seconds again :O");
return 1;
}
return 0;
}
Posts: 156
Threads: 33
Joined: Feb 2009
Reputation:
0
[MG3]Double-O-Seven, Thank you very much