19.09.2010, 19:06
There are lots of anti-adver functions! Why do you wan't to create another one?
Learn from other codes.
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;
}