[FS] Simple Anti Advertizing -
forgottenkings - 19.11.2011
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
Re: [FS] Simple Anti Advertizing -
Marshall32 - 19.11.2011
Nice its usable but one thing.......
If a player tupes a random numbers do he get kick?
EDIT: Yeah he get it....
Re: [FS] Simple Anti Advertizing -
Niko_boy - 19.11.2011
You Can easily edit this script
NICE !!!
If i use it then ,I will edit it acc to my admin system
thanks
)
Re: [FS] Simple Anti Advertizing -
Rafiko - 19.11.2011
if i type 123 399 193 102
i get kicked?
Re: [FS] Simple Anti Advertizing - Astralis - 19.11.2011
Good! Now no more kids advertising ips. 5/5.
Re: [FS] Simple Anti Advertizing -
Rafiko - 19.11.2011
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?
Re: [FS] Simple Anti Advertizing -
forgottenkings - 20.11.2011
it works properly i use it on my test server
Re: [FS] Simple Anti Advertizing -
YoUnG_KiD - 20.11.2011
Wow Nice On 5/5 Thnx Kiing!
Re: [FS] Simple Anti Advertizing -
forgottenkings - 20.11.2011
rafiko if you hate numbers that much disable all the numbers :P
Re: [FS] Simple Anti Advertizing - Astralis - 20.11.2011
could u upload here .pwn and .amx ? i cant compile it for some reason.
Re: [FS] Simple Anti Advertizing -
GangsTa_ - 20.11.2011
Why don't you just upload the .pwn?
Re: [FS] Simple Anti Advertizing -
forgottenkings - 20.11.2011
okay edited :
Re: [FS] Simple Anti Advertizing - Astralis - 20.11.2011
anyway its fixed! Don't need .pwn or amx!
Compiled.
Re: [FS] Simple Anti Advertizing -
forgottenkings - 20.11.2011
i did upload amx and pawn :P
Re: [FS] Simple Anti Advertizing -
K4P3L_KUM4R - 20.11.2011
O Yea I Needed It Thanks forgottenkings Plz Put it on pwn