SA-MP Forums Archive
[Include] Anti Advertising - 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Anti Advertising (/showthread.php?tid=604086)

Pages: 1 2


Anti Advertising - Kar - 31.03.2016

Continuing my discussion thread at http://forum.sa-mp.com/showthread.ph...58#post3679258

FEATURES:

This include searches for IPs in strings.

The function searches for numbers ranging from 0-255 in a string. If it atleast 4 of these, then the string contains an IP.

USAGE:

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(stringContainsIP(text)) {
        SendClientMessage(playerid, "Text blocked for advertising.");
        return 0;
    }
    return 1;
}

SYTNAX:

stringContainsIP(const szStr[], bool:fixedSeparation = false, bool:ignoreNegatives = false, bool:ranges = true);
  1. bool:ignoreNegatives:
    • By default, it will detect negative numbers as IPs also.
    • So, if false "-1.-1.-1.-1" would be an IP. If true, "-1.-1.-1.-1" would not be an IP.

TEST RESULTS:

pawn Код:
[31/03/2016 10:14:05][05/04/2016 17:50:10] 000.000.000.000 - 1.

[05/04/2016 17:50:10] 0.0.0.0 - 1.

[05/04/2016 17:50:10] 127.0.0.1 - 1.

[05/04/2016 17:50:10] 127  .  0.  0.  1:  7777 - 1.

[05/04/2016 17:50:10] 255.255.255.255 - 1.

[05/04/2016 17:50:10] PLS COME JOIN SERVER 37____187____22____119 - 1.

[05/04/2016 17:50:10] PLS COME JOIN SERVER 37 $$$$ 187 $$$$ 22 $$$$ 119 - 1.

[05/04/2016 17:50:10] -32.-187.-22.-119 - NOTE: REMOVE THE -s AND JOIN NOW! - 1.

[05/04/2016 17:50:10] 255-255-255-255:7777 - 1.

[05/04/2016 17:50:10] -1.-1.-1.-1 - 1.

[05/04/2016 17:50:10] 0000.000.000.0000 - 0.

[05/04/2016 17:50:10] 255.256.255.255 - 0.

[05/04/2016 17:50:10] 1-1.1-1.1-1.1-1 - 1.
DOWNLOAD:
https://github.com/karimcambridge/samp-anti-advertising

CREDITS:

