07.07.2013, 20:03
Ok,i kind of sorted it out but now:
The problem is in the marked line,the ID code from the line above saves fine but the code under does not save the values.
Код:
stock CreatePlayerHouse(playerid, sellprice, HouseLvl)
{
new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
new ID, Query[256];
format(Query, sizeof(Query), "SELECT COUNT * FROM `HOUSES`");
ID = 1 + db_query(Database, Query);
new string[128];
format(string, sizeof (string), "ID = %i", ID);
printf(string);
format(Query, sizeof(Query), "INSERT INTO `HOUSES` ('ID') VALUES('%d')", ID);
db_query(Database, Query);
------> format(Query, sizeof(Query), "UPDATE `HOUSES` SET NAME = 'Grad', FOR_SELL = '1', SELL_PRICE = '%d', RENTPRICE = '1000', HOUSE_LEVEL = '%d', X = '%f', Y = '%f', Z = '%f' WHERE `ID` = '%d' ", sellprice, HouseLvl, X, Y, Z, ID);
db_query(Database, Query);
SendClientMessage(playerid, COLOR_WHITE, ".:: [HOUSE]: House has been Successfully created.");
//LoadPlayerHouse(ID);
return true;
}

