26.03.2012, 07:09
Hey, is it possible to apply a PVar to all server commands? Because i want that every command can be used only every 3 seconds by a player.
new SpamCheck[MAX_PLAYERS]; //add at the top of script
SpamCheck[playerid] = GetTickCount(); //add this in every command
if(GetTickCount() - SpamCheck[playerid] < 3000 && SpamCheck[playerid] != 0) //put this onplayercommandtext - above
{
//put any code you want like SendClientMessage - You can use the command after 3 secs
return false;
}
if(GetTickCount() - SpamCheck[playerid] < 3000 && SpamCheck[playerid] != 0) //put this onplayercommandtext - above
{
//put any code you want like SendClientMessage - You can use the command after 3 secs
return false;
}
SpamCheck[playerid] = GetTickCount();