Anti IP
#9

There are lots of anti-adver functions! Why do you wan't to create another one?
pawn Код:
stock CheckAdv(word[])
{
    if(strlen(word)>22) return 0;
    if(strfind(word,".", true)==-1) return 0;

    new ip[5][256],index;
    ip[0] = strzok(word,index,'.');
    ip[1] = strzok(word,index,'.');
    ip[2] = strzok(word,index,'.');
    if(strfind(word,":",true)>0){
        ip[3] = strzok(word,index,':');
        if(strfind(word,",",true)>0) ip[4] = strzok(word,index,',');else ip[4] = strzok(word,index);
    } else {
        if(strfind(word,",",true)==strlen(word)) ip[3] = strzok(word,index,',');else ip[3] = strzok(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;
}
Learn from other codes.
Reply


Messages In This Thread
Anti IP - by KaleOtter - 19.09.2010, 15:38
Re: Anti IP - by Bessensap - 19.09.2010, 15:45
Re: Anti IP - by Voldemort - 19.09.2010, 15:45
Re: Anti IP - by wups - 19.09.2010, 15:46
Re: Anti IP - by KaleOtter - 19.09.2010, 15:51
Re: Anti IP - by KaleOtter - 19.09.2010, 16:04
Re: Anti IP - by Mike_Peterson - 19.09.2010, 16:06
Re: Anti IP - by KaleOtter - 19.09.2010, 16:19
Re: Anti IP - by wups - 19.09.2010, 19:06
Re: Anti IP - by Bessensap - 19.09.2010, 21:56

Forum Jump:


Users browsing this thread: 7 Guest(s)