View Single Post
Author Message
EHG
Senior Member
Join Date: May 2009
Location: 127.0.0.1
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 - 3541 views - 4.9 KB)

Last edited by EHG; 11-03-2011 at 16:44.
EHG is offline