sscanf help
#1

so i will show my code then exsplain it.
Код:
dcmd_set(playerid, params[])
{
  new id;
  new float:x,float:y,float:z,float:temp;
	new strig[256];
	new cmd[256];
	if(dUserINT(PlayerName(playerid)).("accesslevel") >=2)
 	{
 	  format(strig, sizeof(strig),"1: %s", params);
		SystemMsg(playerid, strig);
		
	  if(sscanf(params, "iz", id, params)) return SystemMsg(playerid, "USAGE: /set <object> <args>");
	  else
	  {
	    format(strig, sizeof(strig),"2:%s", params);
			SystemMsg(playerid, strig);
			
	    if(sscanf(params, "sfz", cmd, temp, params)) return SystemMsg(playerid, "USAGE: /set <object> <args>");
	  	else
	  	{
				
				format(strig, sizeof(strig),"%i - %s - %f - %s" , id, cmd, temp, params);
				return SystemMsg(playerid, strig);
			}

		}
	}
	else
	{
	
	  return SystemMsg(playerid, "You do not have access to this command.");
 	}
}

so say my command is /set 1 the first sscanf retures "" as the params. but when i do /set 1 1 it will return "1" so i added a second sscanf so my command line is like /set 1 x 1 and the second one returns "x 1" as params shouldnt it remove it? and return "" ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)