SA-MP Forums Archive
Problem , maybe Bug ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem , maybe Bug ? (/showthread.php?tid=110776)



Problem , maybe Bug ? - UsaBoy91 - 28.11.2009

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 ....



Re: Problem , maybe Bug ? - dice7 - 28.11.2009

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



Re: Problem , maybe Bug ? - yezizhu - 28.11.2009

Код:
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.");
}



Re: Problem , maybe Bug ? - UsaBoy91 - 28.11.2009

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