Raised This Month: $40 Target: $400
 10% 

Block Advertising


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose       
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-01-2012 , 13:06   Block Advertising
Reply With Quote #1

Block Advertising
[REQ]

Description
  • As title suggests this is a plugin for blocking most of the adverts typed in chat. First i want to say that i know there is a similar plugin by JGHG (maybe others? but i don't remember) but this has a different approach. First, it doesn't use RegEx, i know it's powerful and flexible but not as much as this type of plugin needs because of the much cases where it can have false detects. It's based on string manipulation and can be customized in different ways. This plugin aims to block most of the adverts that can be written in chat under different forms (normal, with delimiters, white spaces, symbols, letters and so...) plus it's still in development. Before start to talk and write that something like this already exists or it can be done in a easiest way using RegEx or any other methods you know, try it! Then you may suggest improvements and post possible bugs or false detects. Thank you

Detect
Code:
11.1.1.1
11.1.1.1:20715
11...1...1...1 (or any number of dots)
11/1/1/1
11 / 1 / 1 / 1 (any number of spaces and delimiters)
1/1.2.3/1.2/3 (any combination of delimiters)
11 1 1 1
1 2 3       1 1      3 1     2
22 l 2 l 2 l 2 (l - from leather. It can recognize letters delimiters too)
Remember, it's working for any ip format but if IP it's written without any delimiters like 123.22.4.1, an IP block (3 different blocks) must contain at least 2 digits. If IP it's written with delimiters like 1-2-3/3-1/1/2 then it must contain 3 different digits.

Cvar
  • amx_advblock (Default: "abd") - Plugin mod flags

    Flags
    Code:
    a - Block chat lines that have been detected as advert
    b - Warn player that he made an advert
    c - Kick player if he make more than MAX_WARNINGS adverts (per session)
    d - Log chat lines that have been detected as advert ( Name and Chat line )
    e - Bypass advertise check for admins with BYPASS_FLAG

Changelog
Spoiler


Requirments
Modifications
  • ColorChat Use - If you want to use colors in chat, uncomment the following lines then recompile
    Code:
    #include <colorchat>
    
    #define USE_COLORCHAT
  • Maximum warnings before kick if you use cvar flag "c"
    Code:
    #define MAX_WARNINGS 3
  • Bypass advertise check on admins with the following flag
    Code:
    #define BYPASS_FLAG ADMIN_RCON

Files
  • advblock_config.ini - Configuration file must be copied into /addons/amxmodx/configs folder
  • advblock_logs.log - Logs file will be created automatically in /addons/amxmodx/logs folder

Find updated plugin HERE
Attached Files
File Type: ini advblock_config.ini (327 Bytes, 2526 views)
File Type: sma Get Plugin or Get Source (block_advertising.sma - 3434 views - 6.5 KB)
__________________
Still...lovin' . Connor noob! Hello

Last edited by hornet; 03-06-2015 at 20:50.
Alka is offline
tigo bitties
Member
Join Date: Sep 2012
Old 10-01-2012 , 13:27   Re: Block Advertising
Reply With Quote #2

I tested this when you posted it in the request section, good job.
tigo bitties is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 10-01-2012 , 13:42   Re: Block Advertising
Reply With Quote #3

Wow, alka is back.
__________________
Accepting paid work for clans and communities. !Plugins & Models!
Don't hesitate to contact me.
bibu is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 10-01-2012 , 15:30   Re: Block Advertising
Reply With Quote #4

Awesome , thanks for that x)
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-01-2012 , 20:24   Re: Block Advertising
Reply With Quote #5

Well, all you just did was implement a very small subset of Regex. I highly doubt that this has fewer false positives than a properly formatted RegEx pattern. I'd like to see an efficiency comparison between this and RegEx because have quite a few native calls there for every single letter typed in chat.

Color chat does not work in all games so either remove color chat or change the the plugin to Counter-Strike only.
__________________

Last edited by fysiks; 10-01-2012 at 20:47.
fysiks is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 10-01-2012 , 21:47   Re: Block Advertising
Reply With Quote #6

