mute help anti spam
#4

Try this,

Code:
if(SpamCheckT(playerid, 2) == 1)
{  
	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.");      
		SpamTimes[playerid] = 0; 
		return 0;    
	}   
} else SpamTimes[playerid] = 0;
Add this somewhere in your script
PHP Code:
stock SpamCheckT(playeridtime)
{
    new 
time_spam gettime() - SpamCheck[playerid];
    if(
time_spam time) return 1;
    
SpamCheck[playerid] = gettime();
    return 
0;

Reply


Messages In This Thread
mute help anti spam - by PepsiCola23 - 02.02.2018, 16:15
Re: mute help anti spam - by Inn0cent - 04.02.2018, 16:48
Re: mute help anti spam - by PepsiCola23 - 04.02.2018, 16:55
Re: mute help anti spam - by Inn0cent - 04.02.2018, 17:02
Re: mute help anti spam - by Sew_Sumi - 04.02.2018, 17:04
Re: mute help anti spam - by Inn0cent - 04.02.2018, 17:06
Re: mute help anti spam - by RogueDrifter - 04.02.2018, 17:08

Forum Jump:


Users browsing this thread: 2 Guest(s)