SA-MP Forums Archive
strtok problem - 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: strtok problem (/showthread.php?tid=190035)



strtok problem - DaneAMattie - 13.11.2010

hey i get

*\Properties.pwn(355) : error 017: undefined symbol "strtok"

when compiling

i know i need to add the function but i dont have it :/


Re: strtok problem - Retardedwolf - 13.11.2010

https://sampwiki.blast.hk/wiki/Strtok


Re: strtok problem - DaneAMattie - 13.11.2010

Thanks man, and sorry that i forgot to check wiki.samp :P


Respuesta: strtok problem - kirk - 13.11.2010

Easy one
Код:
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;
}