14.02.2013, 14:18
Made the system houses and met with the sad stuff.
Creating a home, they are created. When I make a restart, only loads one home.
Here is the code download:
What is wrong? Advice please.
P.S. Mysql R8(BlueG)
Sorry for my bad English(old phrase)
Creating a home, they are created. When I make a restart, only loads one home.
Here is the code download:
PHP код:
new query[128];
format(query, sizeof query, "SELECT * FROM `"TABLE_HOUSE"`");
mysql_function_query(connection, query, true, "LoadHouses", "");
PHP код:
forward LoadHouses();
public LoadHouses()
{
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
for (new id = 1; id < rows ; id ++)
{
hInfo[id][hID] = cache_get_field_int(0, "ID");
hInfo[id][hOwned] = cache_get_field_int(0, "Owned", connection);
cache_get_field_content(0, "Owner", hInfo[id][hOwner], connection, MAX_PLAYER_NAME);
hInfo[id][hPos][0] = cache_get_field_float(0, "X", connection);
hInfo[id][hPos][1] = cache_get_field_float(0, "Y", connection);
hInfo[id][hPos][2] = cache_get_field_float(0, "Z", connection);
hInfo[id][hInt] = cache_get_field_int(0, "Int", connection);
hInfo[id][hType] = cache_get_field_int(0, "Type", connection);
hInfo[id][hPrice] = cache_get_field_int(0, "Price", connection);
switch(hInfo[id][hOwned])
{
case 0:
{
hInfo[id][hPickup] = CreatePickup(1272, 23, hInfo[id][hPos][0], hInfo[id][hPos][1], hInfo[id][hPos][2], 0);
hInfo[id][hMapIcon] = CreateDynamicMapIcon(hInfo[id][hPos][0], hInfo[id][hPos][1], hInfo[id][hPos][2], 31, 1);
}
case 1:
{
hInfo[id][hPickup] = CreatePickup(1273, 23, hInfo[id][hPos][0], hInfo[id][hPos][1], hInfo[id][hPos][2], 0);
hInfo[id][hMapIcon] = CreateDynamicMapIcon(hInfo[id][hPos][0], hInfo[id][hPos][1], hInfo[id][hPos][2], 32, 1);
}
}
}
}
return 1;
}
P.S. Mysql R8(BlueG)
Sorry for my bad English(old phrase)