02.03.2018, 18:43
That.. i will never do something like this when i'll want to load something, but that's the way i will do it, that's the way i already do so here is:
PHP код:
forward LoadHousesCb( );
public LoadHousesCb( )
{
new rows;
cache_get_row_count( rows );
if( rows )
{
new id, houses;
while( houses < rows )
{
cache_get_value_int( houses, "ID", id );
House[ id ][ HouseID ] = id;
cache_get_value_name( houses, "HouseOwner", House[ id ][ HouseOwner ], .max_len = 48 );
cache_get_value_int( houses, "HousePrice", House[ id ][ HousePrice ] );
cache_get_value_int( houses, "HouseInterior", House[ id ][ HouseInterior ] );
cache_get_value_int( houses, "isLocked", House[ id ][ isLocked ] );
cache_get_value_int( houses, "HouseLevel", House[ id ][ HouseLevel ] );
cache_get_value_int( houses, "HouseStatus", House[ id ][ HouseStatus ] );
cache_get_value_float( houses, "HouseEntranceX", House[ id ][ HouseEntranceX ] );
cache_get_value_float( houses, "HouseEntranceY", House[ id ][ HouseEntranceY ] );
cache_get_value_float( houses, "HouseEntranceZ", House[ id ][ HouseEntranceZ ] );
houses ++;
}
printf( "Loaded %d houses.", houses );
}
return 1;
}