09.01.2012, 19:09
hi this code causes error :
PHP код:
CMD:hcreate(playerid, params[])
{
new hname[50], price, Float:epos[3], Float:ipos[3], interior;
if(sscanf(params, "s[50]ia<f>[3]i", hname, price, ipos, interior)) return SendClientMessage(playerid, COLOR_ERROR, "Usage /hcreate [hname][price][iposx][iposy][iposz][interrior]");
GetPlayerPos(playerid, epos[0], epos[1], epos[2]);
new query[256],text3d[128];
format(query, sizeof(query), "INSERT INTO housedata (HouseName, Price, EnterPosX, EnterPosY, EnterPosZ, InteriorPosX, InteriorPosY, InteriorPosZ, Interior, VirtualWorld) VALUES ( '%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')", hname, price, epos[0], epos[1], epos[2], ipos[0], ipos[1], ipos[2], interior, gVWCount[0]);
mysql_query(query);
format(text3d, sizeof(text3d), "Prix : %d");
CreateDynamicPickup(1273, 1, epos[0], epos[1], epos[2]);
CreateDynamic3DTextLabel(text3d, COLOR_GREEN, epos[0], epos[1], epos[2]+0.6, 20);
return 1;
}
Код:
errorid: 1064 | error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 | resultid: -1 | extraid: -1 | callback: NULL | query: INSERT INTO housedata (HouseName, Price, EnterPosX, EnterPosY, EnterPosZ, InteriorPosX, InteriorPosY, InteriorPosZ, Interior, VirtualWorld) VALUES ( 'test', '20000', '2846.013427', '1278.831542', '23.455440', '123.123001', '123.311996', '1321.123046' [20:05:00]