A little params problem
#1

i got a little problem. Acctully i could make it alot of different way, but now i have found this, i will try this.
But i got some problems. I cant get strtok to work. How can i get it to work.
errors and warnings
Quote:

C:\Users\Frederik Vester\Desktop\Samp game fs\try.pwn(225) : error 035: argument type mismatch (argument 1)//this is the error line
C:\Users\Frederik Vester\Desktop\Samp game fs\try.pwn(225) : warning 213: tag mismatch
C:\Users\Frederik Vester\Desktop\Samp game fs\try.pwn(226) : error 035: argument type mismatch (argument 1)//this is the error line
C:\Users\Frederik Vester\Desktop\Samp game fs\try.pwn(226) : warning 213: tag mismatch
C:\Users\Frederik Vester\Desktop\Samp game fs\try.pwn(227) : error 035: argument type mismatch (argument 1)//this is the error line
C:\Users\Frederik Vester\Desktop\Samp game fs\try.pwn(227) : warning 213: tag mismatch
C:\Users\Frederik Vester\Desktop\Samp game fs\try.pwn(228) : error 035: argument type mismatch (argument 2)//this is the error line
C:\Users\Frederik Vester\Desktop\Samp game fs\try.pwn(224) : warning 203: symbol is never used: "index"

And this is the script.
Код:
CMD:gotopos(playerid, params)
{
	new Float:x[128],Float:y[128],Float:z[128];
	new index;
	x = strtok(params, index);
	y = strtok(params, index);
	z = strtok(params, index);
	SetPlayerPos(playerid, x, y, z);
	return 1;
}

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;
}
Reply


Messages In This Thread
A little params problem - by Frede - 13.01.2013, 07:25
AW: A little params problem - by BiosMarcel - 13.01.2013, 07:34
Re: A little params problem - by Threshold - 13.01.2013, 07:34
AW: A little params problem - by BiosMarcel - 13.01.2013, 07:37
Re: A little params problem - by Frede - 13.01.2013, 07:38
AW: A little params problem - by BiosMarcel - 13.01.2013, 07:41
Re: AW: A little params problem - by Threshold - 13.01.2013, 07:41
Re: A little params problem - by RajatPawar - 13.01.2013, 07:42
Re: A little params problem - by Frede - 13.01.2013, 07:42
AW: A little params problem - by BiosMarcel - 13.01.2013, 07:44

Forum Jump:


Users browsing this thread: 1 Guest(s)