Advertisement
Guest User

Untitled

a guest
May 24th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.72 KB | None | 0 0
  1.  
  2. /**
  3. * ExileServer_object_construction_database_load
  4. *
  5. * Exile Mod
  6. * www.exilemod.com
  7. * © 2015 Exile Mod Team
  8. *
  9. * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  10. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  11. */
  12.  
  13. private["_constructionID","_data","_position","_vectorDirection","_vectorUp","_constructionObject","_damageLevel","_public","_pinCode"];
  14. _constructionID = _this;
  15. _data = format ["loadConstruction:%1", _constructionID] call ExileServer_system_database_query_selectSingle;
  16. _position = [_data select 4, _data select 5, _data select 6];
  17. _vectorDirection = [_data select 7, _data select 8, _data select 9];
  18. _vectorUp = [_data select 10, _data select 11, _data select 12];
  19. _constructionObject = createVehicle [(_data select 1), _position, [], 0, "CAN_COLLIDE"];
  20. _constructionObject setPosATL _position;
  21. _constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp];
  22. _constructionObject setVariable ["ExileDatabaseID", _data select 0];
  23. _constructionObject setVariable ["ExileOwnerUID", (_data select 2)];
  24. _constructionObject setVariable ["ExileIsPersistent", true];
  25. _constructionObject setVariable ["ExileTerritoryID", (_data select 15)];
  26. _damageLevel = (_data select 17);
  27. _public = _damageLevel > 0;
  28. _constructionObject setVariable ["ExileConstructionDamage",_damageLevel,_public];
  29. if(_public)then
  30. {
  31. _constructionObject call ExileServer_util_setDamageTexture;
  32. };
  33. _pinCode = _data select 14;
  34. if !(_pinCode isEqualTo "000000") then
  35. {
  36. _constructionObject setVariable ["ExileAccessCode", _pinCode];
  37. _constructionObject setVariable ["ExileIsLocked", (_data select 13), true];
  38. };
  39.  
  40. // 2017-03-16 + TEMPORARY WORKAROUND UNTIL EXILE UPDATE
  41. //if (getNumber(configFile >> "CfgVehicles" >> (_data select 1) >> "exileRequiresSimulation") isEqualTo 1) then
  42. //{
  43. // _constructionObject enableSimulationGlobal true;
  44. // _constructionObject call ExileServer_system_simulationMonitor_addVehicle;
  45. //}
  46. //else
  47. //{
  48. // _constructionObject enableSimulationGlobal false;
  49. //};
  50.  
  51.  
  52. if (typeOf _constructionObject in [
  53. "Exile_Construction_ConcreteDoor_Static",
  54. "Exile_Construction_ConcreteGate_Static",
  55. "Exile_Construction_WoodGate_Static",
  56. "Exile_Construction_WoodDoor_Static",
  57. "Exile_Construction_ConcreteWindowHatch_Static",
  58. "Exile_Construction_WoodGate_Reinforced_Static",
  59. "Exile_Construction_WoodDoor_Reinforced_Static",
  60. "Exile_Construction_ConcreteFloorHatch_Static",
  61. "Land_HBarrier_1_F",
  62. "Land_HBarrier_3_F",
  63. "Land_HBarrier_5_F",
  64. "Land_BagBunker_Tower_F",
  65. "CamoNet_OPFOR_open_F",
  66. "CamoNet_INDP_open_F",
  67. "CamoNet_BLUFOR_open_F",
  68. ///////////////////////// V0.0.2
  69. "Land_CncBarrier_F",
  70. "Land_Stone_4m_F",
  71. "Land_Stone_Gate_F",
  72. "PierLadder_F",
  73. "Land_WaterCooler_01_new_F",
  74. ///////////////////////// V0.0.3
  75. "Land_Pallet_MilBoxes_F",
  76. "Land_Cargo20_military_green_F",
  77. "Land_BagFence_Corner_F",
  78. "Land_BagFence_Long_F",
  79. "Land_HBarrierTower_F",
  80. "Land_Metal_wooden_rack_F",
  81. "Land_BagBunker_Small_F",
  82. "Land_Bunker_F",
  83. "Land_HBarrierWall_corner_F",
  84. "Land_HBarrierWall6_F",
  85. "Land_HBarrierWall4_F",
  86. "Land_RampConcrete_F",
  87. ///////////////////////// V0.0.4
  88. "Land_Wall_IndCnc_4_F",
  89. "Land_City2_4m_F",
  90. "Land_City2_8m_F",
  91. "Land_HelipadCivil_F",
  92. "Land_Rack_F",
  93. ///////////////////////// V0.1.0
  94. "Land_City_Gate_F",
  95. "Land_BarGate_F",
  96. "Land_Icebox_F",
  97. "Land_Sign_WarningMilitaryArea_F",
  98. "Land_Mil_WallBig_4m_F",
  99. "Land_Cargo_Patrol_V2_F",
  100. ///////////////////////// V0.1.1
  101. "Land_Pier_small_F",
  102. "Land_Wall_Tin_4",
  103. ///////////////////////// V0.1.2
  104. "Land_Tank_rust_F",
  105. "Land_ShelvesMetal_F",
  106. "Land_Cargo_Tower_V2_F",
  107. "Land_FuelStation_Feed_F",
  108. "Land_BagBunker_Large_F",
  109. "ShootingPos_F",
  110. ///////////////////////// V0.1.3
  111. "Land_cargo_house_slum_F",
  112. "Land_Cargo40_light_green_F",
  113. "Land_Cargo_House_V2_F",
  114. "Land_LampHalogen_F",
  115. ///////////////////////// V0.1.4
  116. "Land_LampAirport_F",
  117. "Land_CncShelter_F",
  118. "Land_Wall_IndCnc_2deco_F",
  119. "Land_CncWall4_F",
  120. "Land_FuelStation_Shed_F",
  121. "Land_Shed_Small_F",
  122. "Land_Razorwire_F",
  123. ///////////////////////// V0.1.5
  124. "Land_u_Addon_01_V1_F", //brokenshed
  125. "Land_Cargo20_sand_F",
  126. "Land_GH_Stairs_F",
  127. "Land_i_Garage_V2_F",
  128. "Land_GH_Platform_F",
  129. "Land_TentDome_F",
  130. "Land_TentHangar_V1_F",
  131. ///////////////////////// V0.1.6
  132. "Land_CncWall1_F",
  133. "Land_CncBarrierMedium_F",
  134. "Land_Crash_barrier_F",
  135. "Land_Shed_Big_F",
  136. "Land_TouristShelter_01_F",
  137. "Land_Water_source_F",
  138. "Land_Sign_WarningMilitaryVehicles_F",
  139. "Land_Sign_WarningMilAreaSmall_F",
  140. "Land_Concrete_SmallWall_8m_F",
  141. "Land_Concrete_SmallWall_4m_F",
  142. ///////////////////////// V0.1.7
  143. "Land_PortableLight_double_F",
  144. "Land_Radar_Small_F",
  145. "Land_Cargo_addon02_V2_F", //Slumplane
  146. "Land_TableDesk_F",
  147. "Land_ToiletBox_F",
  148. "Land_Pier_Box_F",
  149. ///////////////////////// V0.1.8
  150. "Land_ChairWood_F",
  151. "BlockConcrete_F",
  152. "Land_CargoBox_V1_F",
  153. "Land_IndFnc_3_F",
  154. "Land_IndFnc_9_F",
  155. "Land_Sea_Wall_F",
  156. "Land_i_Addon_03_V1_F",
  157. "Land_i_Addon_03mid_V1_F",
  158. "Land_LampStreet_F",
  159. ///////////////////////// V0.1.9
  160. "Land_Dome_Big_F",
  161. "Land_Hangar_F",
  162. "Land_Metal_Shed_F",
  163. "Land_spp_Tower_F",
  164. "Land_Sun_chair_F",
  165. "Land_Sunshade_04_F",
  166. "Land_LampShabby_F",
  167. ///////////////////////// V0.2.0
  168. "Land_Airport_Tower_F",
  169. "Land_i_Barracks_V1_F",
  170. "Land_BeachBooth_01_F",
  171. "Land_Castle_01_tower_F",
  172. "Land_Sign_WarningUnexplodedAmmo_F",
  173. "Land_TTowerSmall_1_F",
  174. ///////////////////////// V0.2.1 Hotfix
  175. ///////////////////////// V0.2.2
  176. "Exile_Plant_GreenBush",
  177. "Land_nav_pier_m_F",
  178. "Land_SharpStone_01_F",
  179. "Land_SharpStone_02_F",
  180. "Land_Sleeping_bag_F",
  181. "Land_Small_Stone_02_F",
  182. "Land_SolarPanel_2_F",
  183. "Land_spp_Panel_F",
  184. ///////////////////////// V0.2.3
  185. "Land_CampingChair_V2_F",
  186. "Land_CampingChair_V1_F",
  187. "Land_Camping_Light_F",
  188. "Land_CampingTable_F",
  189. "MapBoard_altis_F",
  190. "Land_Pavement_narrow_F",
  191. "Land_Pavement_narrow_corner_F",
  192. "Land_Pavement_wide_F",
  193. "Land_Pavement_wide_corner_F",
  194. ///////////////////////// V0.2.4
  195. "Exile_ConcreteMixer",
  196. "Flag_CSAT_F",
  197. "Land_GarbageContainer_closed_F",
  198. "Land_Metal_rack_F",
  199. "Land_Sink_F",
  200. ///////////////////////// V0.2.5
  201. "Land_Atm_02_F",
  202. ///////////////////////// V0.2.6
  203. "Land_BagBunker_01_small_green_F",
  204. "Land_HBarrier_01_line_3_green_F",
  205. "Land_HBarrier_01_line_5_green_F",
  206. "Land_HBarrier_01_tower_green_F", //name changed
  207. "Land_HBarrier_01_big_tower_green_F",//V0.2.8
  208. "Land_Bagbunker_01_large_green_F",//V0.2.8
  209. "Land_Bagfence_01_short_green_F",//V0.2.8
  210. "Land_Bagfence_01_long_green_F",//V0.2.8
  211. "Land_IRMaskingCover_02_F",//V0.2.8
  212. "Land_IRMaskingCover_01_F",//V0.2.8
  213. "Land_Ammobox_rounds_F",//V0.2.8
  214. "Land_Airport_01_hangar_F",//V0.2.8
  215. ///////////////////////// V0.2.7
  216. "Land_i_House_Small_03_V1_F",//Bungalow
  217. "Land_i_House_Big_01_V2_F",
  218. "Land_PlasticCase_01_medium_F",
  219. "Land_Research_HQ_F",
  220. "Land_Research_house_V1_F",
  221. ///////////////////////// V0.2.8 - Some Apex buildings
  222. "Land_Suitcase_F",
  223. "B_Slingload_01_fuel_F",
  224. "B_Slingload_01_Ammo_F",
  225. ///////////////////////// V0.3.1
  226. "Land_FlatTV_01_F", //Thank you Kurewe for providing me those codes from here :)
  227. "Land_ChairPlastic_F",
  228. "Land_GamingSet_01_console_F",
  229. "Land_GamingSet_01_controller_F",
  230. "Land_GymBench_01_F",
  231. "Land_GymRack_03_F",
  232. "Land_OfficeCabinet_01_F",
  233. "Land_OfficeChair_01_F",
  234. "Land_PCSet_01_case_F",
  235. "Land_PCSet_01_keyboard_F",
  236. "Land_PCSet_01_mouse_F",
  237. "Land_PCSet_01_screen_F",
  238. "Land_Printer_01_F",
  239. "Land_RattanChair_01_F",
  240. "Land_RattanTable_01_F",
  241. "Land_Sleeping_bag_blue_F",
  242. "Land_Sleeping_bag_brown_F",
  243. "Land_Trophy_01_bronze_F",
  244. "Land_Trophy_01_gold_F",
  245. "Land_Trophy_01_silver_F",
  246. "Land_Sun_chair_green_F",
  247. "Land_Sunshade_01_F",
  248. "Land_Sunshade_02_F",
  249. "Land_Sunshade_03_F",
  250. "Land_Sunshade_F",
  251. "Land_TablePlastic_01_F",
  252. "Land_WoodenTable_large_F",
  253. "Land_WoodenTable_small_F",
  254. "OfficeTable_01_new_F",
  255. "Land_DieselGroundPowerUnit_01_F",
  256. "Land_EngineCrane_01_F",
  257. "Land_PalletTrolley_01_yellow_F",
  258. "Land_PressureWasher_01_F",
  259. "Land_WeldingTrolley_01_F",
  260. "Land_Workbench_01_F",
  261. "ArrowDesk_L_F",
  262. "ArrowDesk_R_F",
  263. "PlasticBarrier_02_grey_F",
  264. "PlasticBarrier_02_yellow_F",
  265. "PlasticBarrier_03_blue_F",
  266. "PlasticBarrier_03_orange_F",
  267. "RoadBarrier_F",
  268. "RoadBarrier_small_F",
  269. "RoadCone_F",
  270. "RoadCone_L_F",
  271. "TapeSign_F",
  272. "Land_Target_Dueling_01_F",
  273. "Land_Target_Oval_F",
  274. "TargetP_Inf_F",
  275. "Fridge_01_closed_F",
  276. "Land_MetalCase_01_large_F",
  277. "Land_Microwave_01_F",
  278. "Land_ShelvesWooden_F",
  279. "Land_ShelvesWooden_blue_F",
  280. "Land_ShelvesWooden_khaki_F",
  281. "Land_ToolTrolley_01_F",
  282. "Land_ToolTrolley_02_F",
  283. "Land_Sign_Mines_F",
  284. "Land_PortableHelipadLight_01_F",
  285. "PortableHelipadLight_01_blue_F",
  286. "PortableHelipadLight_01_green_F",
  287. "PortableHelipadLight_01_red_F",
  288. "PortableHelipadLight_01_white_F",
  289. "PortableHelipadLight_01_yellow_F", //Thank you Kurewe for providing me those codes until here :)
  290. "Land_GamingSet_01_powerSupply_F",
  291. "Land_GamingSet_01_camera_F",
  292. "WaterPump_01_forest_F",
  293. "WaterPump_01_sand_F",
  294. "Land_TripodScreen_01_large_F",
  295. "Land_TripodScreen_01_dual_v2_F",
  296. "Land_TripodScreen_01_dual_v1_F",
  297. "Target_Swivel_01_ground_F",
  298. "TargetP_Inf_Acc2_F",
  299. "TargetBootcampHuman_F",
  300. "Target_F",
  301. "Land_SatelliteAntenna_01_F",
  302. "Land_Projector_01_F",
  303. "Land_PortableGenerator_01_F",
  304. "Land_Obstacle_Ramp_F",
  305. "MetalBarrel_burning_F"
  306. ]) then
  307. {
  308. _constructionObject enableSimulationGlobal true;
  309. _constructionObject call ExileServer_system_simulationMonitor_addVehicle;
  310. }
  311. else
  312. {
  313. _constructionObject enableSimulationGlobal false;
  314. };
  315. // 2017-03-16 - TEMPORARY WORKAROUND UNTIL EXILE UPDATE
  316.  
  317. _constructionObject setVelocity [0, 0, 0];
  318. _constructionObject setPosATL _position;
  319. _constructionObject setVelocity [0, 0, 0];
  320. _constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp];
  321. _constructionObject setVelocity [0, 0, 0];
  322.  
  323. _textures = _data select 18;
  324. if !(_textures isEqualTo "") then
  325. {
  326. if (_textures isEqualType "") then
  327. {
  328. _constructionObject setObjectTextureGlobal [0, _textures];
  329. }
  330. else
  331. {
  332. if !((_textures select 0) isEqualType "") then
  333. {
  334. {
  335. _constructionObject setObjectTextureGlobal _x;
  336. true
  337. } count _textures;
  338. }
  339. else
  340. {
  341. {
  342. _constructionObject setObjectTextureGlobal [_forEachIndex, _x];
  343. } forEach _textures;
  344. };
  345. };
  346. };
  347. _constructionObject
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement