[FilterScript] [ANTI] Server Advertising
#1

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;
}
Reply
#2

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

lol this system looking Nice bro..
lemme test it
Reply
#4

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.
Reply
#5

add
text, ".com, .net, www. etc", true)
Reply
#6

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

Nice FS +rep
Reply
#8

good job.
Reply
#9

nice....
Reply
#10

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


Forum Jump:


Users browsing this thread: