02.07.2012, 19:41
(
Последний раз редактировалось ryansheilds; 03.07.2012 в 02:04.
Причина: Fixed
)
I have a problem and the houses don't save, the table is set up correctly and everything seems to work except they dont save...
Saving code:
Console output:
Why doesn't it save? :3
Fixed.
Saving code:
pawn Код:
stock SaveHouse(houseid)
{
new szQuery[2048];
format(szQuery, sizeof(szQuery), "UPDATE `houses` SET `Owned` = %d, `Level` = %d, `HInteriorWorld` = %d, `Description` = '%s', `Owner` = '%s'", HouseStat[houseid][hOwned], HouseStat[houseid][hLevel], HouseStat[houseid][hHInteriorWorld], HouseStat[houseid][hDescription], HouseStat[houseid][hOwner]);
format(szQuery, sizeof(szQuery), "%s, `ExteriorX` = %f, `ExteriorY` = %f, `ExteriorZ` = %f, `ExteriorR` = %f", szQuery, HouseStat[houseid][hExteriorX], HouseStat[houseid][hExteriorY], HouseStat[houseid][hExteriorZ], HouseStat[houseid][hExteriorR]);
format(szQuery, sizeof(szQuery), "%s, `InteriorX` = %f, `InteriorY` = %f, `InteriorZ` = %f, `InteriorR` = %f", szQuery, HouseStat[houseid][hInteriorX], HouseStat[houseid][hInteriorY], HouseStat[houseid][hInteriorZ], HouseStat[houseid][hInteriorR]);
format(szQuery, sizeof(szQuery), "%s, `Lock` = %d, `Rentable` = %d, `RentFee` = %d, `Value` = %d, `SafeMoney` = %d, `Pot` = %d, `Crack` = %d", szQuery, HouseStat[houseid][hLock], HouseStat[houseid][hRentable], HouseStat[houseid][hRentFee], HouseStat[houseid][hValue], HouseStat[houseid][hSafeMoney], HouseStat[houseid][hPot], HouseStat[houseid][hCrack]);
format(szQuery, sizeof(szQuery), "%s, `Materials` = %d, `Weapons0` = %d, `Weapons1` = %d, `Weapons2` = %d, `Weapons3` = %d, `Weapons4` = %d", szQuery, HouseStat[houseid][hMaterials], HouseStat[houseid][hWeapons][0], HouseStat[houseid][hWeapons][1], HouseStat[houseid][hWeapons][2], HouseStat[houseid][hWeapons][3], HouseStat[houseid][hWeapons][4]);
format(szQuery, sizeof(szQuery), "%s, `GLUpgrade` = %d, `CustomInterior` = %d, `CustomExterior` = %d, `ExteriorA` = %f, `InteriorA` = %f", szQuery, HouseStat[houseid][hGLUpgrade], HouseStat[houseid][hCustomInterior], HouseStat[houseid][hCustomExterior], HouseStat[houseid][hExteriorA], HouseStat[houseid][hInteriorA]);
format(szQuery, sizeof(szQuery), "%s WHERE `id` = %d", szQuery, houseid+1);
mysql_query(szQuery, THREAD_NO_RESULT, houseid, iConnectionHandle);
}
Quote:
[23:28:15] (MySQL) Query: UPDATE `houses` SET `Owned` = 1, `Level` = 0, `HInteriorWorld` = 12, `Description` = '', `Owner` = 'Ryan_Sheilds', `ExteriorX` = 1122.718994, `ExteriorY` = -2037.284179, `ExteriorZ` = 69.894233, `ExteriorR` = 0.000000, `InteriorX` = 442.994812, `InteriorY` = 509.687561, `InteriorZ` = 1001.419494, `InteriorR` = 0.000000, `Lock` = 0, `Rentable` = 0, `RentFee` = 0, `Value` = 0, `SafeMoney` = 0, `Pot` = 0, `Crack` = 0, `Materials` = 0, `Weapons0` = 0, `Weapons1` = 0, `Weapons2` = 0, `Weapons3` = 0, `Weapons4` = 0, `GLUpgrade` = 0, `CustomInterior` = 0, `CustomExterior` = 0, `ExteriorA` = 270.623504, `InteriorA` = 279.106933 WHERE `id` = 1 | ResultID: 4 |
Fixed.