Help with strtok
#1

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
Reply
#2

Dids You Define it? #define strtok
Reply
#3

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.
Reply
#4

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)