13.01.2013, 07:25
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
And this is the script.
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" |
Код:
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;
}



In my Script it works...