MYSQL HOUSE PROBLEM
#1

when someone buys house it must do > SaveHouse and it`s saving but there is problem : all positions are the same on every house there is it look : http://i.imgur.com/7gQun6B.jpg

-----------------------------------------

Код:
stock SaveHouse(houseid)
{
	new string[900], str[150];
	format(str, sizeof(str), "UPDATE `Houses` SET");
	strcat(string, str);
	format(str, sizeof(str), "`Enter_X` = '%.4f',`Enter_Y` = '%.4f',`Enter_Z` = '%.4f', ",
	HouseInfo[houseid][hEnter_X],
	HouseInfo[houseid][hEnter_Y],
	HouseInfo[houseid][hEnter_Z]);
	strcat(string, str);

	format(str, sizeof(str), "`Exit_X` = '%.4f', `Exit_Y` = '%.4f', `Exit_Z` = '%.4f', ",
 	HouseInfo[houseid][hExit_X],
	HouseInfo[houseid][hExit_Y],
	HouseInfo[houseid][hExit_Z]);
	strcat(string, str);

	format(str, sizeof(str), "`Owner` = '%s', `Room_Owner_0` = '%s',`Room_Owner_1` = '%s', ",
	HouseInfo[houseid][hOwner],
	HRoomOwner[houseid][0],
	HRoomOwner[houseid][1]);
	strcat(string, str);

	format(str, sizeof(str), "`Room_Owner_2` = '%s', `Room_Owner_3` = '%s', `Room_Owner_4` = '%s', ",
	HRoomOwner[houseid][2],
	HRoomOwner[houseid][3],
	HRoomOwner[houseid][4]);
	strcat(string, str);

	format(str, sizeof(str), "`Level` = '%d', `Cost` = '%d', `Lock` = '%d', `Rent` = '%d', ",
	HouseInfo[houseid][hLevel],
	HouseInfo[houseid][hCost],
	HouseInfo[houseid][hLock],
	HouseInfo[houseid][hRent]);
	strcat(string, str);

	format(str, sizeof(str), "`Interior` = '%d', `Money` = '%d', `Drugs` = '%d', `Mats` = '%d', ",
	HouseInfo[houseid][hInt],
	HouseInfo[houseid][hMoney],
	HouseInfo[houseid][hDrugs],
	HouseInfo[houseid][hMats]);
	strcat(string, str);

	format(str, sizeof(str), "`Bar` = '%d', `Cabinet` = '%d', `Skin_1` = '%d', `Skin_2` = '%d', ",
	HouseInfo[houseid][hBar],
	HouseInfo[houseid][hCabinet],
	HouseInfo[houseid][hSkin][0],
	HouseInfo[houseid][hSkin][1]);
	strcat(string, str);

	format(str, sizeof(str), "`Skin_3` = '%d', `Skin_4` = '%d', `Skin_5` = '%d', `NoOwner` = '%d', ",
	HouseInfo[houseid][hSkin][2],
	HouseInfo[houseid][hSkin][3],
	HouseInfo[houseid][hSkin][4],
	HouseInfo[houseid][hNoOwner]);
	strcat(string, str);

	format(str, sizeof(str), "`hSlot0` = '%d', `hSlot1` = '%d', `hSlot2` = '%d', `hSlot3` = '%d', `hSlot4` = '%d', `hSlot5` = '%d', ",
	HouseInfo[houseid][hSlot][0],
	HouseInfo[houseid][hSlot][1],
	HouseInfo[houseid][hSlot][2],
	HouseInfo[houseid][hSlot][3],
    HouseInfo[houseid][hSlot][4],
    HouseInfo[houseid][hSlot][5]);
    strcat(string, str);
	
	format(str, sizeof(str), "`hSlot6` = '%d', `hSlot7` = '%d', `hSlot8` = '%d', `hSlot9` = '%d', WHERE `ID` = '%i'",
	HouseInfo[houseid][hSlot][6],
	HouseInfo[houseid][hSlot][7],
	HouseInfo[houseid][hSlot][8],
	HouseInfo[houseid][hSlot][9],
	houseid + 1);
	strcat(string, str);

	mysql_query(string);
	return true;
}
Reply
#2

Yeah so the problem isn't here but in initialization/creation of your houses.
Reply
#3

The saving system seems to be okay, but the coords aren't, Show us where do you declare/change the position to the correct one.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)