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; }
CMD:gotopos(playerid,params[])
{
new Float:X,Float:Y,Float:Z;
if(sscanf(params,"fff",X,Y,Z)) return SendClientMessage(playerid,YOURCOLOR,"YOUR ERROR MESSAGE!!!");
{
SetPlayerPos(playerid,X,Y,Z);
}
return 1;
}
#include <sscanf2>
Here thats with SSCANF2
CMD:gotopos(playerid,params[]) { new Float:X,Float:Y,Float:Z; if(sscanf(params,"fff",X,Y,Z)) return SendClientMessage(playerid,YOURCOLOR,"YOUR ERROR MESSAGE!!!"); { SetPlayerPos(playerid,X,Y,Z); } return 1; } |
CMD:gotopos(playerid, params[])
{
new Float:x, Float:y, Float:z;
if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /gotopos x y z");
SetPlayerPos(playerid, x, y, z);
return 1;
}
if(sscanf(params,"fff",X,Y,Z)) return SendClientMessage(playerid,YOURCOLOR,"YOUR ERROR MESSAGE!!!");
{
SetPlayerPos(playerid,X,Y,Z);
}
CMD:gotopos(playerid, params[]) //This is how you DECLARE the start of a command in ZCMD.
{
new Float:x, Float:y, Float:z; //Declaring floats x, y and z here.
if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /gotopos x y z");
/*Okay. Now, sscanf detects 'parts' of text you input.
Like if you did, sscanf("hello 27","si",string,int) it would return *hello*
*27* It kind of splits it. So since you have not input any thing, if you sscanf it, there's nothing to split.
Hence, if(sscanf(params,"fff",x,y,z)) return error message. Here "fff" means "float float float" --> x, y, z. Meaning first float entered is given value of x and so on. */
SetPlayerPos(playerid, x, y, z); //Simple.
return 1;
}