02.10.2015, 05:25
Hi
Still have troubles with the sqllite codes.. the problem is : it wont save houses when a player has bought them (with the players values).
Here is a piece of the code that the issue is in:
Let me explain: the first failstep shows values : Owner : "Hessu" and owned : 1 as it should, but
the second failstep looks like : owned : 0 and owner :
It somehow is not saving the new values in properly!
The strings, integers and floats are all at the right place in the update query.
If you find the issue or something, +rep for you.
Thanks.
Still have troubles with the sqllite codes.. the problem is : it wont save houses when a player has bought them (with the players values).
Here is a piece of the code that the issue is in:
pawn Code:
new string[256];
format(string, sizeof(string), "Failstep 1 : House owner : %s and house owned %d", AHouseData[HouseID][Owner], AHouseData[HouseID][Owned]);
print(string);
strcat(HouseStrCat, "UPDATE `Houses` SET `HouseAddress` = '%s', `HouseName` = '%s', `HouseX` = '%f', `HouseY` = '%f', `HouseZ` = '%f', `HouseInterior` = '%d', `HouseMaxSlots` = '%d', `HouseNewMaxSlots` = '%d', `HousePrice` = '%d', `Owned` = '%d', `HouseOpened` = '%d', ", sizeof(HouseStrCat)); // 11
strcat(HouseStrCat, "`PlayerIsTycoon` = '%d', `Owner` = '%s', `Insurance` = '%d' WHERE `HouseID` = '%d'", sizeof(HouseStrCat)); // 15
format(Query, sizeof(Query), HouseStrCat, AHouseData[HouseID][HouseAddress], AHouseData[HouseID][HouseName], AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ], AHouseData[HouseID][HouseInterior], AHouseData[HouseID][HouseMaxSlots], AHouseData[HouseID][HouseNewMaxSlots], AHouseData[HouseID][HousePrice], AHouseData[HouseID][Owned],
AHouseData[HouseID][HouseOpened], AHouseData[HouseID][PlayerIsTycoon], AHouseData[HouseID][Owner], AHouseData[HouseID][Insurance], HouseID); // 15
db_free_result(db_query(Database, Query));
strdel(HouseStrCat, 0, 800);
format(Query, sizeof(Query), "SELECT * FROM `Houses` WHERE `HouseID` = '%d'", HouseID);
Result2 = db_query(Database,Query);
new ParameterValue[50], ParameterValue2[50];
db_get_field_assoc(Result2, "Owned", ParameterValue, 50);
db_get_field_assoc(Result2, "Owner", ParameterValue, 50);
format(string, sizeof(string), "Failstep 1 : House owned : %d and house owner %s", ParameterValue, ParameterValue2);
print(string);
the second failstep looks like : owned : 0 and owner :
It somehow is not saving the new values in properly!
The strings, integers and floats are all at the right place in the update query.
If you find the issue or something, +rep for you.
Thanks.