Raised This Month: $168 Target: $400
 42% 

[ANY] Advert Antiflood


Post New Thread Reply   
 
Thread Tools Display Modes
Author
EHG
Senior Member
Join Date: May 2009
Location: 127.0.0.1
Plugin ID:
2172
Plugin Version:
1.4
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    73 
    Plugin Description:
    Limits time between matching chat lines
    Old 01-14-2011 , 14:44   [ANY] Advert Antiflood
    Reply With Quote #1

    Advert Antiflood


    Description

    Ever get annoyed by people spamming their trade advertisements in TF2 trade servers? The current antiflood in sourcemod would allow a player to spam an advert up to 3 times before he is throttled for flooding.
    This will detect lines of chat that are identical and limit the time allowed between them. Thus people that bind an advert to a key will only be able to display it once per X time.
    This should have a huge impact on cleaning up the chat and allowing everyone to see adverts easily without having to deal with the spam.

    I wrote this plugin with TF2 trade servers in mind however it will work for any game.



    NOTE

    If you have another plugin that manipulates the chat you might have to combine this plugin with the other. For example the simple chat colors plugin could conflict with this.


    CVARS

    sm_advertflood_time "5.00" Amount of time in seconds allowed between advert chat messages.

    sm_advertflood_minlen "5" Minimum length of text to be detected (this will prevent people being throttled for various small things that they actually type fast. For example repeating the answer to yes/no question or making two smiley faces..etc)

    Changelog

    1.4 - Fixed a bug where client timer did not become invalid after a player left the server.
    1.3 - Added userid tracking in timer.
    1.2 - Cleaned up code a bit. Made plugin ignore console chat.
    1.1 - Added detection for past 3 lines.
    1.0 - Initial release.
    Attached Files
    File Type: sp Get Plugin or Get Source (advert_antiflood.sp - 1766 views - 4.9 KB)

    Last edited by EHG; 11-03-2011 at 16:44.
    EHG is offline
    PabloP
    SourceMod Donor
    Join Date: Feb 2010
    Old 01-14-2011 , 15:33   Re: [ANY] Advert Antiflood
    Reply With Quote #2

    looks like it works good thanks.
    __________________
    Beware, Im a dummy
    PabloP is offline
    xomp
    BANNED
    Join Date: Jul 2008
    Old 01-16-2011 , 13:23   Re: [ANY] Advert Antiflood
    Reply With Quote #3

    Thanks for this tough guy!
    xomp is offline
    Send a message via Skype™ to xomp
    EHG
    Senior Member
    Join Date: May 2009
    Location: 127.0.0.1
    Old 01-23-2011 , 19:05   Re: [ANY] Advert Antiflood
    Reply With Quote #4

    Added detection for past three lines. The reason for this is because I got a few people who got clever, made two separate binds with different text to get around the block since it only memorized a single line.

    What is nice about this version is that it will still allow people to use multi line adverts but will not allow them to spam.

    Last edited by EHG; 01-23-2011 at 19:21.
    EHG is offline
    tigerox
    AlliedModders Donor
    Join Date: Oct 2008
    Location: Canada
    Old 01-23-2011 , 21:11   Re: [ANY] Advert Antiflood
    Reply With Quote #5

    Great work, useful plug-in.

    One suggestion, could you make it ignore console say messages. It currently throws an error if you spam a message from the console.

    Thank you.
    __________________

    Last edited by tigerox; 01-23-2011 at 21:13.
    tigerox is offline
    EHG
    Senior Member
    Join Date: May 2009
    Location: 127.0.0.1
    Old 01-24-2011 , 16:57   Re: [ANY] Advert Antiflood
    Reply With Quote #6

    Quote:
    Originally Posted by tigerox View Post
    Great work, useful plug-in.

    One suggestion, could you make it ignore console say messages. It currently throws an error if you spam a message from the console.

    Thank you.
    Done
    EHG is offline
    irogue
    Senior Member
    Join Date: Jan 2011
    Location: Australia
    Old 02-03-2011 , 03:55   Re: [ANY] Advert Antiflood
    Reply With Quote #7

    Does it allow a whitelist so to speak for cmds used by players repeatedly like !buy or such used from a plugin?
    irogue is offline
    EHG
    Senior Member
    Join Date: May 2009
    Location: 127.0.0.1
    Old 02-13-2011 , 02:56   Re: [ANY] Advert Antiflood
    Reply With Quote #8

    Quote:
    Originally Posted by irogue View Post
    Does it allow a whitelist so to speak for cmds used by players repeatedly like !buy or such used from a plugin?
    Commands will not be affected since they are handled before this plugin modifies the chat.
    EHG is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 02-13-2011 , 07:09   Re: [ANY] Advert Antiflood
    Reply With Quote #9

    You should be using AddCommandListener instead of RegConsoleCmd.
    KyleS is offline
    PabloP
    SourceMod Donor
    Join Date: Feb 2010
    Old 02-14-2011 , 16:52   Re: [ANY] Advert Antiflood
    Reply With Quote #10

    It did block my say commands, after the first time of course, like it's supposed to. I just modified it to allow the same thing twice in a row.
    __________________
    Beware, Im a dummy

    Last edited by PabloP; 02-14-2011 at 16:54. Reason: more clearerer oO
    PabloP is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 16:16.


    Powered by vBulletin®
    Copyright ©2000 - 2017, vBulletin Solutions, Inc.
    Theme made by Freecode