Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.53 KB | None | 0 0
  1. publics: LoadProperty()
  2. {
  3. new fields;
  4.  
  5. cache_get_data(TOTAL_HOUSE,fields,connects);
  6.  
  7. if(--TOTAL_HOUSE <= 0)
  8. return printf("Дома не загружены."), mysql_tquery(connects,"SELECT * FROM `inviters`", "LoadFractions","");
  9. //if(--TOTAL_HOUSE <= 0) -> if(TOTAL_HOUSE <= 0)
  10.  
  11. new h_online, h_online_arendator[2], time = GetTickCount();
  12. string[0] = EOS;
  13.  
  14. for(new he; he <= TOTAL_HOUSE; he++)
  15. {
  16. HouseInfo[he][hID] = cache_get_field_content_int(he, "hID", connects);
  17.  
  18. HouseInfo[he][hEnter][0] = cache_get_field_content_float(he, "hEntrancex", connects);
  19. HouseInfo[he][hEnter][1] = cache_get_field_content_float(he, "hEntrancey", connects);
  20. HouseInfo[he][hEnter][2] = cache_get_field_content_float(he, "hEntrancez", connects);
  21.  
  22. HouseInfo[he][hExit][0] = cache_get_field_content_float(he, "hExitx", connects);
  23. HouseInfo[he][hExit][1] = cache_get_field_content_float(he, "hExity", connects);
  24. HouseInfo[he][hExit][2] = cache_get_field_content_float(he, "hExitz", connects);
  25.  
  26. cache_get_field_content(he, "hOwner", HouseInfo[he][hOwner], connects, strlen(HouseInfo[he][hOwner]));
  27.  
  28. HouseInfo[he][hValue] = cache_get_field_content_int(he, "hValue", connects);
  29. HouseInfo[he][hHel] = cache_get_field_content_int(he, "hHel", connects);
  30. HouseInfo[he][hInt] = cache_get_field_content_int(he, "hInt", connects);
  31. HouseInfo[he][hLock] = cache_get_field_content_int(he, "hLock", connects);
  32. HouseInfo[he][hOwned] = cache_get_field_content_int(he, "hOwned", connects);
  33. HouseInfo[he][hKlass] = cache_get_field_content_int(he, "hKlass", connects);
  34. HouseInfo[he][hVehSost] = cache_get_field_content_int(he, "hVehSost", connects);
  35.  
  36. HouseInfo[he][hCar][0] = cache_get_field_content_float(he, "hCarx", connects);
  37. HouseInfo[he][hCar][1] = cache_get_field_content_float(he, "hCary", connects);
  38. HouseInfo[he][hCar][2] = cache_get_field_content_float(he, "hCarz", connects);
  39. HouseInfo[he][hCar][3] = cache_get_field_content_float(he, "hCarc", connects);
  40.  
  41. HouseInfo[he][hStyle] = cache_get_field_content_int(he, "hStyle", connects);
  42. HouseInfo[he][hSafe] = cache_get_field_content_int(he, "hSafe", connects);
  43. HouseInfo[he][hNarko] = cache_get_field_content_int(he, "hNarko", connects);
  44.  
  45. HouseInfo[he][hGun][0] = cache_get_field_content_int(he, "hGun1", connects);
  46. HouseInfo[he][hGun][1] = cache_get_field_content_int(he, "hGun2", connects);
  47. HouseInfo[he][hGun][2] = cache_get_field_content_int(he, "hGun3", connects);
  48. HouseInfo[he][hGun][3] = cache_get_field_content_int(he, "hGun4", connects);
  49. HouseInfo[he][hGun][4] = cache_get_field_content_int(he, "hGun5", connects);
  50.  
  51. HouseInfo[he][hGunAmmo][0] = cache_get_field_content_int(he, "hGunAmmo1", connects);
  52. HouseInfo[he][hGunAmmo][1] = cache_get_field_content_int(he, "hGunAmmo2", connects);
  53. HouseInfo[he][hGunAmmo][2] = cache_get_field_content_int(he, "hGunAmmo3", connects);
  54. HouseInfo[he][hGunAmmo][3] = cache_get_field_content_int(he, "hGunAmmo4", connects);
  55. HouseInfo[he][hGunAmmo][4] = cache_get_field_content_int(he, "hGunAmmo5", connects);
  56.  
  57. HouseInfo[he][hGarage] = cache_get_field_content_int(he, "hGarage", connects);
  58. HouseInfo[he][hSubsidions] = cache_get_field_content_int(he, "hSubsidions", connects);
  59.  
  60. HouseInfo[he][hEat][0] = cache_get_field_content_int(he, "hEat1", connects);
  61. HouseInfo[he][hEat][1] = cache_get_field_content_int(he, "hEat2", connects);
  62. HouseInfo[he][hEat][2] = cache_get_field_content_int(he, "hEat3", connects);
  63. HouseInfo[he][hEat][3] = cache_get_field_content_int(he, "hEat4", connects);
  64. HouseInfo[he][hEat][4] = cache_get_field_content_int(he, "hEat5", connects);
  65.  
  66. cache_get_field_content(he, "hRent", HouseInfo[he][hRent], connects, strlen(HouseInfo[he][hRent]));
  67. cache_get_field_content(he, "hRent1", HouseInfo[he][hRent1], connects, strlen(HouseInfo[he][hRent1]));
  68. HouseInfo[he][hRentHouse] = cache_get_field_content_int(he, "hRentHouse", connects);
  69.  
  70. switch(HouseInfo[he][hKlass])
  71. {
  72. case 0: HouseInfo[he][hValue] = House_Fare_Class[0];
  73. case 1: HouseInfo[he][hValue] = House_Fare_Class[1];
  74. case 2: HouseInfo[he][hValue] = House_Fare_Class[2];
  75. case 3: HouseInfo[he][hValue] = House_Fare_Class[3];
  76. case 4: HouseInfo[he][hValue] = House_Fare_Class[4];
  77. case 5: HouseInfo[he][hValue] = House_Fare_Class[5];
  78. }
  79.  
  80. h_online = cache_get_field_content_int(he, "h_online", connects);
  81. h_online_arendator[0] = cache_get_field_content_int(he, "h_online_arendator", connects);
  82. h_online_arendator[1] = cache_get_field_content_int(he, "h_online_arendator_1", connects);
  83.  
  84. if(h_online_arendator[0] && strcmp(HouseInfo[he][hRent], "-", true) && getdate() >= h_online_arendator[0]+3)
  85. {
  86. mysql_format(connects,string,164,"UPDATE `accounts` SET `pArendaHouse` = '-1',`pText` = '2' WHERE `Name` = '%s'",HouseInfo[he][hRent]);
  87. mysql_empty(connects, string);
  88. mysql_format(connects,string,126,"UPDATE `house` SET `h_online_arendator` = '0' WHERE `hID` = '%i'",HouseInfo[he][hID]);
  89. mysql_empty(connects, string);
  90. }
  91. else if(h_online_arendator[1] && strcmp(HouseInfo[he][hRent1], "-", true) && getdate() >= h_online_arendator[1]+3)
  92. {
  93. mysql_format(connects,string,164,"UPDATE `accounts` SET `pArendaHouse` = '-1',`pText` = '2' WHERE `Name` = '%s'",HouseInfo[he][hRent1]);
  94. mysql_empty(connects, string);
  95. mysql_format(connects,string,126,"UPDATE `house` SET `h_online_arendator_1` = '0' WHERE `hID` = '%i'",HouseInfo[he][hID]);
  96. mysql_empty(connects, string);
  97. }
  98. else if( h_online > 0 && HouseInfo[he][hOwned] && getdate() >= h_online + (HouseInfo[he][hSubsidions] ? (7) : (3)) )
  99. {
  100. mysql_format(connects,string,164,"UPDATE `accounts` SET `pPhousekey` = '-1',`pText` = '1' WHERE `Name` = '%s'",HouseInfo[he][hOwner]);
  101. mysql_empty(connects, string);
  102. strmid(HouseInfo[he][hOwner], "The State", 0, strlen("The State"), 255);
  103. HouseInfo[he][hHel] = 0;
  104. HouseInfo[he][hLock] = 1;
  105. HouseInfo[he][hOwned] = 0;
  106. HouseInfo[he][hVehSost] = 0;
  107. HouseInfo[he][hStyle] = 0;
  108. HouseInfo[he][hGarage] = 0;
  109. HouseInfo[he][hSubsidions] = 0;
  110. for(new d = 0; d != 5; d++) HouseInfo[he][hGun][d] = 0, HouseInfo[he][hGunAmmo][d] = 0;
  111. HouseInfo[he][hSafe] = 0;
  112. mysql_format(connects,string,126,"UPDATE `house` SET `h_online` = '0' WHERE `hID` = '%i'",HouseInfo[he][hID]);
  113. mysql_empty(connects, string);
  114. printf("[HOUSE №%i] %i:%i. Дом был продан государству.",HouseInfo[he][hID],h_online,getdate());
  115. }
  116.  
  117. HouseInfo[he][LabelText][0] = CreateDynamic3DTextLabel("Выход из дома\nКлавиша: "SERVER"''ALT''", -1,HouseInfo[he][hExit][0],HouseInfo[he][hExit][1],HouseInfo[he][hExit][2]+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,HouseInfo[he][hInt],he+50);
  118.  
  119. format(string,512,"Номер дома: {A52A2A}№%d"WHITE"\nГосударственная цена: {A52A2A}%i$"WHITE"\nCостояние дома: {A52A2A}%s\n\n"WHITE"Подробная информация: {A52A2A}''ALT''", HouseInfo[he][hID], HouseInfo[he][hValue],(HouseInfo[he][hOwned]?("Занят"):("Свободен")));
  120.  
  121. HouseInfo[he][LabelText][1] = CreateDynamic3DTextLabel(string,-1,HouseInfo[he][hEnter][0],HouseInfo[he][hEnter][1],HouseInfo[he][hEnter][2],9.0,INVALID_PLAYER_ID, INVALID_VEHICLE_ID);
  122. if(HouseInfo[he][hGarage]) CreateDynamic3DTextLabel(""SERVER"Выход из гаражного отделения\n{"#cGRAY"}Нажмите клавишу {FF8282}ALT", COLOR_SERVER, 2543.1995,-1535.9775,2022.6578+0.8,9.0,INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, he+50), CreateDynamic3DTextLabel("Выезд из гаражного отделения\n{"#cGRAY"}Нажмите клавишу {FF8282}H", COLOR_SERVER, 2523.2563,-1543.2930,2022.5101+0.8,9.0,INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, he+50);
  123.  
  124. if(!HouseInfo[he][hOwned])
  125. {
  126. HouseInfo[he][hPickup] = CreateDynamicPickup(19523, 23, HouseInfo[he][hEnter][0], HouseInfo[he][hEnter][1], HouseInfo[he][hEnter][2],-1);
  127. HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEnter][0], HouseInfo[he][hEnter][1], HouseInfo[he][hEnter][2], 31, COLOR_WHITE, 0, -1, -1, 200.0);
  128. }
  129. else
  130. {
  131. HouseInfo[he][hPickup] = CreateDynamicPickup(19133, 23, HouseInfo[he][hEnter][0], HouseInfo[he][hEnter][1], HouseInfo[he][hEnter][2],-1);
  132. HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEnter][0], HouseInfo[he][hEnter][1], HouseInfo[he][hEnter][2], 32, COLOR_WHITE, 0, -1, -1, 200.0);
  133. }
  134. }
  135. printf("-> LoadProperty | Загружено %d | Time: %d (ms)",TOTAL_HOUSE,GetTickCount() - time);
  136.  
  137. mysql_tquery(connects,"SELECT * FROM `inviters`", "LoadFractions","");
  138. return 1;
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement