Advertisement
skotracker

ExileServer_object_construction_database_load

Apr 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 6.33 KB | None | 0 0
  1. /**
  2.  * ExileServer_object_construction_database_load
  3.  *
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. private["_constructionID","_data","_position","_vectorDirection","_vectorUp","_constructionObject","_damageLevel","_public","_pinCode"];
  13. _constructionID = _this;
  14. _data = format ["loadConstruction:%1", _constructionID] call ExileServer_system_database_query_selectSingle;
  15. _position = [_data select 4, _data select 5, _data select 6];
  16. _vectorDirection = [_data select 7, _data select 8, _data select 9];
  17. _vectorUp = [_data select 10, _data select 11, _data select 12];
  18. _constructionObject = createVehicle [(_data select 1), _position, [], 0, "CAN_COLLIDE"];
  19. _constructionObject setPosATL _position;
  20. _constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp];
  21. _constructionObject setVariable ["ExileDatabaseID", _data select 0];
  22. _constructionObject setVariable ["ExileOwnerUID", (_data select 2)];
  23. _constructionObject setVariable ["ExileIsPersistent", true];
  24. _constructionObject setVariable ["ExileTerritoryID", (_data select 15)];
  25. _damageLevel = (_data select 17);
  26. _public = _damageLevel > 0;
  27. _constructionObject setVariable ["ExileConstructionDamage",_damageLevel,_public];
  28. if(_public)then
  29. {
  30.     _constructionObject call ExileServer_util_setDamageTexture;
  31. };
  32. _pinCode = _data select 14;
  33. if !(_pinCode isEqualTo "000000") then
  34. {
  35.     _constructionObject setVariable ["ExileAccessCode", _pinCode];
  36.     _constructionObject setVariable ["ExileIsLocked", (_data select 13), true];
  37. };
  38.  
  39. // 2017-03-16 + TEMPORARY WORKAROUND UNTIL EXILE UPDATE
  40. //if (getNumber(configFile >> "CfgVehicles" >> (_data select 1) >> "exileRequiresSimulation") isEqualTo 1) then
  41. //{
  42. //    _constructionObject enableSimulationGlobal true;
  43. //    _constructionObject call ExileServer_system_simulationMonitor_addVehicle;
  44. //}
  45. //else
  46. //{
  47. //    _constructionObject enableSimulationGlobal false;
  48. //};
  49.  
  50. if (typeOf _constructionObject in [
  51.                                     "Exile_Construction_ConcreteDoor_Static",
  52.                                     "Exile_Construction_ConcreteGate_Static",
  53.                                     "Exile_Construction_WoodGate_Static",
  54.                                     "Exile_Construction_WoodDoor_Static",
  55.                                     "Exile_Construction_ConcreteWindowHatch_Static",
  56.                                     "Exile_Construction_WoodGate_Reinforced_Static",
  57.                                     "Exile_Construction_WoodDoor_Reinforced_Static",
  58.                                     "Exile_Construction_ConcreteFloorHatch_Static",
  59.                                     "Land_Stone_Gate_F",
  60.                                     "Exile_Construction_Laptop_Static",
  61.                                     "Exile_Construction_CampFire_Static",
  62.                                     "Exile_Construction_PortableGenerator_Static",
  63.                                     "Exile_Construction_BaseCamera_Static",
  64.                                     "Exile_Construction_FloodLight_Static",
  65.                                     "Exile_ConcreteMixer",
  66.                                     "Land_City_Gate_F",
  67.                                     "Land_BarGate_F",
  68.                                     "Land_Cargo_Patrol_V2_F",
  69.                                     "Land_Cargo_Tower_V2_F",
  70.                                     "Land_FuelStation_Feed_F",
  71.                                     "Land_Cargo_House_V2_F",
  72.                                     "Land_i_Garage_V2_F",
  73.                                     "Land_ToiletBox_F",
  74.                                     "Land_Dome_Big_F",
  75.                                     "Land_spp_Tower_F",
  76.                                     "Land_Airport_Tower_F",
  77.                                     "Land_i_Barracks_V1_F",
  78.                                     "Land_TTowerSmall_1_F",
  79.                                     "Land_i_House_Small_03_V1_F",
  80.                                     "Land_i_House_Big_01_V2_F",
  81.                                     "Land_PlasticCase_01_medium_F",
  82.                                     "Land_Research_HQ_F",
  83.                                     "Land_Research_house_V1_F",
  84.                                     "Exile_Construction_ConcreteDoor_Static",
  85.                                     "Exile_Construction_WoodDrawBridge_Reinforced_Static",
  86.                                     "Exile_Construction_WoodDrawBridge_Static",
  87.                                     "EBM_Brickwall_window",
  88.                                     "EBM_Brickwall_floorport_door",
  89.                                     "EBM_Brickwall_door",
  90.                                     "EBM_Metalwall_floorport_door",
  91.                                     "EBM_Metalwall_window",
  92.                                     "EBM_Metalwall_door",
  93.                                     "Land_MetalCase_01_large_F",
  94.                                     "Land_Stone_Gate_F",
  95.                                     "Land_LampHalogen_F",
  96.                                     "Land_LampAirport_F",
  97.                                     "Land_LampStreet_F",
  98.                                     "Land_LampShabby_F",
  99.                                     "Land_City_Gate_F",
  100.                                     "Land_BarGate_F",
  101.                                     "Land_Bunker_F",
  102.                                     "Land_Airport_01_hangar_F",
  103.                                     "Land_BarGate_F",
  104.                                     "B_Slingload_01_fuel_F",
  105.                                     "B_Slingload_01_Ammo_F",
  106.                                     "Land_PortableLight_double_F"
  107.                                 ]) then
  108. {
  109.     _constructionObject enableSimulationGlobal true;
  110.     _constructionObject call ExileServer_system_simulationMonitor_addVehicle;
  111. }
  112. else
  113. {
  114.     _constructionObject enableSimulationGlobal false;
  115. };
  116.  
  117. // 2017-03-16 - TEMPORARY WORKAROUND UNTIL EXILE UPDATE
  118.  
  119. _constructionObject setVelocity [0, 0, 0];
  120. _constructionObject setPosATL _position;
  121. _constructionObject setVelocity [0, 0, 0];
  122. _constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp];
  123. _constructionObject setVelocity [0, 0, 0];
  124. _constructionObject
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement