SA-MP Forums Archive
[FilterScript] [ANTI] Server 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)
+--- Thread: [FilterScript] [ANTI] Server Advertising (/showthread.php?tid=572663)



[ANTI] Server Advertising - Tisot - 30.04.2015

Intro
Hello, i just scripted Anti Advertising system for my Server so i decide to share it here..

Features
1-If someone advertise any server IP on your server main chat, he should get ban.
2-You can put your Server IP and Forums URL on Whitelist, if you want.
3-Domains names can't be say on main chat.

What do you need?
Only SA-MP include which can be found here https://github.com/oscar-broman/Praw...ude/a_samp.inc

This is the code!
Code:
//Samp Advertising Filter Script, Created by Tisot.....
//Please donot remove credits, enjoy it!!....
#include <a_samp>

new strR[255];

#define FILTERSCRIPT
#define VERSION "1.0"

#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF

public OnFilterScriptInit()
{

}
stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    return name;
}
new l[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
        new is1=0;
        new r=0;
        l[playerid] = 1;
        if(strfind(text, "sa-mp.com", true) != -1 || strfind(text, "00.000.00.00:0000", true) != -1 || strfind(text, "******.com", true) != -1 || strfind(text, "*******.com", true) != -1) return 1;
		while(strlen(text[is1]))
        {
        if('0'<=text[is1]<='9')
        {
        new is2=is1+1;
        new p=0;
        while(p==0)
        {
        if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
        else
        {
        strmid(strR[r],text,is1,is2,255);
        if(strval(strR[r])<255) r++;
    	is1=is2;
		p=1;
   		 }
   		 }
   		 }
    	is1++;
        }
        if(r>=4)
        {
        new strMy[255];
        new STRname[255];
        GetPlayerName(playerid,STRname,255);
        format(strMy, sizeof(strMy), " Suspicion advertising %s(%d): %s",STRname,playerid,text);
        for(new j1=0; j1 < MAX_PLAYERS;j1++)
        if(IsPlayerAdmin(j1)) SendClientMessage(j1, 0xFF0000FF, strMy);
        for(new z=0;z<r;z++)
        {
        new pr2;
        while((pr2=strfind(text,strR[z],true))!=-1) for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++) text[i]='*';
      	if(l[playerid] == 1)
		{
			new tstr[256];
	 		format(tstr, 256, "~ %s has been banned from the server for 'Advertising'", PlayerName(playerid));
	 		SendClientMessageToAll(COLOR_RED, tstr);
			l[playerid] = 0;
		}
        Ban(playerid);
        }
		}
		//Domains Names
		if(strfind(text, ".com", true) != -1  || strfind(text, ".co", true) != -1 || strfind(text, ".info", true) != -1 || strfind(text, ".net", true) != -1 || strfind(text, ".org", true) != -1 || strfind(text, ".me", true) != -1 ||
    strfind(text, ".us", true) != -1 || strfind(text, ".biz", true) != -1 || strfind(text, ".com.co", true) != -1 || strfind(text, ".com.uk", true) != -1 || strfind(text, ".net.co", true) != -1 || strfind(text, ".eu", true) != -1 ||
    strfind(text, ".in", true) != -1 || strfind(text, ".uk", true) != -1 || strfind(text, ".site", true) != -1 || strfind(text, ".net16.net", true) != -1 || strfind(text, "7777", true) != -1 || strfind(text, "7800", true) != -1 ||
    strfind(text, "join my server", true) != -1 || strfind(text, "come in my server", true) != -1 || strfind(text, "come on this server", true) != -1 || strfind(text, "comuv.com", true) != -1)
 	{
			new sendername[MAX_PLAYER_NAME];
			new string[256];
			GetPlayerName(playerid, sendername, 24);
			format(string, sizeof(string), "~ %s has been banned from the server for 'Advertising'", sendername);
			SendClientMessageToAll(COLOR_RED, string);
			TogglePlayerControllable(playerid, 0);
			Ban(playerid);
			return 0;
		}
		return 1;
}



Re: [ANTI] Server Advertising - Makhmoor - 30.04.2015

Nice advertise system i'm going to try this on my server good keep it up.


Re: [ANTI] Server Advertising - Younes44 - 01.05.2015

lol this system looking Nice bro..
lemme test it


Re: [ANTI] Server Advertising - SickAttack - 01.05.2015

I don't think there's a need for another anti advertisement filterscript that just blocks numbers and not actual IP Addresses. Also done in a somehow improper/inefficient manner.

https://sampforum.blast.hk/showthread.php?tid=568668

And if I type for example: "HEY, GO TO WWW . SA-MP . COM!" - The message won't be blocked.


Re: [ANTI] Server Advertising - tantri - 01.05.2015

add
text, ".com, .net, www. etc", true)


Re: [ANTI] Server Advertising - giorgosdim12 - 02.05.2015

add XX.XXX.XXX.XXX:XXXX
x is number for block send ips to client.
12.23.23.23:2323...


Re: [ANTI] Server Advertising - IceBilizard - 13.07.2015

Nice FS +rep


Re: [ANTI] Server Advertising - M0HAMMAD - 14.07.2015

good job.


Re: [ANTI] Server Advertising - Dangjai - 14.07.2015

nice....


Re: [ANTI] Server Advertising - HydraHumza - 05.08.2015

Really this is an ur FS -_-
https://sampforum.blast.hk/showthread.php?tid=546026
Copy from this script Such people need an life -_-