[FilterScript] [FS] Simple Anti Advertizing
#1

Anti Advertizing System
Description:Hey guys this is just a simple anti ip advertizing system these is nothing less or more so enjoy

pawn Код:
#include <a_samp>
#define RED    0xE60000FF
stock IsNumeric(string[]) { for (new i = 0, j = strlen(string); i < j; i++) if (string[i] > '9' || string[i] < '0') return 0; return 1; }
public OnPlayerText(playerid, text[])
{

    new word[256],Index;while(Index < strlen(text)) {
        word = strtok(text,Index);
        if(CheckAdv(word)==1){
            new i=strfind(text,word),j=i+strlen(word)-1; text[i++]='[';
            while(i<j) {text[i]='•';i++;}
            text[j]=']';
            Kick(playerid);
            new string[128];
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pname, sizeof(pname));
            format(string, sizeof(string), "Player %s (ID:%d) has been Kicked/Banned [Reason: IP Adverstiment]", pname, playerid);
            SendClientMessageToAll(RED, string);
        }
    }
    return 1;
}
stock CheckAdv(word[])
{
    if(strlen(word)>22) return 0;
    if(strfind(word,".", true)==-1) return 0;

    new ip[5][256],index;
    ip[0] = strtok(word,index,'.');
    ip[1] = strtok(word,index,'.');
    ip[2] = strtok(word,index,'.');
    if(strfind(word,":",true)>0){
        ip[3] = strtok(word,index,':');
        if(strfind(word,",",true)>0) ip[4] = strtok(word,index,',');else ip[4] = strtok(word,index);
    } else {
        if(strfind(word,",",true)==strlen(word)) ip[3] = strtok(word,index,',');else ip[3] = strtok(word,index);
        valstr(ip[4],0);
    }
    if(!IsNumeric(ip[0])||!IsNumeric(ip[1])||!IsNumeric(ip[2])||!IsNumeric(ip[3])||!IsNumeric(ip[4])
        ||!strlen(ip[0])||!strlen(ip[1])||!strlen(ip[2])||!strlen(ip[3])||!strlen(ip[4])
        ||(strval(ip[0])==192&&strval(ip[1])==168)
        ||(strval(ip[0])==172&&strval(ip[1])>=16&&strval(ip[1])<=31)
        ||strval(ip[0])==10||(strval(ip[0])==127&&strval(ip[1])==0&&strval(ip[2])==0&&strval(ip[3])==1)) return 0;
    return 1;
}
strtok(string[],&idx,seperator = ' ')
{
    new ret[128], i = 0, len = strlen(string);
    while(string[idx] == seperator && idx < len) idx++;
    while(string[idx] != seperator && idx < len)
    {
        ret[i] = string[idx];
        i++;
        idx++;
    }
    while(string[idx] == seperator && idx < len) idx++;
    return ret;
}
Direct: Click Me Plz Im Nice
Reply
#2

Nice its usable but one thing.......
If a player tupes a random numbers do he get kick?

EDIT: Yeah he get it....
Reply
#3

You Can easily edit this script
NICE !!!
If i use it then ,I will edit it acc to my admin system thanks )
Reply
#4

if i type 123 399 193 102

i get kicked?
Reply
#5

Good! Now no more kids advertising ips. 5/5.
Reply
#6

Quote:
Originally Posted by Neonman
Посмотреть сообщение
Good! Now no more kids advertising ips. 5/5.
ill take is a yes

someone tested it? does it work properly?
Reply
#7

it works properly i use it on my test server
Reply
#8

Wow Nice On 5/5 Thnx Kiing!
Reply
#9

rafiko if you hate numbers that much disable all the numbers :P
Reply
#10

could u upload here .pwn and .amx ? i cant compile it for some reason.
Reply
#11

Why don't you just upload the .pwn?
Reply
#12

okay edited :
Reply
#13

anyway its fixed! Don't need .pwn or amx!


Compiled.
Reply
#14

i did upload amx and pawn :P
Reply
#15

O Yea I Needed It Thanks forgottenkings Plz Put it on pwn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)