Basic Anti Spam System

Started by Yankee, Jun 09, 2017, 07:37 AM

Previous topic - Next topic

Mötley

You stopped onPlayerChat( player, text), After that print( player.Name + ": " + text ).

Remove     

    print( player.Name + ": " + text );
    return 1;

function onPlayerChat( player, text )
{
 
    print( player.Name + ": " + text );
    //return 1;
    Spammers[player.ID][0] = Spammers[player.ID][1];
    Spammers[player.ID][1] = Spammers[player.ID][2];
    Spammers[player.ID][2] = message;
    if (Spammers[player.ID][0] == Spammers[player.ID][1] && Spammers[player.ID][1] == Spammers[player.ID][2])
    {
        MessageAll(player.Name + " spam yapmaktan ATILDI!");
        player.Kick();
    }
}



About the basic anti spam script, I really hate it.

And is it just me or once the player is done with a third message they get kicked regardless? No automatic method to clear the players spam, Nothing, And it kicks the player instead of muting them D:

EK.IceFlake

Quote from: TurboGrafx on Jun 12, 2017, 10:29 AMAbout the basic anti spam script, I really hate it.

And is it just me or once the player is done with a third message they get kicked regardless? No automatic method to clear the players spam, Nothing, And it kicks the player instead of muting them D:
The OP requested a basic anti spam script and since I don't really like doing such stuff I sketched up a very basic anti spam script.

Mötley

Just a preference:
I personally prefer adding something spam related to a player class, As well mute related, Add something to a player loop to decrease the spam integer if it were higher than 0.

And on each message increase the spam integer, maybe by five each time. if the spam integer is above 17 mute the player for five minutes.

Now set the mute to 300, And decrease it in seconds. This equals five minutes. Dont forget to clear the spam once muted.

And on player chat, If Mute is higher than 0, Or doesn't equal 0, Tell the player they are muted, Then return 0 on the players chat.

You could also add the mute value to the players accounts if spam is bad in your server, Hence so bad players just reconnect to remove the spam to continue spamming

EK.IceFlake

Quote from: TurboGrafx on Jun 12, 2017, 11:01 AMJust a preference:
I personally prefer adding something spam related to a player class, As well mute related
Having separate arrays for different player values increases performance by reducing cache miss.