25.12.2009, 18:27
Quote:
Originally Posted by .:: ZeX ::.
pawn Код:
pawn Код:
|
Never an ip can't have the lenght lower than 8 (1.1.1.1) ...
And never 3 digits near dot can't be higher than 255
Am i right ?
So this must be something like this:
pawn Код:
stock IsFindIp(str[])
{
new nn,x,n,p;
while(str[x] != strlen(str))
{
if(nn > 255) return 0;
else nn = 0;
if((str[x] >= '0') && (str[x]<='9')) n++,nn++;
if(str[x] == '.') p++;
x++;
}
return ((n>=8)&&(p>=3)) ? true : false;
}