13.01.2013, 07:42
Explanation: (Btw, BIOS, you can turn off your caps.)
This is how I understood sscanf, I don't know if the original explanation differs.
pawn Код:
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;
}