RyDer` for base function.

DISCLAIMER:

Use regex for better results.



Re: Anti Advertising - vannesenn - 31.03.2016

It's useful, thanks, it'll help!


Re: Anti Advertising - JokeyL - 31.03.2016

What about commas?

Example:

255, 255.255, 255:7777

or:

255,255,255.255;7777


Re: Anti Advertising - Kar - 31.03.2016

Quote:
Originally Posted by JokeyL
Посмотреть сообщение
What about commas?

Example:

255, 255.255, 255:7777

or:

255,255,255.255;7777
It detects those.


Re: Anti Advertising - Dayvison_ - 31.03.2016

Great, release before today i always used regex.


Re: Anti Advertising - Kar - 31.03.2016

Update: Added an option to ignore negative numbers. Commit: https://github.com/Kar2k/samp-anti-a...6041366c17e54c


Re: Anti Advertising - BroZeus - 01.04.2016

What about detection of domain name as IP (eg: samp.example.net:7777).


Re: Anti Advertising - JokeyL - 01.04.2016

Код:
255-255-255-255:7777
Don't detect.


Re: Anti Advertising - SickAttack - 01.04.2016

Quote:
Originally Posted by JokeyL
Посмотреть сообщение
Код:
255-255-255-255:7777
Don't detect.
stringContainsIP(const szStr[], bool:ignoreNegatives = false);

bool:ignoreNegatives:
By default, it will detect negative numbers as IPs also.
So, if false "-1.-1.-1.-1" would be an IP. If true, "-1.-1.-1.-1" would not be an IP.


Re: Anti Advertising - JokeyL - 01.04.2016

Still don't work..


Re: Anti Advertising - SickAttack - 01.04.2016

Quote:
Originally Posted by JokeyL
Посмотреть сообщение
Still don't work..
Well, this one does: https://sampforum.blast.hk/showthread.php?tid=604097

#NO_TRASHING_TOPIC


Re: Anti Advertising - sheNdjze - 05.04.2016

great script, but it has to block dns ips too like server.roleplay.com:7777


Re: Anti Advertising - SecretBoss - 05.04.2016

Quote:
Originally Posted by sheNdjze
Посмотреть сообщение
great script, but it has to block dns ips too like server.roleplay.com:7777
Since it contains ":7777" I think that it will blocked anyway, but in case you want to block that domains then you will need to block every domain and it will may be a problem


Re: Anti Advertising - Kar - 05.04.2016

Quote:
Originally Posted by JokeyL
Посмотреть сообщение
Код:
255-255-255-255:7777
Don't detect.
Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Well, this one does: https://sampforum.blast.hk/showthread.php?tid=604097

#NO_TRASHING_TOPIC
Works now.


[05/04/2016 17:12:17] 255-255-255-255:7777 - 1.

Fixed in https://github.com/Kar2k/samp-anti-a...b690a7b26728a4


Re: Anti Advertising - Kar - 08.04.2016

Added an option to check for fixed separation between ip numbers. Enabled by default.

Meaning 127 ....... 0. 1. 1. is not a valid IP but 127.0.1.1 is a valid
IP.

If you have people speaking etc in your server, you should leave this on
by default.

https://github.com/Kar2k/samp-anti-a...50151c64b769e9


Re: Anti Advertising - Kar - 13.02.2017

UPDATE!

- Disabled fixed seperation by default.
- Added support for ranges.
- Added support for numbers such as 0255 or 0005 (technically people can use this to advertise E.G (join my server at 0192. 0169 .0094.030.. and tell them to take out the 0s which would then be 192.169.94.30)

pawn Код:
[12/02/2017 23:00:27] 000.000.000.000 - 1.

[12/02/2017 23:00:27] 0000.000.000.0000 - 1.

[12/02/2017 23:00:27] 0052.255.255.0000 - 1.

[12/02/2017 23:00:27] 0.0.0.0 - 1.

[12/02/2017 23:00:27] 127.0.0.1 - 1.

[12/02/2017 23:00:27] 127  .  0.  0.  1:  7777 - 1.

[12/02/2017 23:00:27] 255.255.255.255 - 1.

[12/02/2017 23:00:27] PLS COME JOIN SERVER 37____187____22____119 - 1.

[12/02/2017 23:00:27] PLS COME JOIN SERVER 37 $$$$ 187 $$$$ 22 $$$$ 119 - 1.

[12/02/2017 23:00:27] -32.-187.-22.-119 - NOTE: REMOVE THE -s AND JOIN NOW! - 1.

[12/02/2017 23:00:27] 255-255-255-255:7777 - 1.

[12/02/2017 23:00:27] -1.-1.-1.-1 - 1.

[12/02/2017 23:00:27] *.*.*.* - 1.

[12/02/2017 23:00:27] 255.*.*.* - 1.

[12/02/2017 23:00:27] 255.255.*.* - 1.

[12/02/2017 23:00:27] 255.255.255.* - 1.

[12/02/2017 23:00:27] 1-1.1-1.1-1.1-1 - 1.

[12/02/2017 23:00:27] ana oltlo gam3 al 11.5m ra7 2ly gm3thom b3ad keda oltlo gam3 12m 2ly gm3thom fa olto gam3 12.5 - 1.

[12/02/2017 23:00:27] 255.256.255.255 - 0.

[12/02/2017 23:00:27] 0052.255.255.1231 - 0.
https://github.com/karimcambridge/sa...daf6b0b4d624cd


Re: Anti Advertising - Zorono - 17.06.2017

Quote:
Originally Posted by Kar
Посмотреть сообщение
UPDATE!

- Disabled fixed seperation by default.
- Added support for ranges.
- Added support for numbers such as 0255 or 0005 (technically people can use this to advertise E.G (join my server at 0192. 0169 .0094.030.. and tell them to take out the 0s which would then be 192.169.94.30)

pawn Код:
[12/02/2017 23:00:27] 000.000.000.000 - 1.

[12/02/2017 23:00:27] 0000.000.000.0000 - 1.

[12/02/2017 23:00:27] 0052.255.255.0000 - 1.

[12/02/2017 23:00:27] 0.0.0.0 - 1.

[12/02/2017 23:00:27] 127.0.0.1 - 1.

[12/02/2017 23:00:27] 127  .  0.  0.  1:  7777 - 1.

[12/02/2017 23:00:27] 255.255.255.255 - 1.

[12/02/2017 23:00:27] PLS COME JOIN SERVER 37____187____22____119 - 1.

[12/02/2017 23:00:27] PLS COME JOIN SERVER 37 $$$$ 187 $$$$ 22 $$$$ 119 - 1.

[12/02/2017 23:00:27] -32.-187.-22.-119 - NOTE: REMOVE THE -s AND JOIN NOW! - 1.

[12/02/2017 23:00:27] 255-255-255-255:7777 - 1.

[12/02/2017 23:00:27] -1.-1.-1.-1 - 1.

[12/02/2017 23:00:27] *.*.*.* - 1.

[12/02/2017 23:00:27] 255.*.*.* - 1.

[12/02/2017 23:00:27] 255.255.*.* - 1.

[12/02/2017 23:00:27] 255.255.255.* - 1.

[12/02/2017 23:00:27] 1-1.1-1.1-1.1-1 - 1.

[12/02/2017 23:00:27] ana oltlo gam3 al 11.5m ra7 2ly gm3thom b3ad keda oltlo gam3 12m 2ly gm3thom fa olto gam3 12.5 - 1.

[12/02/2017 23:00:27] 255.256.255.255 - 0.

[12/02/2017 23:00:27] 0052.255.255.1231 - 0.
https://github.com/karimcambridge/sa...daf6b0b4d624cd
found a new bug or idk
why does it counts this text 'Let's goto ******** and chat there...' as an ADV it kicks me multiple times with false reasons .... and iam not using any another Includes for ADV detect... please some bug fixs


Re: Anti Advertising - Yousha - 18.06.2017

Код:
public OnPlayerText(playerid, text[])
{
	if (stringContainsIP(text, false, true))
	{
default.pwn(1927) : error 047: array sizes do not match, or destination array is too small


Also links in your Github Repository must be updated.


Re: Anti Advertising - Dayrion - 03.11.2017

Код:
I sell 2. mp5 for 6.000$, 3uzi for 4.000$, 4mp5 for 200$
Detect an IP. I set fixedSeparation to true, IP become easily undetectable like
Код:
127.0.0 .1



Re: Anti Advertising - JoaoBorges - 07.11.2017

The include don't work, bro!