Пользователь
- Регистрация
- 14 Авг 2023
- Сообщения
- 111
- Автор темы
- #1
Когда создаю дом, то в базе данных появляется вся информация, но после перезапуска сервера дом исчезает хотя в бд все есть.
И в консоли вообще не появляется printf("[ЗАГРУЖЕНО ДОМОВ]: <%d>", TOTALHOUSE);
Код загрузки:
И в консоли вообще не появляется printf("[ЗАГРУЖЕНО ДОМОВ]: <%d>", TOTALHOUSE);
Код загрузки:
Pawn:
forward LoadHouse();
public LoadHouse()
{
cache_get_row_count(TOTALHOUSE);
if(TOTALHOUSE)
{
static const h_no_owner[] = "{FFDEAD}ID: {FFFFFF}[%d]\n{FFDEAD}Владелец: {FFFFFF}Нет\n{FFDEAD}Стоимость: {FFFFFF}%d\n{FFDEAD}Уровень: {FFFFFF}%d";
static const h_any_owner[] = "{FFDEAD}ID: {FFFFFF}[%d]\n{FFDEAD}Владелец: {FFFFFF}%s\n{FFDEAD}Уровень: {FFFFFF}%d";
new h_info[sizeof(h_any_owner) + ((3-2) + (24-2) + (20-2) + (5-2))];
for(new h = 0; h < TOTALHOUSE; h++)
{
cache_get_value_name_int(h,"id",HouseInfo[h][hID]);
cache_get_value_name(h,"owner",HouseInfo[h][hOwner],MAX_PLAYER_NAME);
cache_get_value_name_int(h, "owned", HouseInfo[h][hOwned]);
cache_get_value_name_float(h, "enter_pos_x", HouseInfo[h][henter_pos_x]);
cache_get_value_name_float(h, "enter_pos_y", HouseInfo[h][henter_pos_y]);
cache_get_value_name_float(h, "enter_pos_z", HouseInfo[h][henter_pos_z]);
cache_get_value_name_float(h, "exit_pos_x", HouseInfo[h][hexit_pos_x]);
cache_get_value_name_float(h, "exit_pos_y", HouseInfo[h][hexit_pos_y]);
cache_get_value_name_float(h, "exit_pos_z", HouseInfo[h][hexit_pos_z]);
cache_get_value_name_int(h, "price", HouseInfo[h][hPrice]);
cache_get_value_name_int(h, "level", HouseInfo[h][hLevel]);
cache_get_value_name_int(h, "interior", HouseInfo[h][hInt]);
cache_get_value_name_float(h, "car_pos_x", HouseInfo[h][hcar_pos_x]);
cache_get_value_name_float(h, "car_pos_y", HouseInfo[h][hcar_pos_y]);
cache_get_value_name_float(h, "car_pos_z", HouseInfo[h][hcar_pos_z]);
cache_get_value_name_float(h, "car_pos_angle", HouseInfo[h][hcar_pos_angle]);
cache_get_value_name_int(h, "vehicle", HouseInfo[h][hHouse_Car]);
if(!HouseInfo[h][hOwned])
{
format(h_info, sizeof(h_info), h_no_owner, HouseInfo[h][hID], HouseInfo[h][hPrice],HouseInfo[h][hLevel]);
HouseInfo[h][hPickup] = CreatePickup(1273, 1, HouseInfo[h][henter_pos_x], HouseInfo[h][henter_pos_y], HouseInfo[h][henter_pos_z], -1);
HouseInfo[h][hText] = Create3DTextLabel(h_info, 0x008080FF, HouseInfo[h][henter_pos_x], HouseInfo[h][henter_pos_y], HouseInfo[h][henter_pos_z], 7, 0);
HouseInfo[h][hMapicon] = SetPlayerMapIcon(h, 12, HouseInfo[h][henter_pos_x], HouseInfo[h][henter_pos_y], HouseInfo[h][henter_pos_z], 31, -1, MAPICON_LOCAL);
}
else
{
format(h_info, sizeof(h_info), h_any_owner, HouseInfo[h][hID], HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
HouseInfo[h][hPickup] = CreatePickup(1272, 1, HouseInfo[h][henter_pos_x], HouseInfo[h][henter_pos_y], HouseInfo[h][henter_pos_z], -1);
HouseInfo[h][hText] = Create3DTextLabel(h_info, 0xFFFFFF, HouseInfo[h][henter_pos_x], HouseInfo[h][henter_pos_y], HouseInfo[h][henter_pos_z], 7.0, 0);
}
}
}
printf("[ЗАГРУЖЕНО ДОМОВ]: <%d>", TOTALHOUSE);
return 1;
}