08.07.2018, 13:08
Made some changes
But the owner's name isn't even being inserted in the MySQL
Nor the HouseOwned value is being updated to 1..
Код:
CMD:buyhouse(playerid, params[]) { new hid, pqname[24], queryq[69], queryqq[96]; { if(sscanf(params, "i", hid)) { Error(playerid, "Invalid house ID."); } else if(hInfo[houseid][HouseOwned] == 1) { cache_get_field_content_int(hid, "HouseID", hInfo[houseid][HouseID]); Error(playerid, "This house is already owned by someone else"); } else GetPlayerName(playerid, pqname, 24); format(queryq, sizeof(queryq), "UPDATE `houses` SET `HouseOwned` = '1' WHERE `HouseID` = '%d' ", hInfo[houseid][HouseID]); format(queryqq, 96, "INSERT * INTO `houses` (`HouseOwner`) VALUES ('%s') WHERE `HouseID` = '%d'", pqname, hInfo[houseid][HouseID]); mysql_tquery(dbHandle, queryq); } return 1; }
Nor the HouseOwned value is being updated to 1..