SA-MP Forums Archive
Help with strtok - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with strtok (/showthread.php?tid=111950)



Help with strtok - xLowrider - 04.12.2009

Thats the error(s) im getting
Код:
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\cs.pwn(492) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\cs.pwn(492) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\cs.pwn(492) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\cs.pwn(492) : fatal error 107: too many error messages on one line

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


4 Errors.
And strtok is on line 492
Код:
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;
}
It strtok ment to be under a callback or something?

Here are the start of my commands
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[256];
	new tmp[256];
	new string[256];
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new giveplayerid, idx;
	new specplayerid;
	cmd = strtok(cmdtext, idx);
Any help would be appretiated


Re: Help with strtok - aussie_winter - 04.12.2009

Dids You Define it? #define strtok


Re: Help with strtok - xLowrider - 04.12.2009

Okay now it's defined.

Now i'm getting these errors.

Код:
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\cs.pwn(492) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\cs.pwn(492) : error 017: undefined symbol "index"
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\cs.pwn(492) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\cs.pwn(492) : fatal error 107: too many error messages on one line

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


4 Errors.



Re: Help with strtok - Abernethy - 04.12.2009

It is not mean't to be under a callback.


Re: Help with strtok - xLowrider - 04.12.2009

Aber, I send you a Private Message with my script . Is it okay if you could fix it


Re: Help with strtok - dice7 - 05.12.2009

Quote:
Originally Posted by Aber▲
It is not mean't to be under a callback.
And it is not meant to be #defined
The same with all custom functions