11.01.2013, 16:28
Quote:
The problem is that when you use "s" as the last parameter, it gets the whole of the remainder of the string - sub-command AND parameters in one. Instead use "s[20] " - the trailing space is VERY important, it used to trick sscanf in to not thinking that "s" was the last parameter, without actually doing anything; it still does that, only now it is a handy and supported feature rather than a trick.
Or try this: pawn Код:
|
pawn Код:
if (!sscanf(params, "'create'I(-1)I(-1)", int, price))
{
if(PlayerInfo[playerid][pAdmin] < 4)
return 1;
if (sscanf(params, "ii",int,price))
return SendClientMessage(playerid,COLOR_CYAN,"[Usage] /createhouse [int] [price]");
new query[256];
new Float:p[3];
GetPlayerPos(playerid,p[0],p[1],p[2]);
//INSERT INTO `houses` (`ownerid`,`price`,`locked`,`int`,`vw`,`rent`,`entx`,`enty`,`entz`,`extx`,`exty`,`exyz`,`ownername`) VALUES ('9999','999999','0','1','1','1','12.77777777','12.77777777','12.77777777','12.77777777','12.77777777','12.77777777','None')
format(query,sizeof(query),"INSERT INTO `houses` (`ownerid`,`price`,`locked`,`int`,`vw`,`rent`,`entx`,`enty`,`entz`,`extx`,`exty`,`extz`,`ownername`) VALUES ('9999','%i','1','%i','%i',1,'%.1f','%.1f','%.1f','%.1f','%.1f','%.1f','None')",price,HInts[int],int*2,p[0],p[1],p[2],HouseInts[int][0],HouseInts[int][1],HouseInts[int][2],GetName(playerid));
mysql_query(query);
printf("query:",query);
SendFormat(playerid,COLOR_GREEN,"[House Creation] {FFFFFF}You have just created a new house (InteriorID: %i | Price: %i",int,price);
}