Problem , maybe Bug ?
#1

pawn Код:
if(!strcmp(cmdtext,"/dots",true))
{
  new dots,string[] = "123.456.789.012";
  for(new i; i < strlen(string); i++)
  {
    if(!strcmp(string[i],".",true)) dots++;
  }
  if(dots < 3 || dots > 3) return SCM(playerid,0xFFFFFFFF,"This is not a VALID IP.");
}
I type /dots , and i recive that msg ( This is not a VALID IP. )

Why ? I have 3 dots on that string ....
Reply
#2

pawn Код:
if(string[i] == '.') dots++;
Reply
#3

Код:
if(!strcmp(cmdtext,"/dots",true)){ 
  new 
    dots,
    string[] = "123.456.789.012";
  for(new i;string[i]); i++)
    if(string[i] == '.'))
      if(++dots > 3)
        return SCM(playerid,0xFFFFFFFF,"This is not a VALID IP.");
  if(3 > dots) return SCM(playerid,0xFFFFFFFF,"This is not a VALID IP.");
}
Reply
#4

Quote:
Originally Posted by dice7
pawn Код:
if(string[i] == '.') dots++;
Oh yea, thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)