SA-MP Forums Archive
Anti-Advertise Problem - 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)
+--- Thread: Anti-Advertise Problem (/showthread.php?tid=459654)



Anti-Advertise Problem - xVIP3Rx - 24.08.2013

Код:
stock IsAdvertisement(text[])
{
	new NuCnt,DotCnt;
	for (new i = 0, l = strlen(text); i < l; i++)
	{
	  if(text != ("SERVER_IP")) //How to do this right ?
	  if ('0' <= text[i] <= '9'){
	  NuCnt++; continue;}
	  if(text[i] == '.' || text[i] == ':' || text[i] == '_')
	  if(text[i+1] != '.' && text[i+1] != ':' && text[i+1] != '_')
	  DotCnt++;
	  if (NuCnt >= 7 && DotCnt >= 3)
	  return true;
	}
	return false;
}
Quote:

error 033: array must be indexed (variable "text")




Re: Anti-Advertise Problem - xVIP3Rx - 25.08.2013

Up :S


Re: Anti-Advertise Problem - xXSPRITEXx - 25.08.2013

Which line is the error on? Copy the whole line.


Re: Anti-Advertise Problem - BullseyeHawk - 25.08.2013

pawn Код:
stock IsAdvertisement(text[])
{
    new NuCnt,DotCnt;
    for (new i = 0, l = strlen(text); i < l; i++)
    {
      if(strlen(text) > 0 && strcmp(text, ("SERVER_IP"), true) == 0) // Correct way without sscanf..
      if ('0' <= text[i] <= '9'){
      NuCnt++; continue;}
      if(text[i] == '.' || text[i] == ':' || text[i] == '_')
      if(text[i+1] != '.' && text[i+1] != ':' && text[i+1] != '_')
      DotCnt++;
      if (NuCnt >= 7 && DotCnt >= 3)
      return true;
    }
    return false;
}
...