[ERROR] Strtok errors?
#1

I just downloaded the Los Santos Life Roleplay, and I tried to compile it, but I ended up with this error, and im kinda stuck from here.

Код:
 C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18296) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18296) : error 033: array must be indexed (variable "cmd")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18432) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18432) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18600) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18600) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18608) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18608) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18615) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18615) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18654) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18654) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18672) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18672) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18680) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18680) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18736) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18736) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18765) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18765) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18773) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18773) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18780) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18780) : error 033: array must be indexed (variable "tmp")
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18789) : error 017: undefined symbol "strtok"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(18789) : error 033: array must be indexed (variable "tmp")

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#2

pawn Код:
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;
}
Reply
#3

ikr, but where to insert?

I got this one..

Код:
//----------------------[ strtok() ] -------------------------------
/*stock 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;
}*/
public IsANoTrunk(carid)
{
	if(carid==13||carid==14||carid==52||carid==69||carid==100||carid==101||carid==102||carid==114||carid==115||carid==116||carid==117||carid==28||carid==29||carid==30||carid==31||carid==32||carid==46||carid==47||carid==58||carid==59||carid==60||carid==61||carid==62||carid==63||carid==64||carid==70||carid==84||carid==85||carid==175||carid==176||carid==177||carid==178||carid==179||carid==180||carid==181)
	{
		return 1;
	}
	return 0;
}
Reply
#4

Replace:
pawn Код:
//----------------------[ strtok() ] -------------------------------
/*stock 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;
}*/
FOR THIS ONE


pawn Код:
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;
}
Reply
#5

Well, that was pretty simple. Thanks a bunch!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)