mute error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mute error (
/showthread.php?tid=649059)
mute error -
PepsiCola23 - 02.02.2018
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;
|
Re: mute error -
Mugala - 02.02.2018
I already answered this at this thread -
https://sampforum.blast.hk/showthread.php?tid=649040
Re: mute error -
PepsiCola23 - 02.02.2018
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...
Re: mute error -
Mugala - 02.02.2018
this reset isn't working. u already know it.
Re: mute error -
PepsiCola23 - 02.02.2018
it was working long times ago
there is no reason to use a timer in such situation
Re: mute error -
jasperschellekens - 02.02.2018
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;
Re: mute error -
PepsiCola23 - 02.02.2018
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(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;
|
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.
Re: mute error -
jasperschellekens - 02.02.2018
Maybe this:
PHP код:
if(SpamTimes[playerid] >= 5)
try adding debug messages to check the output.
Re: mute error -
PepsiCola23 - 02.02.2018
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?
Re: mute error -
Mugala - 02.02.2018
I ALREADY WROTE FIX BUT YOU GUYS MADE A SH1T ON IT.
(TIMERS S&CK)