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=111821)



Help with strtok - xLowrider - 04.12.2009

Код:
C:\Documents and Settings\Jack\Desktop\paintball\Counter Strike Source ™\gamemodes\cs.pwn(494) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Jack\Desktop\paintball\Counter Strike Source ™\gamemodes\cs.pwn(494) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Jack\Desktop\paintball\Counter Strike Source ™\gamemodes\cs.pwn(494) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Jack\Desktop\paintball\Counter Strike Source ™\gamemodes\cs.pwn(494) : 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 on line 494 it's this..
Код:
strtok(const string[], &index)



Re: Help with strtok - Abernethy - 04.12.2009

Post the whole callback above it.


Re: Help with strtok - xLowrider - 04.12.2009

This?
Код:
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;
}



Re: Help with strtok - Abernethy - 04.12.2009

Quote:
Originally Posted by xLowrider
This?
Код:
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;
}
Above it.


Re: Help with strtok - xLowrider - 04.12.2009

Sorry for the retardation, I'm forgot what the Callbacks are Are they the Defines/Forwards/news?


Re: Help with strtok - Correlli - 04.12.2009

Quote:
Originally Posted by xLowrider
Sorry for the retardation, I'm forgot what the Callbacks are Are they the Defines/Forwards/news?
http://en.wikipedia.org/wiki/Callbac...puter_science)


Re: Help with strtok - xLowrider - 04.12.2009

Forget it. I'll figre it out myself....


Re: Help with strtok - Abernethy - 04.12.2009

Quote:
Originally Posted by xLowrider
Forget it. I'll figre it out myself....
Basically. When something is called, it's a callback. public OnPlayerConnect is a callback, called when a player connects. So whatever the public/stock is above it. Post it.


Re: Help with strtok - xLowrider - 04.12.2009

Ohh, Nothing is above it, Is there meant to be?


Re: Help with strtok - Abernethy - 04.12.2009

Quote:
Originally Posted by xLowrider
Ohh, Nothing is above it, Is there meant to be?
huh
Mind posting your script... ?