SA-MP Forums Archive
The problem about the gang FS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: The problem about the gang FS (/showthread.php?tid=361606)



The problem about the gang FS - Raphy - 21.07.2012

I have compiled a FS and it gives me 10 errors that I cannot solve:

G:\Server\filterscripts\gang.pwn(265) : error 017: undefined symbol "strtok"
G:\Server\filterscripts\gang.pwn(265) : error 033: array must be indexed (variable "cmd")
G:\Server\filterscripts\gang.pwn(304) : error 017: undefined symbol "strtok"
G:\Server\filterscripts\gang.pwn(304) : error 033: array must be indexed (variable "tmp")
G:\Server\filterscripts\gang.pwn(323) : error 017: undefined symbol "strtok"
G:\Server\filterscripts\gang.pwn(323) : error 033: array must be indexed (variable "tmp")
G:\Server\filterscripts\gang.pwn(343) : error 017: undefined symbol "strtok"
G:\Server\filterscripts\gang.pwn(343) : error 033: array must be indexed (variable "tmp")
G:\Server\filterscripts\gang.pwn(369) : error 017: undefined symbol "strtok"
G:\Server\filterscripts\gang.pwn(369) : error 033: array must be indexed (variable "tmp")
G:\Server\filterscripts\gang.pwn(264) : warning 203: symbol is never used: "idx"

Your help would be much appreciated. Thanks in advance.


Re: The problem about the gang FS - WinterAce - 21.07.2012

Copy and paste the scripts in the error lines given.


Re: The problem about the gang FS - Raphy - 21.07.2012

Sorry for forgetting about them, here they are:

Line 265:
pawn Код:
cmd = strtok(cmdtext, idx);
Line 304:
pawn Код:
tmp = strtok(cmdtext, idx);
Line 323:
pawn Код:
tmp = strtok(cmdtext, idx);
Line 343:
pawn Код:
tmp = strtok(cmdtext, idx);
Line 369:
pawn Код:
tmp = strtok(cmdtext, idx);
Line 264:
pawn Код:
new idx;
The errors from lines 304, 323, 343, 369 are from the FS commands


Re: The problem about the gang FS - HB - 21.07.2012

That means you don't have strtok. You need the strtok function. ****** it to find it. Although I do suggest you use another command processor such as zcmd or y_cmd.


Re: The problem about the gang FS - Raphy - 21.07.2012

Quote:
Originally Posted by Neozftw
Посмотреть сообщение
That means you don't have strtok. You need the strtok function. ****** it to find it. Although I do suggest you use another command processor such as zcmd or y_cmd.
Would you mind helping me by posting it here? I'm not good at googling...


Respuesta: The problem about the gang FS - farCry.xD - 21.07.2012

Код:
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;
}
Put this on the top of your script

Line 264:
new idx;

Delete this !

Tel me if it work's