25.01.2014, 12:57
Код:
stock LoadGarages() { mysql_tquery(sql_handle, "SELECT * FROM Garages", "OnGarageDataLoad", ""); } forward OnGarageDataLoad(); public OnGarageDataLoad() { for(new i=0, max = cache_get_row_count(); i < max; ++i) { Garages[i][EnterX] = cache_get_row_float(i, 1); Garages[i][EnterY] = cache_get_row_float(i, 2); Garages[i][EnterZ] = cache_get_row_float(i, 3); //.... cache_get_row(i, 10, Garages[i][Owner], sql_handle, MAX_PLAYER_NAME); Garages[i][Price] = cache_get_row_int(i, 11); //.... //if(Garages[i][Owned]... } printf("%d Garages loaded from database", cache_get_row_count()); return 1; }