Pawno error 021: -_-
#1

hello guys im back to scripting but i have lost my mind please tell me what to do i have this error

Код:
C:\Users\Ashwin\Desktop\Land of Paradise\gamemodes\larp.pwn(25115) : error 021: symbol already defined: "strtok"
and my lines are

Код:
25114 :strtok(const string[], &index)
25115 :{
25116 :	new length = strlen(string);
25117 :	while ((index < length) && (string[index] <= ' '))
25118 :	{
25119 :		index++;
25120 :	}
25121 :
25122 :	new offset = index;
25123 :	new result[20];
25124 :	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
25125 :	{
25126 :		result[index - offset] = string[index];
25127 :		index++;
25128 :	}
25129 :	result[index - offset] = EOS;
25130 :	return result;
25131 :}
Reply
#2

Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
 
    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;
}
+REP if i helped u
Reply
#3

Remove the entire function and Compile.
It's already defined in A) Anther location of your script or B) Inside a Include file.
Reply
#4

Either remove the stock funtion or the "..gl_common" include.
Reply
#5

thx everyone +Rep to all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)