06.01.2018, 11:05
Where is cache_num_rows coming from in OnGameModeInit()?
An example of a proper loading:
An example of a proper loading:
PHP код:
public OnGameModeInit(){
mysql_tquery(DB, "SELECT * FROM `houses` ORDER BY `dbid` ASC", "Thread_LoadHouses");
return 1;
}
Thread_LoadHouses(); public Thread_LoadHouses()
{
if (!cache_num_rows()) {
return 1;
}
for (new i = 1, j = 0; j < cache_num_rows(); i++, j++) {
cache_get_value_float(j, "HousePosX", Houses[i][HousePos][0]);
cache_get_value_float(j, "HousePosY", Houses[i][HousePos][1]);
cache_get_value_float(j, "HousePosZ", Houses[i][HousePos][2]);
}
return 1;
}