Anti-Advertise Problem
#1

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

Reply
#2

Up :S
Reply
#3

Which line is the error on? Copy the whole line.
Reply
#4

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;
}
...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)