Server just crashed AGAIN, what can i script to prevent this?
#1

Код:
[12:07:42] [chat] [mijowa]: 7777777
[12:07:42] [chat] [mijowa]: 88888888
[12:07:42] [chat] [mijowa]: 999999999
[12:07:42] [chat] [mijowa]: 101010101010
[12:07:42] [chat] [mijowa]: 999999999
[12:07:42] [chat] [mijowa]: 88888888
[12:07:42] [chat] [mijowa]: 7777777
[12:07:42] [chat] [mijowa]: 666666
[12:07:42] [chat] [mijowa]: 55555
[12:07:42] [chat] [mijowa]: 4444
[12:07:42] [chat] [mijowa]: 333
[12:07:42] [chat] [mijowa]: 22
[12:07:42] [chat] [mijowa]: 1
[12:07:42] [chat] [mijowa]: 1
[12:07:42] [chat] [mijowa]: 22
[12:07:42] [chat] [mijowa]: 333
[12:07:42] [chat] [mijowa]: 4444
[12:07:42] [chat] [mijowa]: 55555
[12:07:42] [chat] [mijowa]: 666666
[12:07:42] [chat] [mijowa]: 7777777
[12:07:42] [chat] [mijowa]: 88888888
[12:07:42] [chat] [mijowa]: 999999999
[12:07:42] [chat] [mijowa]: 101010101010
[12:07:42] [chat] [mijowa]: 999999999
[12:07:42] [chat] [mijowa]: 88888888
[12:07:42] [chat] [mijowa]: 7777777
[12:07:42] [chat] [mijowa]: 666666
[12:07:42] [chat] [mijowa]: 55555
[12:07:42] [chat] [mijowa]: 4444
[12:07:42] [chat] [mijowa]: 333
[12:07:42] [chat] [mijowa]: 22
[12:07:42] [chat] [mijowa]: 1
[12:07:42] [chat] [mijowa]: 1
[12:07:42] [chat] [mijowa]: 22
[12:07:42] [chat] [mijowa]: 333
[12:07:42] [chat] [mijowa]: 4444
[12:07:42] [chat] [mijowa]: 55555
[12:07:42] [chat] [mijowa]: 666666
[12:07:42] [chat] [mijowa]: 7777777
[12:07:42] [chat] [mijowa]: 88888888
[12:07:42] [chat] [mijowa]: 999999999
[12:07:42] [chat] [mijowa]: 101010101010
[12:07:42] [chat] [mijowa]: 999999999
[12:07:42] [chat] [mijowa]: 88888888
[12:07:42] [chat] [mijowa]: 7777777
[12:07:42] [chat] [mijowa]: 666666
[12:07:42] [chat] [mijowa]: 55555
[12:07:42] [chat] [mijowa]: 4444
[12:07:42] [chat] [mijowa]: 333
[12:07:42] [chat] [mijowa]: 22
[12:07:42] [chat] [mijowa]: 1
[12:07:42] [chat] [mijowa]: 1
[12:07:42] [chat] [mijowa]: 22
[12:07:42] [chat] [mijowa]: 333
AND 300 000 more lines of exact same lines......

How can i automaticly BAN!!!! something like this ?
Reply
#2

Just write an anti-spam script
Reply
#3

made this quirckly, it should work.
pawn Код:
new timeforuse[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
    if(timeforuse[playerid] > gettime()) return SendClientMessage(playerid,-1,"You must wait 4 secongs to chat again");
    timeforuse[playerid] = gettime() + 4;
    return 1;
}
Reply
#4

can I make my server ban people spamming like this multiple times after that warning?
Reply
#5

Think this should work, probably not the best way of doing it but should still work.
pawn Код:
new timeforban[MAX_PLAYERS];
new timeforuse[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
    if(timeforuse[playerid] > gettime()) return SendClientMessage(playerid,-1,"You must wait 4 secongs to chat again");
    timeforuse[playerid] = gettime() + 4;
    timeforban[playerid] += 1;
    if(timeforban[playerid] > = 3)
    {
        Ban(playerid);
        return 1;
    }
    return 1;
}
Reply
#6

if the player has spammed more than 5 times in less than 1 second it will ban him.
pawn Код:
new timeforuse[MAX_PLAYERS],timesused[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
    if(timesused[playerid] > 5) return Ban(playerid);
    if(timeforuse[playerid] > GetTickCount()) return ++timesused[playerid],SendClientMessage(playerid,-1,"You must wait 4 secongs to chat again");
    else
    {
      timesused[playerid] = 0;
    }
    timeforuse[playerid] = GetTickCount() + 1000;
    return 1;
}
Reply
#7

Aha! Thanks Leonardo1434 ^^ I will give you the 100th Rep xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)