SA-MP Forums Archive
[FilterScript] Anti Advertisement System - Simple, yet effective! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Anti Advertisement System - Simple, yet effective! (/showthread.php?tid=568668)



Anti Advertisement System - Simple, yet effective! - SickAttack - 24.03.2015

Anti Advertisement System
Simple, yet effective!
Information

This filterscript uses a regular expression to detect valid IP Addresses (0-255) to block them later on and prevent them from being sent to other players. However, invalid IP Addresses (not 0, not between 0 and 255, not 255) are sent to other players - That isn't really a problem since it's invalid.

Regular Expression

This is the regular expression used in this filterscript:
Код:
(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.+){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
Method

The filterscript converts all the characters (not numbers, only characters) in the text to points (.) and then uses the regular expression to validate the text, whether a valid IP Address was found or not.

Requirements

To use this filterscript, you will need to get the following, if you don't have it yet: Screenshots

1)

Message sent:


Response from filterscript:


2)

Message sent:


Response from filterscript:


3)

Message sent:


Response from filterscript:


4)

Message sent:


Response from filterscript:


5)

Message sent:


Response from filterscript:


6)

Testing the regular expression used in this filterscript:


Notice
Download

Anti Advertisement System - Pastebin - #1 paste tool since 2002

Additional

This thread is also available in Spanish / Espaсol, click here and you will be redirected to it automatically!


Re : Anti Advertisement System - Simple, yet effective! - AlexBlack - 24.03.2015

Wow, nice one ! keep it up +REP


Re: Anti Advertisement System - Simple, yet effective! - Wolfe - 24.03.2015

Looks cool


Re: Anti Advertisement System - Simple, yet effective! - ]Rafaellos[ - 24.03.2015

How about this. 128 1 1 1.


Re: Anti Advertisement System - Simple, yet effective! - SickAttack - 24.03.2015

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
How about this. 128 1 1 1.





Re: Anti Advertisement System - Simple, yet effective! - X337 - 24.03.2015

Nice fs i wanna use that regex to check IP on my server.
Thanks for sharing sir.


Re: Anti Advertisement System - Simple, yet effective! - Mya - 24.03.2015

wow, cool fs, thanks for sharin, i gonna use it on my server thanks


Re: Anti Advertisement System - Simple, yet effective! - De4dpOol - 24.03.2015

Very usefull, going to use it. +1


Re: Anti Advertisement System - Simple, yet effective! - Younes44 - 24.03.2015

Good Job Brother!


Re: Anti Advertisement System - Simple, yet effective! - hamzajaved780 - 24.03.2015

Nice, but would have been awesome if it did't required an external plugin.