SA-MP Forums Archive
strtok Errors, Need help! - 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 Errors, Need help! (/showthread.php?tid=225550)



strtok Errors, Need help! - Master_Gangster - 13.02.2011

Код:
C:\Users\owner\Desktop\Raven's Roleplay 0.3c\gamemodes\larp.pwn(26365) : error 010: invalid function or declaration
Код:
C:\Users\owner\Desktop\Raven's Roleplay 0.3c\gamemodes\larp.pwn(26370) : error 022: must be lvalue (non-constant)
Код:
C:\Users\owner\Desktop\Raven's Roleplay 0.3c\gamemodes\larp.pwn(26378) : error 022: must be lvalue (non-constant)
here is the code that is giving off those errors...

Код:
strtok(const string[], &index) // Line 26365
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++; // Line 26370
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++; // Line 26378
	}
	result[index - offset] = EOS;
	return result;
}
I have tried to fix it but I don't know what the hell I'm doing so I need you guy's help since I have never encountered this problem before.


Re : strtok Errors, Need help! - uldissUP - 18.04.2011

Me to i got the same problem heh ANY ONE HELP!!