16.08.2010, 00:25
Hi, I am trying to create a house system function, but I am having a trouble when I add a house under OnGmInIt.
This is my error...
Please help Heh.
pawn Код:
public AddHouse(HID, Float:EntX, Float:EntY, Float:EntZ, Float:IntX, Float:IntY, Float:IntZ, IntID, VW, HPrice)
{
new
str[1012]
;
if(HID >= MAX_HOUSES) return 0;
format(str, sizeof(str), "SELECT * FROM `houseinfo` WHERE `HouseID` = %d", HID);
mysql_query(str);
mysql_store_result();
if(mysql_num_rows() > 0) return 0;
mysql_free_result();
format(str, sizeof(str), "INSERT INTO `houseinfo` (HouseID, Owner, EnterX, EnterY, EnterZ, InteriorX, InteriorY, InteriorZ, InteriorID, VWorld, Price) VALUES (%d, The State, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %d, %d)", HID, EntX, EntY, EntZ, IntX, IntY, IntZ, IntID, VW, HPrice);
mysql_query(str);
return 1;
}
Код:
[Sun Aug 15 13:04:24 2010] Function: mysql_query executed: "INSERT INTO `houseinfo` (HouseID, Owner, EnterX, EnterY, EnterZ, InteriorX, InteriorY, InteriorZ, InteriorID, VWorld, Price) VALUES (1, The State, 1231.30, 2323.00, 2322.19, 2322.00, 564.00, 321.20, 1, 1, 50000)" with result: "1". [Sun Aug 15 13:04:24 2010] Error (0): Failed to exeute query. 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 'State, 1231.30, 2323.00, 2322.19, 2322.00, 564.00, 321.20, 1, 1, 50000)' at line 1.



and thanks!