SA-MP Forums Archive
Command Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command Problem (/showthread.php?tid=416577)



Command Problem - Lady-Happy - 17.02.2013

It says SERVER: Unknown Command

When i try without cost and inter the sscanf responds.

Код:
if(IsStringSame(cmdtext,CHouseCommand))
	{
		if(!IsPlayerAdmin(playerid))
		{
			SendClientMessage(playerid,HCOLOR_ERROR,MSGAccess);
		}
		
		new string[256];
		new Cost;
		new Inter;
		
        if(sscanf(cmdtext,"dd",Cost,Inter))
	    {
            format(string,sizeof(string),"%s (Price) (Interior)",CHouseCommand);
            SendClientMessage(playerid,HCOLOR_ERROR,string);
		    return 1;
	    }
	    if(Cost < 0)
	    {
            SendClientMessage(playerid,HCOLOR_ERROR,MSGHPrice);
		    return 1;
	    }
	    if(Inter <= 0 || Inter > 10)
	    {
            SendClientMessage(playerid,HCOLOR_ERROR,MSGHInteriors);
		    return 1;
	    }
	    CreateHouse(playerid,Cost,Inter);
	    format(string,sizeof(string),"You have succerfully created a new house. Price: $%d. Interior: %d",Cost,Inter);
	    SendClientMessage(playerid,HCOLOR_WHITE,string);
		return 1;
    }