C0mBat1ve
Ученик
Проблема в том, что когда я наступаю на пикап дома - ничего не происходит!
Вот загрузка домов:
А вот то, что в OnPlayerPickUpPickup
Вот загрузка домов:
PHP:
forward LoadHouses();
public LoadHouses()
{
printf("Houses loading...");
new rows,fields;
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)
{
housefree[HouseInfo[idx][ID]] = 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);
}
if(HouseInfo[idx][Owned] == 1)
{
housebought[HouseInfo[idx][ID]] = 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);
}
}
}
return 1;
}
PHP:
for(new h = -1; h < MAX_HOUSES; h++)
{
if(pickupid == housefree[h])
{
new strt[128];
format(strt,sizeof(strt),"{ffffff}Номер дома: \t\t%d\nЦена: \t\t\t%d\nКол-во комнат: \t%d",HouseInfo[h][ID],HouseInfo[HouseInfo[h][ID]][Price] / 100,HouseInfo[HouseInfo[h][ID]][Rooms]);
SPD(playerid,8827,DIALOG_STYLE_MSGBOX,"Свободный дом",strt,"Купить","Отмена");
preid[playerid] = HouseInfo[h][ID];
}
if(pickupid == housebought[h])
{
new strt[128];
format(strt,sizeof(strt),"{ffffff}Номер дома: \t%d\nВладелец: \t%s\nКол-во комнат: \t%d",HouseInfo[h][ID],HouseInfo[h][Owner],HouseInfo[h][Rooms]);
SPD(playerid,8828,DIALOG_STYLE_MSGBOX,"Занятый дом",strt,"Войти","Отмена");
preid[playerid] = HouseInfo[h][ID];
}
}
