16.10.2014, 22:39
(
Последний раз редактировалось jeffery30162; 25.10.2014 в 21:20.
)
I am switching my houses to mysql from ini file storage thing.
I currently have 2 houses stored into the database and when the server restarts and loads the houses, only the first house loads not any others.
Please help me
here is my load feature:
I currently have 2 houses stored into the database and when the server restarts and loads the houses, only the first house loads not any others.
Please help me
here is my load feature:
Код:
stock LoadHouse()
{
new idx = 1;
while(idx < MAX_HOUSE)
{
new query[500];
mysql_format(MySQLCon, query, sizeof(query), "SELECT * FROM `houses` WHERE `ID` = '%d'", idx);
mysql_query(MySQLCon, query);
HouseInfo[idx][hStatus] = cache_get_field_content_int(0, "Status");
HouseInfo[idx][hType] = cache_get_field_content_int(0, "Type");
HouseInfo[idx][hOwner]= cache_get_field_content(0, "Owner");
HouseInfo[idx][hX] = cache_get_field_content_float(0, "X");
HouseInfo[idx][hY] = cache_get_field_content_float(0, "Y");
HouseInfo[idx][hZ] = cache_get_field_content_float(0, "Z");
HouseInfo[idx][hMoney] = cache_get_field_content_int(0, "Money");
HouseInfo[idx][hLevel] = cache_get_field_content_int(0, "Level");
HouseInfo[idx][hPrice] = cache_get_field_content_int(0, "Price");
HouseInfo[idx][hXp] = cache_get_field_content_int(0, "XP");
HouseInfo[idx][hTrashX] = cache_get_field_content_float(0, "TrashX");
HouseInfo[idx][hTrashY] = cache_get_field_content_float(0, "TrashY");
HouseInfo[idx][hTrashZ] = cache_get_field_content_float(0, "TrashZ");
HouseInfo[idx][hRemovalYear] = cache_get_field_content_int(0, "RemovalYear");
HouseInfo[idx][hRemovalDay] = cache_get_field_content_int(0, "RemovalDay");
HouseInfo[idx][hLockStatus] = cache_get_field_content_int(0, "LockStatus");
idx++;
}
print("Houses loaded successfully.");
return 1;
}


