../include/gl_common.inc
#1

I keep getting this when i compile.
i am trying to add The Cars On to my server

Код:
../include/gl_common.inc(80) : error 021: symbol already defined: "strtok"
../include/gl_common.inc(139) : error 021: symbol already defined: "isNumeric"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
//----------------------------------------------------------

stock strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	} //--Line 80

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

//------------------------------------------------
Код:
//----------------------------------------------------------

stock isNumeric(const string[])
{
  new length=strlen(string);
  if (length==0) return false;
  for (new i = 0; i < length; i++)
    {
      if ( //--Line 139
            (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-'
             || (string[i]=='-' && i!=0)                                             // A '-' but not at first.
             || (string[i]=='+' && i!=0)                                             // A '+' but not at first.
         ) return false;
    }
  if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
  return true;
}

//----------------------------------------------------------
I Hope you can help with the details I've Given
Reply
#2

Remove the line:
pawn Код:
#include <gl_common>
from your script.
Because those functions are defined in your script as well as in the include.
Reply
#3

That isnt on my script...
Reply
#4

Well then any include you have used in the script will be having the functions 'isnumeric' and 'strtok'. That's why it's showing symbol is already defined. If you've any other purposes in using gl_common, I suggest you to remove 'strtok' and 'isnumeric' functions from it or remove it from the script or include which has it.
Reply
#5

Check if you have those functions defined in your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)