Alot of Strtok errors
#1

So i downloaded a car system in my own language, theres a command /pojazd otworz which opens a car, when i change "otworz" to "open" or to anything else i get those errors
Код:
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1319) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1319) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1343) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1343) : error 033: array must be indexed (variable "x_nr")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1360) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1360) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1378) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1378) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1599) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1599) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1735) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1735) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1748) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1748) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1798) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1798) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1872) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1872) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2036) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2036) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2053) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2053) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2409) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2409) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2586) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2586) : error 033: array must be indexed (variable "tmp")

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


26 Errors.
How to fix these errors? Maybe its something like "anty-changecredits" which blocks me from compiling?
Reply
#2

Quote:
Originally Posted by sekol
So i downloaded a car system in my own language, theres a command /pojazd otworz which opens a car, when i change "otworz" to "open" or to anything else i get those errors
Код:
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1319) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1319) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1343) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1343) : error 033: array must be indexed (variable "x_nr")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1360) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1360) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1378) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1378) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1599) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1599) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1735) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1735) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1748) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1748) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1798) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1798) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1872) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(1872) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2036) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2036) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2053) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2053) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2409) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2409) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2586) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(2586) : error 033: array must be indexed (variable "tmp")

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


26 Errors.
How to fix these errors? Maybe its something like "anty-changecredits" which blocks me from compiling?
[pawno]
#include <a_samp>
[/pawno]

Did you do that?
Reply
#3

have you added this at the top of ur script?

Код:
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;
}
edit:not right at the top*
Reply
#4

Quote:
Originally Posted by iggy1
have you added this at the top of ur script?

Код:
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;
}
At top? Under public or something?
Reply
#5

i had it after onfilterscriptinit only used it once now i use zcmd and sscanf

Edit: not inside OnFilterScriptInit after the closing brace (im no expert)
Reply
#6

Now I'm gettin' this:
Код:
 C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(735) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(735) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(735) : error 017: undefined symbol "string"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(735) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#7

put this function on the very bottom of your script

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
#8

Now this
Код:
 C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(810) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(810) : error 017: undefined symbol "string"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(810) : error 017: undefined symbol "index"
C:\Documents and Settings\Machlik\Pulpit\CRP_0.3\SA-MP\filterscripts\pojazdy.pwn(810) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#9

Show the lines
Reply
#10

Код:
Код:
From 790 to 820
AddMenuItem(ColorsS, 0, "Blue");
AddMenuItem(ColorsS, 0, "Grey");
AddMenuItem(ColorsS, 0, "Light red");
AddMenuItem(ColorsS, 0, "Light Green");
AddMenuItem(ColorsS, 0, "Purple");

Colors2S = CreateMenu("Vehicle Colors Two", 1, 50.0, 180.0, 200.0, 200.0);

AddMenuItem(Colors2S, 0, "Black");
AddMenuItem(Colors2S, 0, "White");
AddMenuItem(Colors2S, 0, "Light Blue");
AddMenuItem(Colors2S, 0, "Red");
AddMenuItem(Colors2S, 0, "Green");
AddMenuItem(Colors2S, 0, "Pink");
AddMenuItem(Colors2S, 0, "Yellow");
AddMenuItem(Colors2S, 0, "Blue");
AddMenuItem(Colors2S, 0, "Grey");
AddMenuItem(Colors2S, 0, "Light red");
AddMenuItem(Colors2S, 0, "Light Green");
AddMenuItem(Colors2S, 0, "Purple");
strtok(const string[], &index) *LINE 810*
{
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)))
{
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)