SA-MP Forums Archive
eSelection & Strtok includes... - 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: eSelection & Strtok includes... (/showthread.php?tid=613499)



eSelection & Strtok includes... - Louwwieee42 - 28.07.2016

Hi SAMP Community,

I'm looking for both the "eSelection" and "strtok" includes and I am having troubble finding them, just wondering if you would be able to shed any light.

Regards: Louwwieee42


Re: eSelection & Strtok includes... - Gforcez - 28.07.2016

for strtok:

Код:
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;
}
https://sampwiki.blast.hk/wiki/Strtok


Re: eSelection & Strtok includes... - Louwwieee42 - 28.07.2016

Quote:
Originally Posted by Gforcez1337
Посмотреть сообщение
for strtok:

Код:
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;
}
https://sampwiki.blast.hk/wiki/Strtok
Thankyou, so that just goes into a .inc file? Correct?


Re: eSelection & Strtok includes... - Stinged - 28.07.2016

Delete the includr line and just add that to your script.