06.06.2014, 00:02
(
Последний раз редактировалось Type-R; 09.06.2014 в 17:20.
)
Hey guys, well i have this house system for my freeroam server, and everything works fine, except for when i change the house interior(IN-GAME) with a dialog, the change of price, nor the ID of the interior do not save for some odd reason. The price of the house will save to 0, and interior always stays at 1.
heres a part of the script at the dialog:
Heres the error line:
So the house is created to interior 1, and i try to change it to 2, it wont change. The prices becomes 0... Anyone know how to fix this? Thank you.
heres a part of the script at the dialog:
pawn Код:
if(dialogid == CInt)
{
new lString[256];
new hID = pInfo[playerid][CurrentHID];
// new hID = pInfo[playerid][CurrentHID]
//new hID = smasina[playerid];
if(!response)
{
ShowPlayerDialog(playerid, HMenu, DIALOG_STYLE_LIST, "House Menu", "(UN)Lock House\nChange Interior\nSell House\n", "Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 5000000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this interior!");
if(HouseInfo[hID][InteriorID] == 1) return SendClientMessage(playerid, COLOR_RED, "The current house interior is already the same!");
HouseInfo[hID][InteriorID] = 1;
HouseInfo[hID][Price] = 5000000;
format(gQuery, 256, "UPDATE `"Houses_Table"` SET `Price` = '%i', 'InteriorID' = '%i' WHERE `ID` = '%i'",HouseInfo[hID][Price], HouseInfo[hID][InteriorID], hID);
mysql_query(gQuery);
SendClientMessage(playerid, COLOR_GREEN, "Interior changed. Please re-enter your house!");
format(lString, sizeof(lString),"Namo Savininkas: %s\nNamo kaina: $%i\nNamas uzrakintas: %s", HouseInfo[hID][Owner], HouseInfo[hID][Price], (HouseInfo[hID][Locked] == 1) ? ("Taip") : ("Ne"));
UpdateDynamic3DTextLabelText(Text3D:HouseInfo[hID][Label], COLOR_RED, lString);
DestroyDynamicPickup(HouseInfo[hID][ExitPickup]);
SetHouseExit(playerid, hID);
KickFromHouse(playerid, hID);
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 4000000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this interior!");
if(HouseInfo[hID][InteriorID] == 2) return SendClientMessage(playerid, COLOR_RED, "The current house interior is already the same!");
HouseInfo[hID][InteriorID] = 2;
HouseInfo[hID][Price] = 4000000;
format(gQuery, 256, "UPDATE `"Houses_Table"` SET `Price` = '%i', 'InteriorID' = '%i' WHERE `ID` = '%i'",HouseInfo[hID][Price], HouseInfo[hID][InteriorID], hID);
mysql_query(gQuery);
SendClientMessage(playerid, COLOR_GREEN, "Interior changed. Please re-enter your house!");
format(lString, sizeof(lString),"Namo Savininkas: %s\nNamo kaina: $%i\nNamas uzrakintas: %s", HouseInfo[hID][Owner], HouseInfo[hID][Price], (HouseInfo[hID][Locked] == 1) ? ("Taip") : ("Ne"));
UpdateDynamic3DTextLabelText(Text3D:HouseInfo[hID][Label], COLOR_RED, lString);
DestroyDynamicPickup(HouseInfo[hID][ExitPickup]);
SetHouseExit(playerid, hID);
KickFromHouse(playerid, hID);
}
Код:
CMySQLHandler::Query(UPDATE `Houses` SET `Price` = 4000000, 'InteriorID ' = 2 WHERE `ID` = 5) - An error has occured. (Error ID: 1064, 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 ''InteriorID ' = 2 WHERE `ID` = 5' at line 1)

