23.04.2018, 20:57
(
Последний раз редактировалось seanny; 25.04.2018 в 13:35.
Причина: Solved
)
I'm having a problem where BlueG MySQL is only loading data from 1 row but it sees that there is 37 rows.
samp-server.exe:
Code:
samp-server.exe:
Код:
House rows = 37 House 1 ID = 1 * 1 houses were loaded from the database.
PHP код:
public OnGameModeInit()
{
....
mysql_tquery(g_SQL, "SELECT * FROM `houses`", "Query_LoadHouses");
....
}
public Query_LoadHouses()
{
new rows = cache_num_rows();
if(!rows)
return print("* No houses were loaded from the database.");
printf("House rows = %d", rows);
new countHouses = 0;
for(new i = 0; i < rows; i++)
{
cache_get_value_int(i, "ID", HouseInfo[i+1][HouseID]);
if(HouseInfo[i+1][HouseID])
{
printf("House %d ID = %d", i+1, HouseInfo[i+1][HouseID]);
cache_get_value_int(i, "OwnerID", HouseInfo[i+1][HouseOwnerID]);
cache_get_value_int(i, "MarketPrice", HouseInfo[i+1][HouseMarketPrice]);
cache_get_value_float(i, "ExteriorX", HouseInfo[i+1][HouseExteriorX]);
cache_get_value_float(i, "ExteriorY", HouseInfo[i+1][HouseExteriorY]);
cache_get_value_float(i, "ExteriorZ", HouseInfo[i+1][HouseExteriorZ]);
cache_get_value_float(i, "ExteriorA", HouseInfo[i+1][HouseExteriorA]);
cache_get_value_int(i, "ExteriorInt", HouseInfo[i+1][HouseExteriorInt]);
cache_get_value_int(i, "ExteriorVW", HouseInfo[i+1][HouseExteriorVW]);
cache_get_value_float(i, "InteriorX", HouseInfo[i+1][HouseInteriorX]);
cache_get_value_float(i, "InteriorY", HouseInfo[i+1][HouseInteriorY]);
cache_get_value_float(i, "InteriorZ", HouseInfo[i+1][HouseInteriorZ]);
cache_get_value_float(i, "InteriorA", HouseInfo[i+1][HouseInteriorA]);
cache_get_value_int(i, "InteriorInt", HouseInfo[i+1][HouseInteriorInt]);
cache_get_value_int(i, "Locked", HouseInfo[i+1][HouseLocked]);
cache_get_value_int(i, "CashBox", HouseInfo[i+1][HouseCashBox]);
// I rrly do not like this code, but having a loop made the compiler cry :(
cache_get_value_int(i, "Weapons0", HouseInfo[i+1][HouseWeapons][0]);
cache_get_value_int(i, "Weapons1", HouseInfo[i+1][HouseWeapons][1]);
cache_get_value_int(i, "Weapons2", HouseInfo[i+1][HouseWeapons][2]);
cache_get_value_int(i, "Weapons3", HouseInfo[i+1][HouseWeapons][3]);
cache_get_value_int(i, "Weapons4", HouseInfo[i+1][HouseWeapons][4]);
cache_get_value_int(i, "Weapons5", HouseInfo[i+1][HouseWeapons][5]);
cache_get_value_int(i, "Weapons6", HouseInfo[i+1][HouseWeapons][6]);
cache_get_value_int(i, "Weapons7", HouseInfo[i+1][HouseWeapons][7]);
cache_get_value_int(i, "Weapons8", HouseInfo[i+1][HouseWeapons][8]);
cache_get_value_int(i, "Weapons9", HouseInfo[i+1][HouseWeapons][9]);
cache_get_value_int(i, "Weapons10", HouseInfo[i+1][HouseWeapons][10]);
cache_get_value_int(i, "Weapons11", HouseInfo[i+1][HouseWeapons][11]);
cache_get_value_int(i, "Weapons12", HouseInfo[i+1][HouseWeapons][12]);
cache_get_value_int(i, "Weapons13", HouseInfo[i+1][HouseWeapons][13]);
cache_get_value_int(i, "Weapons14", HouseInfo[i+1][HouseWeapons][14]);
cache_get_value_int(i, "Weapons15", HouseInfo[i+1][HouseWeapons][15]);
cache_get_value_int(i, "Weapons16", HouseInfo[i+1][HouseWeapons][16]);
cache_get_value_int(i, "Weapons17", HouseInfo[i+1][HouseWeapons][17]);
cache_get_value_int(i, "Weapons18", HouseInfo[i+1][HouseWeapons][18]);
cache_get_value_int(i, "Weapons19", HouseInfo[i+1][HouseWeapons][19]);
cache_get_value_int(i, "Weapons20", HouseInfo[i+1][HouseWeapons][20]);
// I rrly do not like this code, but having a loop made the compiler cry :(
cache_get_value_int(i, "WeaponsAmmo0", HouseInfo[i+1][HouseWeaponsAmmo][0]);
cache_get_value_int(i, "WeaponsAmmo1", HouseInfo[i+1][HouseWeaponsAmmo][1]);
cache_get_value_int(i, "WeaponsAmmo2", HouseInfo[i+1][HouseWeaponsAmmo][2]);
cache_get_value_int(i, "WeaponsAmmo3", HouseInfo[i+1][HouseWeaponsAmmo][4]);
cache_get_value_int(i, "WeaponsAmmo5", HouseInfo[i+1][HouseWeaponsAmmo][5]);
cache_get_value_int(i, "WeaponsAmmo6", HouseInfo[i+1][HouseWeaponsAmmo][6]);
cache_get_value_int(i, "WeaponsAmmo7", HouseInfo[i+1][HouseWeaponsAmmo][7]);
cache_get_value_int(i, "WeaponsAmmo8", HouseInfo[i+1][HouseWeaponsAmmo][8]);
cache_get_value_int(i, "WeaponsAmmo9", HouseInfo[i+1][HouseWeaponsAmmo][9]);
cache_get_value_int(i, "WeaponsAmmo10", HouseInfo[i+1][HouseWeaponsAmmo][10]);
cache_get_value_int(i, "WeaponsAmmo11", HouseInfo[i+1][HouseWeaponsAmmo][11]);
cache_get_value_int(i, "WeaponsAmmo12", HouseInfo[i+1][HouseWeaponsAmmo][12]);
cache_get_value_int(i, "WeaponsAmmo13", HouseInfo[i+1][HouseWeaponsAmmo][13]);
cache_get_value_int(i, "WeaponsAmmo14", HouseInfo[i+1][HouseWeaponsAmmo][14]);
cache_get_value_int(i, "WeaponsAmmo15", HouseInfo[i+1][HouseWeaponsAmmo][15]);
cache_get_value_int(i, "WeaponsAmmo16", HouseInfo[i+1][HouseWeaponsAmmo][16]);
cache_get_value_int(i, "WeaponsAmmo17", HouseInfo[i+1][HouseWeaponsAmmo][17]);
cache_get_value_int(i, "WeaponsAmmo18", HouseInfo[i+1][HouseWeaponsAmmo][18]);
cache_get_value_int(i, "WeaponsAmmo19", HouseInfo[i+1][HouseWeaponsAmmo][19]);
cache_get_value_int(i, "WeaponsAmmo20", HouseInfo[i+1][HouseWeaponsAmmo][20]);
cache_get_value_float(i, "PlacePosX", HouseInfo[i+1][HousePlacePosX]);
cache_get_value_float(i, "PlacePosY", HouseInfo[i+1][HousePlacePosY]);
cache_get_value_float(i, "PlacePosZ", HouseInfo[i+1][HousePlacePosZ]);
cache_get_value_int(i, "Boombox", HouseInfo[i+1][HouseBoombox]);
cache_get_value_int(i, "RentFee", HouseInfo[i+1][HouseRentFee]);
cache_get_value_int(i, "Rentable", HouseInfo[i+1][HouseRentable]);
new query[128];
mysql_format(g_SQL, query, sizeof query, "SELECT * FROM furniture WHERE HouseID = %d", HouseInfo[i+1][HouseID]);
mysql_tquery(g_SQL, query, "OnLoadFurniture", "d", i);
if(HouseInfo[i+1][HouseLocked] == 0)
HouseInfo[i+1][HouseLocked] = 1;
UpdateHousePickup(i+1);
countHouses++;
}
}
printf("* %d houses were loaded from the database.", countHouses);
return 1;
}
Код:
[22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877) [22:09:01] [ERROR] cache_get_value_name_int: no active cache (./Source/Properties/House.pwn:877)