15.04.2016, 15:49
It takes so much because you load 660 times the already loaded data. Do not use loop, the query itself selects ALL the data from the table.
EDIT: That's how it should be assuming hID is set to AUTO_INCREMENT.
EDIT: That's how it should be assuming hID is set to AUTO_INCREMENT.
pawn Код:
mysql_tquery(server, "SELECT * FROM houses", "LoadHouses","");
pawn Код:
forward LoadHouses();
public LoadHouses()
{
new rows = clamp(cache_get_row_count(server), 0, sizeof House - 1);
for(new b; b != rows; ++b)
{
House[b][hID] = cache_get_row_int(b, 0);
House[b][hEnterX] = cache_get_row_float(b, 1);
House[b][hEnterY] = cache_get_row_float(b, 2);
House[b][hEnterZ] = cache_get_row_float(b, 3);
House[b][hExitX] = cache_get_row_float(b, 4);
House[b][hExitY] = cache_get_row_float(b, 5);
House[b][hExitZ] = cache_get_row_float(b, 6);
House[b][hCarX] = cache_get_row_float(b, 7);
House[b][hCarY] = cache_get_row_float(b, 8);
House[b][hCarZ] = cache_get_row_float(b, 9);
House[b][hCarZ] = cache_get_row_float(b, 10);
cache_get_row(b, 11, House[b][hOwner]);
House[b][hCost] = cache_get_row_int(b, 12);
House[b][hInt] = cache_get_row_int(b, 13);
House[b][hVW] = cache_get_row_int(b, 14);
House[b][hLock] = cache_get_row_int(b, 15);
House[b][hKlass] = cache_get_row_int(b, 16);
}
}