13.03.2015, 21:14
How to make anti spam command using y_commands include?
I USED SEARCH BUTTON!!!
I USED SEARCH BUTTON!!!
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
SetPVarInt(playerid, "anticmdflood", GetTickCount());
return true;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(GetTickCount()-GetPVarInt(playerid, "anticmdflood") < 1000*5)
{
SendClientMessage(playerid, -1, "You must wait 5 seconds to return to using a command.");
return true;
}
return true;
}