Nice plugin I will test it.
GJ

PS: What does this mean?
PHP Code:
enum (<<=1
__________________

Last edited by Neeeeeeeeeel.-; 10-01-2012 at 21:48.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 10-02-2012 , 00:23   Re: Block Advertising
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
Well, all you just did was implement a very small subset of Regex. I highly doubt that this has fewer false positives than a properly formatted RegEx pattern. I'd like to see an efficiency comparison between this and RegEx because have quite a few native calls there for every single letter typed in chat.

Color chat does not work in all games so either remove color chat or change the the plugin to Counter-Strike only.
Yes, removing Color Chat would be a great idea.
I think a Bypass flag is not needed.

Instead of:

PHP Code:
!szText
You may check the length:

PHP Code:
if( strlenszText ) < 
Change Changelog to [ code ], [ quote ] or even [ spoiler ] + [ code ] tag.

Good job!

And the greatest question is: there is no possibility to do that using RegEx?

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
PS: What does this mean?
PHP Code:
enum (<<=1
It means an enumeration of bytes.
A byte may be checked with "&" operator.
__________________

Last edited by claudiuhks; 10-02-2012 at 00:32.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Swat-inc
BANNED
Join Date: Mar 2008
Old 10-02-2012 , 06:32   Re: Block Advertising
Reply With Quote #8

L 10/02/2012 - 121:40: Start of error session.
L 10/02/2012 - 121:40: Info (map "fy_pool_day") (file "addons/amxmodx/logs/error_20121002.log")
L 10/02/2012 - 121:40: [AMXX] Invalid Plugin (plugin "block_advertising.amxx")

Something wrong with this plugin...

but then i do that plugin works normaly - ColorChat Use - If you don't want to use colors in chat comment the following lines then recompile
Code:
//#include <colorchat> //#define USE_COLORCHAT

Last edited by Swat-inc; 10-02-2012 at 06:37.
Swat-inc is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-02-2012 , 06:50   Re: Block Advertising
Reply With Quote #9

Ok. Lets start...

@fysiks - It is like a Regex subset but with more checks. I don't even bother to explain, you can check that yourself...you can make comparisons. If you bother to read about plugin modifications you will see that it can be used without colorchat too and this make it compatible for all games and not only CS.

@claudiuhks - Same about colorchat, just comment 2 lines and don't use it. You can't follow one little advice and modify a file? Really? About strlen() yeah it's a good idea, i will modify it. Code tags are useless for changelog? why would you need that? I will add spoiler tags and that it's enough for shorting the post. BYPASS_FLAG it's there for owners, maybe i want to write any website? make fun of someone? but i don't want to add in the whitelist so that anyone can write it

The greatest answer: do it yourself. I didn't say that it's not possible...just this way i can handle the false detects.

@Swat-inc - Open the log and paste the error here
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 10-02-2012 at 07:04.
Alka is offline
Swat-inc
BANNED
Join Date: Mar 2008
Old 10-02-2012 , 06:54   Re: Block Advertising
Reply With Quote #10

in logs only this text - but then i do that //#include <colorchat> //#define USE_COLORCHAT and recompiled its works perfect ;)
L 10/02/2012 - 12:03:12: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20121002.log")
L 10/02/2012 - 12:03:12: [AMXX] Invalid Plugin (plugin "block_advertising.amxx")
L 10/02/2012 - 12:10:46: Start of error session.
L 10/02/2012 - 12:10:46: Info (map "de_dust2_2x2") (file "addons/amxmodx/logs/error_20121002.log")
L 10/02/2012 - 12:10:46: [AMXX] Invalid Plugin (plugin "block_advertising.amxx")
L 10/02/2012 - 121:40: Start of error session.
L 10/02/2012 - 121:40: Info (map "fy_pool_day") (file "addons/amxmodx/logs/error_20121002.log")
L 10/02/2012 - 121:40: [AMXX] Invalid Plugin (plugin "block_advertising.amxx")
Swat-inc 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 14:04.


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