SHARE
TWEET

Untitled

a guest Jun 12th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stock update_house(h)
  2. {
  3.     if(IsValidDynamicMapIcon(h_info[h][h_icon])) DestroyDynamicMapIcon(h_info[h][h_icon]);
  4.  
  5.     if(IsValidDynamic3DTextLabel(h_info[h][h_text])) DestroyDynamic3DTextLabel(h_info[h][h_text]);
  6.     if(IsValidDynamic3DTextLabel(h_info[h][h_garage_text])) DestroyDynamic3DTextLabel(h_info[h][h_garage_text]);
  7.     if(IsValidDynamic3DTextLabel(h_info[h][h_cupboard_text])) DestroyDynamic3DTextLabel(h_info[h][h_cupboard_text]);
  8.     if(IsValidDynamic3DTextLabel(h_info[h][h_g_cupboard_text])) DestroyDynamic3DTextLabel(h_info[h][h_g_cupboard_text]);
  9.  
  10.     if(IsValidDynamicPickup(h_info[h][h_garage_door])) DestroyDynamicPickup(h_info[h][h_garage_door]);
  11.     if(IsValidDynamicArea(h_info[h][h_garage_area][0])) DestroyDynamicArea(h_info[h][h_garage_area][0]);
  12.     if(IsValidDynamicArea(h_info[h][h_garage_area][1])) DestroyDynamicArea(h_info[h][h_garage_area][1]);
  13.  
  14.     if(IsValidDynamicArea(h_info[h][h_area_cupboard][0])) DestroyDynamicArea(h_info[h][h_area_cupboard][0]);
  15.     if(IsValidDynamicArea(h_info[h][h_area_cupboard][1])) DestroyDynamicArea(h_info[h][h_area_cupboard][1]);
  16.     /////////////////////////////////////////////////
  17.     new need_pickup, house_pickup;
  18.     need_pickup = (h_info[h][h_user_id] == INVALID_ACCOUNT_ID ? (1273) : (1272));
  19.     if(IsValidDynamicPickup(h_info[h][h_pickup_enter]))
  20.     {
  21.         house_pickup = Streamer_GetIntData(STREAMER_TYPE_PICKUP, h_info[h][h_pickup_enter], E_STREAMER_MODEL_ID);
  22.         if(house_pickup != need_pickup)
  23.             Streamer_SetIntData(STREAMER_TYPE_PICKUP, h_info[h][h_pickup_enter], E_STREAMER_MODEL_ID, need_pickup);
  24.     }
  25.     else
  26.     {
  27.         h_info[h][h_pickup_enter] = CreateDynamicPickup(need_pickup, 23, h_info[h][h_enter][0], h_info[h][h_enter][1], h_info[h][h_enter][2], -1, -1, -1, 50.0);
  28.         UpdatePickupInfo(h_info[h][h_pickup_enter], TYPE_HOUSE, PICKUP_SUBTYPE_HOUSE_ENTER, h);
  29.     }
  30.     foreach(new i: Player)
  31.     {
  32.         if(IsPlayerInRangeOfPoint(i, 50.0, h_info[h][h_enter][0], h_info[h][h_enter][1], h_info[h][h_enter][2]))
  33.             Streamer_UpdateEx(i, h_info[h][h_enter][0], h_info[h][h_enter][1], h_info[h][h_enter][2], 0, 0);
  34.     }
  35.     //////////////////////////////////
  36.     STRING_GLOBAL[0] = EOS;
  37.     if(h_info[h][h_user_id] == INVALID_ACCOUNT_ID)
  38.     {
  39.         h_info[h][h_garage_lock] = 1;
  40.         f(STRING_GLOBAL,"Дом"I" №%d\n"W"Цена:"I" %d$"W"\nГараж: "I"%s",h,h_info[h][h_value], h_info[h][h_squar] > 1 ? "Есть":"Нет");
  41.     }
  42.     else
  43.         f(STRING_GLOBAL,"Дом"I" №%d\n"W"Владелец:"I" %s"W"\nГараж: "I"%s",h,h_info[h][h_owner], h_info[h][h_squar] > 1 ? "Есть":"Нет");
  44.  
  45.     if(h_info[h][h_family_id] != -1) {
  46.         for(new i = family_count; i > 0; i--) {
  47.             if(family_info[i][fam_house_id] == h)
  48.             {
  49.                 f(STRING_GLOBAL, "%s\n"W"Дом семьи: "I"%s", STRING_GLOBAL, family_info[i][fam_name]);
  50.                 break;
  51.             }
  52.         }
  53.     }
  54.     h_info[h][h_text] = CreateDynamic3DTextLabel(STRING_GLOBAL,white,h_info[h][h_enter][0], h_info[h][h_enter][1], h_info[h][h_enter][2],20.0, INVALID_PLAYER_ID,INVALID_VEHICLE_ID, streamer_TESTLOL);
  55.     //////////////////////////////////////
  56.     h_info[h][h_icon] = CreateDynamicMapIcon(h_info[h][h_enter][0], h_info[h][h_enter][1], h_info[h][h_enter][2], h_info[h][h_user_id] == INVALID_ACCOUNT_ID ? 31 : 32, -1, 0, -1, -1, 50.0);
  57.     //////////////////////////////////////
  58.     new h_class = h_info[h][h_squar] - 1, int_id = h_info[h][h_int];
  59.  
  60.     new streamer_house_int = Streamer_GetFloatData(STREAMER_TYPE_PICKUP, h_info[h][h_pickup_exit], E_STREAMER_X);
  61.  
  62.     if(!IsValidDynamicPickup(h_info[h][h_pickup_exit]) || streamer_house_int  != h_ints[h_class][int_id][i_spawn_pos][0])
  63.     {
  64.         h_info[h][h_pickup_exit] = CreateDynamicPickup(PICKUP_DEFAULT_ID, 23, h_ints[h_class][int_id][i_spawn_pos][0],h_ints[h_class][int_id][i_spawn_pos][1], h_ints[h_class][int_id][i_spawn_pos][2]+0.1, h+50, h_ints[h_class][int_id][i_int], -1);
  65.         UpdatePickupInfo(h_info[h][h_pickup_exit], TYPE_HOUSE, PICKUP_SUBTYPE_HOUSE_EXIT, h);
  66.     }
  67.  
  68.     if(!IsValidDynamicPickup(h_info[h][h_attic_door]))
  69.     {
  70.         h_info[h][h_attic_door] = CreateDynamicPickup(PICKUP_DEFAULT_ID, 23, 719.5008,10.6092,1000.6981, h+50, h_ints[h_class][int_id][i_int], -1);
  71.         UpdatePickupInfo(h_info[h][h_attic_door], TYPE_HOUSE, PICKUP_SUBTYPE_HOUSE_A_DOOR, h);
  72.     }
  73.  
  74.     if(h_info[h][h_improve][CUPBOARD] == 1)
  75.     {
  76.         f(STRING_GLOBAL,"Шкаф:\n\n"W"Деньги: "I"%d$\n"W"Патроны:"I" %d шт."W"\n"W"Материалы:"I" %d шт."W"\n"W"Наркотики:"I" %d грамм",
  77.             h_info[h][h_cupboard][MONEY], h_info[h][h_cupboard][PATR], h_info[h][h_cupboard][MATR], h_info[h][h_cupboard][DRUGS]);
  78.         h_info[h][h_cupboard_text] = CreateDynamic3DTextLabel(STRING_GLOBAL,COLOR_ORANGE,h_ints[h_class][int_id][i_cupboard_pos][0],h_ints[h_class][int_id][i_cupboard_pos][1], h_ints[h_class][int_id][i_cupboard_pos][2]+0.5,15.0, INVALID_PLAYER_ID,INVALID_VEHICLE_ID, streamer_TESTLOL, h+50, h_ints[h_class][int_id][i_int], -1);
  79.         house_pickup = CreateDynamicSphere( h_ints[h_class][int_id][i_cupboard_pos][0],h_ints[h_class][int_id][i_cupboard_pos][1], h_ints[h_class][int_id][i_cupboard_pos][2], 1.0, h+50, h_ints[h_class][int_id][i_int], -1);
  80.         h_info[h][h_area_cupboard][0] = house_pickup;
  81.         UpdateAreaInfo(house_pickup, TYPE_HOUSE, AREA_SUBTYPE_HOUSE_CUPBOARD, h);
  82.     }
  83.  
  84.     if(h_info[h][h_improve][MAKEGUN] == 1)
  85.     {
  86.         if(!IsValidDynamic3DTextLabel(h_info[h][h_attic_text])) h_info[h][h_attic_text] = CreateDynamic3DTextLabel("Оружейный стол",COLOR_ORANGE,718.2767,-1.2356,1000.6981+0.4,15.0, INVALID_PLAYER_ID,INVALID_VEHICLE_ID, streamer_TESTLOL, h+50, h_ints[h_class][int_id][i_int], -1);
  87.         if(!IsValidDynamicPickup(h_info[h][h_attic_pickup]))
  88.         {
  89.             h_info[h][h_attic_pickup] = CreateDynamicPickup(PICKUP_DEFAULT_ID, 23, 718.2767,-1.2356,1000.6981, h+50, h_ints[h_class][int_id][i_int], -1);
  90.             UpdatePickupInfo(h_info[h][h_attic_pickup], TYPE_HOUSE, PICKUP_SUBTYPE_HOUSE_ATTIC, h);
  91.         }
  92.     }
  93.  
  94.     if(h_class > 0)
  95.     {
  96.         h_class--;
  97.  
  98.         h_info[h][h_garage_door] = CreateDynamicPickup(PICKUP_DEFAULT_ID, 23, g_info[h_class][g_pX], g_info[h_class][g_pY], g_info[h_class][g_pZ]+0.1, h+50, h_ints[h_class+1][int_id][i_int], -1);
  99.         UpdatePickupInfo(h_info[h][h_garage_door], TYPE_HOUSE, PICKUP_SUBTYPE_HOUSE_G_DOOR, h);
  100.  
  101.         h_info[h][h_garage_area][0] = CreateDynamicSphere(h_info[h][h_garage_enter][0], h_info[h][h_garage_enter][1], h_info[h][h_garage_enter][2], 2.5, -1, -1, -1);
  102.         h_info[h][h_garage_area][1] = CreateDynamicSphere(g_info[h_class][g_vX], g_info[h_class][g_vY], g_info[h_class][g_vZ], 2.5, h+50, h_ints[h_class+1][int_id][i_int], -1);
  103.  
  104.         UpdateAreaInfo(h_info[h][h_garage_area][0], TYPE_HOUSE, AREA_SUBTYPE_HOUSE_G_ENTER, h);
  105.         UpdateAreaInfo(h_info[h][h_garage_area][1], TYPE_HOUSE, AREA_SUBTYPE_HOUSE_G_EXIT, h);
  106.  
  107.         f(STRING_GLOBAL, "Заезд в гараж\nДома №%d",h);
  108.         h_info[h][h_garage_text] = CreateDynamic3DTextLabel(STRING_GLOBAL,COLOR_ORANGE,h_info[h][h_garage_enter][0], h_info[h][h_garage_enter][1], h_info[h][h_garage_enter][2],10.0, INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1);
  109.  
  110.         if(h_info[h][h_improve][G_CUPBOARD] == 1)
  111.         {
  112.             f(STRING_GLOBAL,"Склад:\n\n"W"Рем. комплекты: "I"%d шт.\n"W"Канистры:"I" %d шт.",
  113.             h_info[h][h_g_cupboard][REM_KIT], h_info[h][h_g_cupboard][CANISTR]);
  114.             h_info[h][h_g_cupboard_text] = CreateDynamic3DTextLabel(STRING_GLOBAL,COLOR_ORANGE,g_cupboard_pos[h_class][0],g_cupboard_pos[h_class][1], g_cupboard_pos[h_class][2]+0.5,15.0, INVALID_PLAYER_ID,INVALID_VEHICLE_ID, streamer_TESTLOL, h+50, h_ints[h_class+1][int_id][i_int], -1);
  115.             h_info[h][h_area_cupboard][1] = CreateDynamicSphere( g_cupboard_pos[h_class][0],g_cupboard_pos[h_class][1], g_cupboard_pos[h_class][2], 1.0, h+50, h_ints[h_class+1][int_id][i_int], -1);
  116.             UpdateAreaInfo(h_info[h][h_area_cupboard][1], TYPE_HOUSE, AREA_SUBTYPE_HOUSE_G_CUPBOARD, h);
  117.         }
  118.     }
  119.     return 1;
  120. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top