02.02.2018, 11:18
Why would he need a timer?
PHP код:
SpamCheck[playerid] = gettime();
if(gettime() - SpamCheck[playerid] < 120) // 2 minutes
{
SpamTimes[playerid]++;
if(SpamTimes[playerid] == 5)
{
PlayerData[playerid][Muted] = 1;
PlayerData[playerid][MutedTime] += 20;
new str[128]; // blah blah
mysql_format(SQL, str,128,"UPDATE `users` SET `Muted`='1' ,`MutedTime`='%d' WHERE `id` = '%d' LIMIT 1",PlayerData[playerid][MutedTime],PlayerData[playerid][ID]);
mysql_tquery(SQL, str, "", "");
SendClientMessage(playerid, COLOR_GREY, "You have been auto-muted for spamming. You will be unmuted in 20 seconds.");
return 0;
}
} else return SpamTimes[playerid] = 0;