C0mBat1ve
Ученик
В OnGameModeInit четко прописано:
Но.
Вот эта самая функция НЕ СРАБАТЫВАЕТ, даже принт не появляется, я не знаю в чем проблема.
PHP:
mysql_function_query(handle,"SELECT * FROM `houses`",true,"LoadHouses","");
PHP:
public LoadHouses() // Коллбэк загрузки
{
new string[128];
new rows,fields;
printf("Дома загружаются...");
cache_get_data(rows,fields);
if(rows)
{
for(new idx = 0; idx <= rows; idx++)
{
HouseInfo[idx][ID] = cache_get_field_content_int(idx-1,"ID");
cache_get_field_content(idx-1,"Owner",HouseInfo[idx][Owner]);
HouseInfo[idx][Owned] = cache_get_field_content_int(idx-1,"Owned");
HouseInfo[idx][Price] = cache_get_field_content_int(idx-1,"Price");
HouseInfo[idx][Posx] = cache_get_field_content_float(idx-1,"Posx");
HouseInfo[idx][Posy] = cache_get_field_content_float(idx-1,"Posy");
HouseInfo[idx][Posz] = cache_get_field_content_float(idx-1,"Posz");
HouseInfo[idx][Int] = cache_get_field_content_int(idx-1,"Int");
HouseInfo[idx][Enterx] = cache_get_field_content_float(idx-1,"Enterx");
HouseInfo[idx][Entery] = cache_get_field_content_float(idx-1,"Entery");
HouseInfo[idx][Enterz] = cache_get_field_content_float(idx-1,"Enterz");
HouseInfo[idx][Rooms] = cache_get_field_content_int(idx-1,"Rooms");
HouseInfo[idx][Lock] = cache_get_field_content_int(idx-1,"Lock");
TOTALHOUSES++;
if(HouseInfo[idx][Owned] == 0)
{
CreatePickup(1273, 2, HouseInfo[idx][Posx], HouseInfo[idx][Posy], HouseInfo[idx][Posz],-1);
CreateDynamicMapIcon(HouseInfo[idx][Posx], HouseInfo[idx][Posy], HouseInfo[idx][Posz], 31, COLOR_WHITE, 0, -1, -1, 200.0);
format(string,256,"Номер дома: %i\nЦена: %i долларов\nКомнат: %d",idx,HouseInfo[idx][Price] / 100,HouseInfo[idx][Rooms]);
Create3DTextLabel(string,COLOR_YELLOW,HouseInfo[idx][Posx], HouseInfo[idx][Posy], HouseInfo[idx][Posz],20.0,0,1);
}
else
{
CreatePickup(1272, 2, HouseInfo[idx][Posx], HouseInfo[idx][Posy], HouseInfo[idx][Posz],-1);
CreateDynamicMapIcon(HouseInfo[idx][Posx], HouseInfo[idx][Posy], HouseInfo[idx][Posz], 32, COLOR_WHITE, 0, -1, -1, 200.0);
format(string,256,"Номер дома: %i\nВладелец: %s\nКласс: %s",idx,HouseInfo[idx][Owner],HouseInfo[idx][Rooms]);
Create3DTextLabel(string,COLOR_LIGHTRED,HouseInfo[idx][Posx], HouseInfo[idx][Posy], HouseInfo[idx][Posz],20.0,0,1);
}
}
}
return 1;
}
