ну получается же вот код загрузки hID в h_id так же ведь
PHP код:
HouseInfo[h_id][hID] = cache_get_field_content_int(i, "house_id", MYSQL);
- - - Добавлено - - -
сделал вот так все дома прогрузились хорошо
PHP код:
/****************************[ Недвижимость ] *********************************/
forward CallBackLoadHouse();
public CallBackLoadHouse()
{
new r, d, time = GetTickCount(), idx;
cache_get_data(r, d);
if(!r) return 1;
for(new i, h_id; i < r; i++)
{
HouseInfo[h_id][hID] = cache_get_field_content_int(i, "house_id", MYSQL);
HouseInfo[h_id][hEntrancex] = cache_get_field_content_float(i, "hEntrancex", MYSQL);
HouseInfo[h_id][hEntrancey] = cache_get_field_content_float(i, "hEntrancey", MYSQL);
HouseInfo[h_id][hEntrancez] = cache_get_field_content_float(i, "hEntrancez", MYSQL);
HouseInfo[h_id][hExitx] = cache_get_field_content_float(i, "hExitx", MYSQL);
HouseInfo[h_id][hExity] = cache_get_field_content_float(i, "hExity", MYSQL);
HouseInfo[h_id][hExitz] = cache_get_field_content_float(i, "hExitz", MYSQL);
HouseInfo[h_id][hValue] = cache_get_field_content_int(i, "hValue", MYSQL);
HouseInfo[h_id][hHel] = cache_get_field_content_int(i, "hHel", MYSQL);
HouseInfo[h_id][hInt] = cache_get_field_content_int(i, "hInt", MYSQL);
HouseInfo[h_id][hLock] = cache_get_field_content_int(i, "hLock", MYSQL);
HouseInfo[h_id][hOwned] = cache_get_field_content_int(i, "hOwned", MYSQL);
HouseInfo[h_id][hTakings] = cache_get_field_content_int(i, "hTakings", MYSQL);
HouseInfo[h_id][hKlass] = cache_get_field_content_int(i, "hKlass", MYSQL);
HouseInfo[h_id][hCarx] = cache_get_field_content_float(i, "hCarx", MYSQL);
HouseInfo[h_id][hCary] = cache_get_field_content_float(i, "hCary", MYSQL);
HouseInfo[h_id][hCarz] = cache_get_field_content_float(i, "hCarz", MYSQL);
HouseInfo[h_id][hCarc] = cache_get_field_content_float(i, "hCarc", MYSQL);
cache_get_field_content(i, "hOwner", HouseInfo[h_id][hOwner], MYSQL, 32);
if(!(0 <= h_id < MAX_HOUSE))
{
continue;// ID дома меньше 0 или больше MAX_HOUSES - пропускаем его
}
if(HouseInfo[h_id][hOwned] == 0)
{
HouseInfo[h_id][hPickup] = CreateDynamicPickup(1273, 23, HouseInfo[h_id][hEntrancex], HouseInfo[h_id][hEntrancey], HouseInfo[h_id][hEntrancez], -1);
HouseInfo[h_id][hMIcon] = CreateDynamicMapIcon(HouseInfo[h_id][hEntrancex], HouseInfo[h_id][hEntrancey], HouseInfo[h_id][hEntrancez], 31, COLOR_WHITE, 0, -1, -1, 90.0);
}
if(HouseInfo[h_id][hOwned] == 1)
{
HouseInfo[h_id][hPickup] = CreateDynamicPickup(1272, 23, HouseInfo[h_id][hEntrancex], HouseInfo[h_id][hEntrancey], HouseInfo[h_id][hEntrancez], -1);
HouseInfo[h_id][hMIcon] = CreateDynamicMapIcon(HouseInfo[h_id][hEntrancex], HouseInfo[h_id][hEntrancey], HouseInfo[h_id][hEntrancez], 32, COLOR_WHITE, 0, -1, -1, 90.0);
}
HouseInfo[h_id][hLabel] = CreateDynamic3DTextLabel("Выход из дома\nВведите: ''/exit''", -1, HouseInfo[h_id][hExitx], HouseInfo[h_id][hExity],
HouseInfo[h_id][hExitz]+1, 9.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, HouseInfo[h_id][hInt], h_id);
idx++;
h_id++;
}
print("=============================================================");
print("Результат загрузки ДОМОВ:");
printf("Найдено строк в БД: [%i]", r);
printf("ID начала массива: [%i]", HouseInfo[0][hID]);
if(idx == MAX_HOUSE) printf("Загружены строк: [%i/%i] [ГОТОВО]", idx, MAX_HOUSE);
else printf("Загружены строк: [%i/%i] [ОШИБКА]", idx, MAX_HOUSE);
printf("[Загрузка...]: Дома успешно загружены | Время потрачено: %i <ms>", GetTickCount() - time);
print("=============================================================");
return true;
}
теперь проблема с этим когда наступаешь на пикап не вызывается диалог
PHP код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid) //
{
foreach(new h: HOUSEIDS)
{
new string[90];
if(pickupid == HouseInfo[h][hPickup])
{
SetPVarInt(playerid, "HousePickID", h);
switch(HouseInfo[h][hOwned])
{
case 0:
{
switch(HouseInfo[h][hKlass])
{
case 0: format(string, sizeof(string), "{ffffff}Цена: %d\nКласс: Nope\nНомер дома: %d", HouseInfo[h][hValue], HouseInfo[h][hID]);
case 1: format(string, sizeof(string), "{ffffff}Цена: %d\nКласс: D\nНомер дома: %d", HouseInfo[h][hValue], HouseInfo[h][hID]);
case 2: format(string, sizeof(string), "{ffffff}Цена: %d\nКласс: C\nНомер дома: %d", HouseInfo[h][hValue], HouseInfo[h][hID]);
case 3: format(string, sizeof(string), "{ffffff}Цена: %d\nКласс: B\nНомер дома: %d", HouseInfo[h][hValue], HouseInfo[h][hID]);
default: format(string, sizeof(string), "{ffffff}Цена: %d\nКласс: A\nНомер дома: %d", HouseInfo[h][hValue], HouseInfo[h][hID]);
}
ShowPlayerDialog(playerid, 10075, DIALOG_STYLE_MSGBOX, "Продаётся", string, "Войти", "Отмена");//Диалог домов
}
case 1:
{
new ttextt[32];
if(IsPlayerConnected(GetPlayerID(HouseInfo[h][hOwner]))) { ttextt = "[{3caa3c}Online{ffffff}]"; }
else if(!IsPlayerConnected(GetPlayerID(HouseInfo[h][hOwner]))) { ttextt = "[{ff2400}Offline{ffffff}]"; }
switch(HouseInfo[h][hKlass])
{
case 0: format(string, sizeof(string), "{ffffff}Владелец: %s %s\nКласс: Nope\nНомер дома: %d",HouseInfo[h][hOwner], ttextt, HouseInfo[h][hID]);
case 1: format(string, sizeof(string), "{ffffff}Владелец: %s %s\nКласс: D\nНомер дома: %d",HouseInfo[h][hOwner], ttextt, HouseInfo[h][hID]);
case 2: format(string, sizeof(string), "{ffffff}Владелец: %s %s\nКласс: C\nНомер дома: %d",HouseInfo[h][hOwner], ttextt, HouseInfo[h][hID]);
case 3: format(string, sizeof(string), "{ffffff}Владелец: %s %s\nКласс: B\nНомер дома: %d",HouseInfo[h][hOwner], ttextt, HouseInfo[h][hID]);
default: format(string, sizeof(string), "{ffffff} Владелец:%s %s\nКласс: A\nНомер дома: %d",HouseInfo[h][hOwner], ttextt, HouseInfo[h][hID]);
}
ShowPlayerDialog(playerid, 10075, DIALOG_STYLE_MSGBOX, "Дом занят", string, "Войти", "Отмена");
}
}
return 1;
}
}
return 1;
}