06.01.2019, 00:35
Problems with sscanf warning: Format specifier does not match parameter count.
CODE:
CMD:nnamas(playerid,params[])
{
new Float:kord[3];
GetPlayerPos(playerid,kord[0],kord[1],kord[2]);
new cost,lvl;
if(sscanf(params,"ii",cost,lvl)) return SendError(playerid,"/nhome [cost] [lvl]");
new query[105];
format(query,sizeof(query),"INSERT INTO home (x,y,z,cost,lvl) VALUES ('%f','%f','%f','%d','%d')",kord[0],kord[1],kord[2],cost,lvl);
mysql_query(query);
CreatePickup(19523,1,kord[0],kord[1],kord[2], -1);
return 1;
}
CODE:
CMD:nnamas(playerid,params[])
{
new Float:kord[3];
GetPlayerPos(playerid,kord[0],kord[1],kord[2]);
new cost,lvl;
if(sscanf(params,"ii",cost,lvl)) return SendError(playerid,"/nhome [cost] [lvl]");
new query[105];
format(query,sizeof(query),"INSERT INTO home (x,y,z,cost,lvl) VALUES ('%f','%f','%f','%d','%d')",kord[0],kord[1],kord[2],cost,lvl);
mysql_query(query);
CreatePickup(19523,1,kord[0],kord[1],kord[2], -1);
return 1;
}