mute error
#1

you get muted just by typing 5 messages in chat..it doesnt matter if you write fast or wait 1 minute between messages..you still get muted.

and after you get muted for the first time,after the mute expires,you can flood the chat as long as you want,you wont get muted again.

Quote:

SpamCheck[playerid] = GetTickCount();
if(GetTickCount() - SpamCheck[playerid] < 1000 && SpamCheck[playerid] != 0)
{
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 SpamTimes[playerid] = 0;

Reply
#2

I already answered this at this thread - https://sampforum.blast.hk/showthread.php?tid=649040
Reply
#3

why would i use a timer?
when im using a variable and i reset it with SpamTimes[playerid]

i use the time differences with gettickcount...
Reply
#4

this reset isn't working. u already know it.
Reply
#5

it was working long times ago

there is no reason to use a timer in such situation
Reply
#6

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(SQLstr,128,"UPDATE `users` SET `Muted`='1' ,`MutedTime`='%d' WHERE `id` = '%d' LIMIT 1",PlayerData[playerid][MutedTime],PlayerData[playerid][ID]);
        
mysql_tquery(SQLstr"""");
        
SendClientMessage(playeridCOLOR_GREY"You have been auto-muted for spamming. You will be unmuted in 20 seconds.");
        return 
0;
    }
} else return 
SpamTimes[playerid] = 0
Reply
#7

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
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(SQLstr,128,"UPDATE `users` SET `Muted`='1' ,`MutedTime`='%d' WHERE `id` = '%d' LIMIT 1",PlayerData[playerid][MutedTime],PlayerData[playerid][ID]);
        
mysql_tquery(SQLstr"""");
        
SendClientMessage(playeridCOLOR_GREY"You have been auto-muted for spamming. You will be unmuted in 20 seconds.");
        return 
0;
    }
} else return 
SpamTimes[playerid] = 0
still the same problem,it works perfectly fine the first time..

after that,it wont work again and you wont get muted if you spam.
Reply
#8

Maybe this:
PHP код:
if(SpamTimes[playerid] >= 5
try adding debug messages to check the output.
Reply
#9

not working.

if you write 5 messages no matter the time between them you still get muted ( example: you write 2 messages now,3 messages in 5 hours and yo ustill get muted)

any other fixes?
Reply
#10

I ALREADY WROTE FIX BUT YOU GUYS MADE A SH1T ON IT.
(TIMERS S&CK)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)