SSCANF check within SSCANF check
#1

Using a previous thread of mine I tried to integrate the same method into a different command, right now I've got this:


Код:
CMD:editservercar(playerid,params[])
{
	SendCMD(playerid, params);
	if(pData[playerid][pAdmin] >= 2)
	{
		if(!IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid, "You must be inside of a vehicle to do this.");
		new section[20];
		if(sscanf(params, "s[20]", section))
		{
			SendUsageMessage(playerid, "/editservercar [section]");
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sections:{FFFFFF} Position | Faction | Job | Color1 | Color2 | Siren");
			return 1;
		}
		else
		{
			if(strmatch(section, "position"))
			{
				... code here that works that doesnt have a 2nd SSCANF in it
			}
			else if(strmatch(section, "faction"))
			{
				new factionid;
				if(sscanf(params, "s[20]i", section, factionid)) return SendUsageMessage(playerid, "/editservercar faction [factionid] (0-19)");
				SendClientMessage(playerid, COLOR_LIMEGREEN, "debug 2nd sscanf");
			}
Using a little bit of debugging I get this:

(SendCMD simply shows the full cmd typed)



What am I doing wrong?
Reply


Messages In This Thread
SSCANF check within SSCANF check - by JaydenJason - 18.01.2017, 11:58
Re: SSCANF check within SSCANF check - by Lordzy - 18.01.2017, 13:33
Re: SSCANF check within SSCANF check - by JaydenJason - 18.01.2017, 14:04

Forum Jump:


Users browsing this thread: 1 Guest(s)