01.02.2014, 06:12
Quote:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(GetPVarInt(playerid, "lastcommand") > GetTickCount()) { SendClientMessage(playerid, 0x00FFFFFF, "Slow it down on the commands!"); SetPVarInt(playerid, "lastcommand", GetTickCount()+500); return 1; } SetPVarInt(playerid, "lastcommand", GetTickCount()+500); } |
What that code does is it stores in a variable when the player is able to send a command again (current time + 500 MS). If the player sends a command before that time, it will add another 500 MS to the time and will not allow him to send the command.