25.03.2014, 19:47
You need cache and no arguments since you select all of them and use a loop later.
pawn Код:
stock LoadHouses()
{
mysql_function_query(MySQLConnection, "SELECT * FROM houses", true, "OnHousesLoad", "");
}
forward OnHousesLoad();
public OnHousesLoad()
{
new irows, ifields; // better as local
cache_get_data(irows, ifields);
for(new i = 0; i < rows; i++)
{
HouseInfo[i][HouseID] = cache_get_row_int(i, 0, MySQLConnection);
cache_get_row(i, 1, HouseInfo[i][Owner], MySQLConnection, 24);
HouseInfo[i][HouseEX] = cache_get_row_float(i, 2, MySQLConnection);
HouseInfo[i][HouseEY] = cache_get_row_float(i, 3, MySQLConnection);
HouseInfo[i][HouseEZ] = cache_get_row_float(i, 4, MySQLConnection);
HouseInfo[i][HouseIX] = cache_get_row_float(i, 5, MySQLConnection);
HouseInfo[i][HouseIY] = cache_get_row_float(i, 6, MySQLConnection);
HouseInfo[i][HouseIZ] = cache_get_row_float(i, 7, MySQLConnection);
HouseInfo[i][Weed] = cache_get_row_int(i, 8, MySQLConnection);
HouseInfo[i][Money] = cache_get_row_int(i, 9, MySQLConnection);
HouseInfo[i][Locked] = cache_get_row_int(i, 10, MySQLConnection);
HouseInfo[i][Price] = cache_get_row_int(i, 11, MySQLConnection);
HouseInfo[i][Interior] = cache_get_row_int(i, 12, MySQLConnection);
}
}