22.06.2010, 17:19
How do I prevent /o spam? Like put a 3 second timer between using /o
new lasttimeooc[MAX_PLAYERS];
// /o
if((gettime() - lasttimeooc[playerid]) > 3)
{
lasttimeooc[playerid] = gettime();
//Rest of the ooc cmd code here.
}
else
{
return SendClientMessage(playerid, COLOR_HERE, "Wait 3 seconds before talking again, k?");
}
if(GetPVarInt(playerid,"OCCTick")< GetTickCount() + 3000)
{
SetPVarInt(playerid,"OCCTick", GetTickCount());
// Do your thing
}
else
{
// Must wait 3 seconds
}