Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 53.63 KB | None | 0 0
  1. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  3. <client side mission directory>\custom\PlotForLifev2\player_build.sqf
  4. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  5. /*
  6.     DayZ Base Building
  7.     Made for DayZ Epoch please ask permission to use/edit/distrubute email [email protected].
  8. */
  9. private ["_helperColor","_objectHelper","_objectHelperDir","_objectHelperPos","_canDo", "_pos", "_cnt","_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole","_distance","_classnametmp","_ghost","_isPole","_needText","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_need","_needNear","_vehicle","_inVehicle","_requireplot","_objHDiff","_isLandFireDZ","_isTankTrap","_ownerPUID", "_playerUID"];
  10.  
  11. if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_40") , "PLAIN DOWN"]; };
  12. DZE_ActionInProgress = true;
  13.  
  14. //snap vars -- temporary fix for errors so variables.sqf can be skipped
  15. if (isNil "snapProVariables") then {
  16.     if (isNil "DZE_snapExtraRange") then {
  17.         DZE_snapExtraRange = 0;
  18.     };
  19.     if (isNil "DZE_checkNearbyRadius") then {
  20.         DZE_checkNearbyRadius = 30;
  21.     };
  22.     s_player_toggleSnap = -1;
  23.     s_player_toggleSnapSelect = -1;
  24.     s_player_toggleSnapSelectPoint=[];
  25.     snapActions = -1;
  26.     snapGizmos = [];
  27.     snapGizmosNearby = [];
  28.     snapProVariables = true; // will skip this statement from now on.
  29. };
  30. // snap vars
  31.  
  32. // disallow building if too many objects are found within (30m by default) add DZE_checkNearbyRadius = 30; to your init.sqf to change
  33. _pos = [player] call FNC_GetPos;
  34. _cnt = count (_pos nearObjects ["All",DZE_checkNearbyRadius]);
  35.  if (_cnt >= DZE_BuildingLimit) exitWith { //end script if too many objects nearby
  36.     DZE_ActionInProgress = false;
  37.     cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];
  38.  };
  39.  
  40. _onLadder =     (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  41. _isWater =      dayz_isSwimming;
  42. _cancel = false;
  43. _reason = "";
  44. _canBuildOnPlot = false;
  45.  
  46. _vehicle = vehicle player;
  47. _inVehicle = (_vehicle != player);
  48.  
  49. _playerUID = getPlayerUID player;
  50.  
  51. helperDetach = false;
  52. _canDo = (!r_drag_sqf and !r_player_unconscious);
  53.  
  54. DZE_Q = false;
  55. DZE_Z = false;
  56.  
  57. DZE_Q_alt = false;
  58. DZE_Z_alt = false;
  59.  
  60. DZE_Q_ctrl = false;
  61. DZE_Z_ctrl = false;
  62.  
  63. DZE_5 = false;
  64. DZE_4 = false;
  65. DZE_6 = false;
  66. DZE_F = false;
  67.  
  68. DZE_cancelBuilding = false;
  69.  
  70. call gear_ui_init;
  71. closeDialog 1;
  72.  
  73. if (_isWater) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_26", "PLAIN DOWN"];};
  74. if (_inVehicle) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"];};
  75. if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"];};
  76. if (player getVariable["combattimeout", 0] >= time) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_43"), "PLAIN DOWN"];};
  77.  
  78. _item = _this;
  79.  
  80. // Need Near Requirements
  81. _abort = false;
  82. _reason = "";
  83.  
  84. _needNear =     getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "neednearby");
  85.  
  86. {
  87.     switch(_x) do{
  88.         case "fire":
  89.         {
  90.             _distance = 3;
  91.             _isNear = {inflamed _x} count (_pos nearObjects _distance);
  92.             if(_isNear == 0) then {
  93.                 _abort = true;
  94.                 _reason = "fire";
  95.             };
  96.         };
  97.         case "workshop":
  98.         {
  99.             _distance = 3;
  100.             _isNear = count (nearestObjects [_pos, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
  101.             if(_isNear == 0) then {
  102.                 _abort = true;
  103.                 _reason = "workshop";
  104.             };
  105.         };
  106.         case "fueltank":
  107.         {
  108.             _distance = 30;
  109.             _isNear = count (nearestObjects [_pos, dayz_fuelsources, _distance]);
  110.             if(_isNear == 0) then {
  111.                 _abort = true;
  112.                 _reason = "fuel tank";
  113.             };
  114.         };
  115.     };
  116. } forEach _needNear;
  117.  
  118.  
  119. if(_abort) exitWith {
  120.     cutText [format[(localize "str_epoch_player_135"),_reason,_distance], "PLAIN DOWN"];
  121.     DZE_ActionInProgress = false;
  122. };
  123.  
  124. _classname =    getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
  125. _classnametmp = _classname;
  126. _require =  getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
  127. _text =         getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
  128. _ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
  129.  
  130. _lockable = 0;
  131. if(isNumber (configFile >> "CfgVehicles" >> _classname >> "lockable")) then {
  132.     _lockable = getNumber(configFile >> "CfgVehicles" >> _classname >> "lockable");
  133. };
  134.  
  135. _requireplot = DZE_requireplot;
  136. if(isNumber (configFile >> "CfgVehicles" >> _classname >> "requireplot")) then {
  137.     _requireplot = getNumber(configFile >> "CfgVehicles" >> _classname >> "requireplot");
  138. };
  139.  
  140. _isAllowedUnderGround = 1;
  141. if(isNumber (configFile >> "CfgVehicles" >> _classname >> "nounderground")) then {
  142.     _isAllowedUnderGround = getNumber(configFile >> "CfgVehicles" >> _classname >> "nounderground");
  143. };
  144.  
  145. _offset =   getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
  146. if((count _offset) <= 0) then {
  147.     _offset = [0,1.5,0];
  148. };
  149.  
  150. _isPole = (_classname == "Plastic_Pole_EP1_DZ");
  151. _isLandFireDZ = (_classname == "Land_Fire_DZ");
  152.  
  153. _distance = DZE_PlotPole select 0;
  154. _needText = localize "str_epoch_player_246";
  155.  
  156. if(_isPole) then {
  157.     _distance = DZE_PlotPole select 1;
  158. };
  159.  
  160. // check for near plot
  161. _findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
  162. _findNearestPole = [];
  163.  
  164. {
  165.     if (alive _x) then {
  166.         _findNearestPole set [(count _findNearestPole),_x];
  167.     };
  168. } count _findNearestPoles;
  169.  
  170. _IsNearPlot = count (_findNearestPole);
  171.  
  172. // If item is plot pole && another one exists within 45m
  173. if(_isPole && _IsNearPlot > 0) exitWith {  DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; };
  174.  
  175. if(_IsNearPlot == 0) then {
  176.  
  177.     // Allow building of plot
  178.     if(_requireplot == 0 || _isLandFireDZ) then {
  179.         _canBuildOnPlot = true;
  180.     };
  181.  
  182. } else {
  183.     // Since there are plots nearby we check for ownership && then for friend status
  184.  
  185.     // check nearby plots ownership && then for friend status
  186.     _nearestPole = _findNearestPole select 0;
  187.  
  188.     // Find owner
  189.     _ownerID = _nearestPole getVariable ["ownerPUID","0"];
  190.  
  191.      diag_log format["Player_build start: [PlayerUID = %1]  [OwnerID = %2]", _playerUID, _ownerID];
  192.  
  193.     // check if friendly to owner
  194.     if(_playerUID == _ownerID) then {  //Keep ownership
  195.         // owner can build anything within his plot except other plots
  196.         diag_log text "Player is owner";
  197.         if(!_isPole) then {
  198.             _canBuildOnPlot = true;
  199.         };
  200.  
  201.     } else {
  202.         // disallow building plot
  203.         if(!_isPole) then {
  204. _friendlies = _nearestPole getVariable ["plotfriends",[]];
  205. _fuid  = [];
  206. {
  207.       _friendUID = _x select 0;
  208.       _fuid  =  _fuid  + [_friendUID];
  209. } forEach _friendlies;
  210. _builder  = getPlayerUID player;
  211. // check if friendly to owner
  212. if(_builder in _fuid) then {
  213.     _canBuildOnPlot = true;
  214. };  
  215.         };
  216.     };
  217. };
  218.  
  219. // _message
  220. if(!_canBuildOnPlot) exitWith {  DZE_ActionInProgress = false; cutText [format[(localize "STR_EPOCH_PLAYER_135"),_needText,_distance] , "PLAIN DOWN"]; };
  221.  
  222. _missing = "";
  223. _hasrequireditem = true;
  224. {
  225.     _hastoolweapon = _x in weapons player;
  226.     if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); };
  227. } count _require;
  228.  
  229. _hasbuilditem = _this in magazines player;
  230. if (!_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; };
  231.  
  232. if (!_hasrequireditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_137"),_missing] , "PLAIN DOWN"]; };
  233. if (_hasrequireditem) then {
  234.  
  235.     _location = [0,0,0];
  236.     _isOk = true;
  237.  
  238.     // get inital players position
  239.     _location1 = [player] call FNC_GetPos;
  240.     _dir = getDir player;
  241.  
  242.     // if ghost preview available use that instead
  243.     if (_ghost != "") then {
  244.         _classname = _ghost;
  245.     };
  246.  
  247.     _object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
  248.     //Build gizmo
  249.     _objectHelper = "Sign_sphere10cm_EP1" createVehicle _location;
  250.     _helperColor = "#(argb,8,8,3)color(0,0,0,0,ca)";
  251.     _objectHelper setobjecttexture [0,_helperColor];
  252.     _objectHelper attachTo [player,_offset];
  253.     _object attachTo [_objectHelper,[0,0,0]];
  254.     _position = [_objectHelper] call FNC_GetPos;
  255.    
  256.     _objHDiff = 0;
  257.  
  258. if (isClass (missionConfigFile >> "SnapBuilding" >> _classname)) then {
  259.     ["","","",["Init",_object,_classname,_objectHelper]] spawn snap_build;
  260. };
  261.    
  262.     while {_isOk} do {
  263.  
  264.         _zheightchanged = false;
  265.         _zheightdirection = "";
  266.         _rotate = false;
  267.  
  268.         if (DZE_Q) then {
  269.             DZE_Q = false;
  270.             _zheightdirection = "up";
  271.             _zheightchanged = true;
  272.         };
  273.         if (DZE_Z) then {
  274.             DZE_Z = false;
  275.             _zheightdirection = "down";
  276.             _zheightchanged = true;
  277.         };
  278.         if (DZE_Q_alt) then {
  279.             DZE_Q_alt = false;
  280.             _zheightdirection = "up_alt";
  281.             _zheightchanged = true;
  282.         };
  283.         if (DZE_Z_alt) then {
  284.             DZE_Z_alt = false;
  285.             _zheightdirection = "down_alt";
  286.             _zheightchanged = true;
  287.         };
  288.         if (DZE_Q_ctrl) then {
  289.             DZE_Q_ctrl = false;
  290.             _zheightdirection = "up_ctrl";
  291.             _zheightchanged = true;
  292.         };
  293.         if (DZE_Z_ctrl) then {
  294.             DZE_Z_ctrl = false;
  295.             _zheightdirection = "down_ctrl";
  296.             _zheightchanged = true;
  297.         };
  298.         if (DZE_4) then {
  299.             _rotate = true;
  300.             DZE_4 = false;
  301.             _dir = -45;
  302.         };
  303.         if (DZE_6) then {
  304.             _rotate = true;
  305.             DZE_6 = false;
  306.             _dir = 45;
  307.         };
  308.        
  309.         if (DZE_F and _canDo) then {   
  310.             if (helperDetach) then {
  311.                 _objectHelperDir = getDir _objectHelper;
  312.                 _objectHelper attachTo [player];
  313.                 _objectHelper setDir _objectHelperDir-(getDir player);
  314.                 helperDetach = false;
  315.             } else {
  316.                 _objectHelperDir = getDir _objectHelper;
  317.                 detach _objectHelper;
  318.                 [_objectHelper] call FNC_GetSetPos;
  319.                 _objectHelper setVelocity [0,0,0]; //fix sliding glitch
  320.                 helperDetach = true;
  321.             };
  322.             DZE_F = false;
  323.         };
  324.  
  325.         if(_rotate) then {
  326.             if (helperDetach) then {
  327.                 _objectHelperDir = getDir _objectHelper;
  328.                 _objectHelper setDir _objectHelperDir+_dir;
  329.                 [_objectHelper] call FNC_GetSetPos;
  330.             } else {
  331.                 detach _objectHelper;
  332.                 _objectHelperDir = getDir _objectHelper;
  333.                 _objectHelper setDir _objectHelperDir+_dir;
  334.                 [_objectHelper] call FNC_GetSetPos;
  335.                 _objectHelperDir = getDir _objectHelper;
  336.                 _objectHelper attachTo [player];
  337.                 _objectHelper setDir _objectHelperDir-(getDir player);     
  338.             };
  339.  
  340.         };
  341.  
  342.         if(_zheightchanged) then {
  343.             if (!helperDetach) then {
  344.                 detach _objectHelper;
  345.                 _objectHelperDir = getDir _objectHelper;
  346.             };
  347.  
  348.             _position = [_objectHelper] call FNC_GetPos;
  349.  
  350.             if(_zheightdirection == "up") then {
  351.                 _position set [2,((_position select 2)+0.1)];
  352.                 _objHDiff = _objHDiff + 0.1;
  353.             };
  354.             if(_zheightdirection == "down") then {
  355.                 _position set [2,((_position select 2)-0.1)];
  356.                 _objHDiff = _objHDiff - 0.1;
  357.             };
  358.  
  359.             if(_zheightdirection == "up_alt") then {
  360.                 _position set [2,((_position select 2)+1)];
  361.                 _objHDiff = _objHDiff + 1;
  362.             };
  363.             if(_zheightdirection == "down_alt") then {
  364.                 _position set [2,((_position select 2)-1)];
  365.                 _objHDiff = _objHDiff - 1;
  366.             };
  367.  
  368.             if(_zheightdirection == "up_ctrl") then {
  369.                 _position set [2,((_position select 2)+0.01)];
  370.                 _objHDiff = _objHDiff + 0.01;
  371.             };
  372.             if(_zheightdirection == "down_ctrl") then {
  373.                 _position set [2,((_position select 2)-0.01)];
  374.                 _objHDiff = _objHDiff - 0.01;
  375.             };
  376.  
  377.             if((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then {
  378.                 _position set [2,0];
  379.             };
  380.  
  381.             if (surfaceIsWater _position) then {
  382.                 _objectHelper setPosASL _position;
  383.             } else {
  384.                 _objectHelper setPosATL _position;
  385.             };
  386.  
  387.             if (!helperDetach) then {
  388.             _objectHelper attachTo [player];
  389.             _objectHelper setDir _objectHelperDir-(getDir player);
  390.             };
  391.         };
  392.  
  393.         sleep 0.5;
  394.  
  395.         _location2 = [player] call FNC_GetPos;
  396.         _objectHelperPos = [_objectHelper] call FNC_GetPos;
  397.  
  398.         if(DZE_5) exitWith {
  399.             _isOk = false;
  400.             _position = [_object] call FNC_GetPos;
  401.             detach _object;
  402.             _dir = getDir _object;
  403.             deleteVehicle _object;
  404.             detach _objectHelper;
  405.             deleteVehicle _objectHelper;
  406.         };
  407.  
  408.         if(_location1 distance _location2 > 10) exitWith {
  409.             _isOk = false;
  410.             _cancel = true;
  411.             _reason = "You've moved to far away from where you started building (within 10 meters)";
  412.             detach _object;
  413.             deleteVehicle _object;
  414.             detach _objectHelper;
  415.             deleteVehicle _objectHelper;
  416.         };
  417.        
  418.         if(_location1 distance _objectHelperPos > 10) exitWith {
  419.             _isOk = false;
  420.             _cancel = true;
  421.             _reason = "Object is placed to far away from where you started building (within 10 meters)";
  422.             detach _object;
  423.             deleteVehicle _object;
  424.             detach _objectHelper;
  425.             deleteVehicle _objectHelper;
  426.         };
  427.  
  428.         if(abs(_objHDiff) > 10) exitWith {
  429.             _isOk = false;
  430.             _cancel = true;
  431.             _reason = "Cannot move up or down more than 10 meters";
  432.             detach _object;
  433.             deleteVehicle _object;
  434.             detach _objectHelper;
  435.             deleteVehicle _objectHelper;
  436.         };
  437.  
  438.         if (player getVariable["combattimeout", 0] >= time) exitWith {
  439.             _isOk = false;
  440.             _cancel = true;
  441.             _reason = (localize "str_epoch_player_43");
  442.             detach _object;
  443.             deleteVehicle _object;
  444.             detach _objectHelper;
  445.             deleteVehicle _objectHelper;
  446.         };
  447.  
  448.         if (DZE_cancelBuilding) exitWith {
  449.             _isOk = false;
  450.             _cancel = true;
  451.             _reason = "Cancelled building.";
  452.             detach _object;
  453.             deleteVehicle _object;
  454.             detach _objectHelper;
  455.             deleteVehicle _objectHelper;
  456.         };
  457.     };
  458.  
  459.     //No building on roads unless toggled
  460.     if (!DZE_BuildOnRoads) then {
  461.         if (isOnRoad _position) then { _cancel = true; _reason = "Cannot build on a road."; };
  462.     };
  463.  
  464.     // No building in trader zones
  465.     if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
  466.  
  467.     if(!_cancel) then {
  468.  
  469.         _classname = _classnametmp;
  470.  
  471.         // Start Build
  472.         _tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
  473.  
  474.         _tmpbuilt setdir _dir;
  475.  
  476.         // Get position based on object
  477.         _location = _position;
  478.  
  479.         if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then {
  480.             _location set [2,0];
  481.         };
  482.  
  483.         if (surfaceIsWater _location) then {
  484.             _tmpbuilt setPosASL _location;
  485.             _location = ASLtoATL _location;
  486.         } else {
  487.             _tmpbuilt setPosATL _location;
  488.         };
  489.  
  490.         cutText [format[(localize "str_epoch_player_138"),_text], "PLAIN DOWN"];
  491.  
  492.         _limit = 3;
  493.  
  494.         if (DZE_StaticConstructionCount > 0) then {
  495.             _limit = DZE_StaticConstructionCount;
  496.         }
  497.         else {
  498.             if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then {
  499.                 _limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount");
  500.             };
  501.         };
  502.  
  503.         _isOk = true;
  504.         _proceed = false;
  505.         _counter = 0;
  506.  
  507.         while {_isOk} do {
  508.  
  509.             [10,10] call dayz_HungerThirst;
  510.             player playActionNow "Medic";
  511.  
  512.             _dis=20;
  513.             _sfx = "repair";
  514.             [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
  515.             [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
  516.  
  517.             r_interrupt = false;
  518.             r_doLoop = true;
  519.             _started = false;
  520.             _finished = false;
  521.  
  522.             while {r_doLoop} do {
  523.                 _animState = animationState player;
  524.                 _isMedic = ["medic",_animState] call fnc_inString;
  525.                 if (_isMedic) then {
  526.                     _started = true;
  527.                 };
  528.                 if (_started && !_isMedic) then {
  529.                     r_doLoop = false;
  530.                     _finished = true;
  531.                 };
  532.                 if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then {
  533.                     r_doLoop = false;
  534.                 };
  535.                 if (DZE_cancelBuilding) exitWith {
  536.                     r_doLoop = false;
  537.                 };
  538.                 sleep 0.1;
  539.             };
  540.             r_doLoop = false;
  541.  
  542.  
  543.             if(!_finished) exitWith {
  544.                 _isOk = false;
  545.                 _proceed = false;
  546.             };
  547.  
  548.             if(_finished) then {
  549.                 _counter = _counter + 1;
  550.             };
  551.  
  552.             cutText [format[(localize "str_epoch_player_139"),_text, _counter,_limit], "PLAIN DOWN"];
  553.  
  554.             if(_counter == _limit) exitWith {
  555.                 _isOk = false;
  556.                 _proceed = true;
  557.             };
  558.  
  559.         };
  560.  
  561.         if (_proceed) then {
  562.  
  563.             _num_removed = ([player,_item] call BIS_fnc_invRemove);
  564.             if(_num_removed == 1) then {
  565.  
  566.                 cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
  567.  
  568.                 if (_isPole) then {
  569.                     [] spawn player_plotPreview;
  570.                 };
  571.  
  572.                 _tmpbuilt setVariable ["OEMPos",_location,true];
  573.  
  574.                 if(_lockable > 1) then {
  575.  
  576.                     _combinationDisplay = "";
  577.  
  578.                     switch (_lockable) do {
  579.  
  580.                         case 2: { // 2 lockbox
  581.                             _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue
  582.                             _combination_2 = floor(random 10);
  583.                             _combination_3 = floor(random 10);
  584.                             _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3];
  585.                             dayz_combination = _combination;
  586.                             if (_combination_1 == 100) then {
  587.                                 _combination_1_Display = "Red";
  588.                             };
  589.                             if (_combination_1 == 101) then {
  590.                                 _combination_1_Display = "Green";
  591.                             };
  592.                             if (_combination_1 == 102) then {
  593.                                 _combination_1_Display = "Blue";
  594.                             };
  595.                             _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3];
  596.                         };
  597.  
  598.                         case 3: { // 3 combolock
  599.                             _combination_1 = floor(random 10);
  600.                             _combination_2 = floor(random 10);
  601.                             _combination_3 = floor(random 10);
  602.                             _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3];
  603.                             dayz_combination = _combination;
  604.                             _combinationDisplay = _combination;
  605.                         };
  606.  
  607.                         case 4: { // 4 safe
  608.                             _combination_1 = floor(random 10);
  609.                             _combination_2 = floor(random 10);
  610.                             _combination_3 = floor(random 10);
  611.                             _combination_4 = floor(random 10);
  612.                             _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4];
  613.                             dayz_combination = _combination;
  614.                             _combinationDisplay = _combination;
  615.                         };
  616.                     };
  617.  
  618.                     _tmpbuilt setVariable ["CharacterID",_combination,true];
  619.                     _tmpbuilt setVariable ["ownerPUID",_playerUID,true];
  620.  
  621.  
  622.                     PVDZE_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,_playerUID],_classname];
  623.                     publicVariableServer "PVDZE_obj_Publish";
  624.  
  625.                     cutText [format[(localize "str_epoch_player_140"),_combinationDisplay,_text], "PLAIN DOWN", 5];
  626.  
  627.  
  628.                 } else {
  629.                     _tmpbuilt setVariable ["CharacterID",dayz_characterID,true];
  630.                     _tmpbuilt setVariable ["ownerPUID",_playerUID,true];
  631.                    
  632.                     // fire?
  633.                     if(_tmpbuilt isKindOf "Land_Fire_DZ") then {
  634.                         _tmpbuilt spawn player_fireMonitor;
  635.                     } else {
  636.                         PVDZE_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,_playerUID],_classname];
  637.                         publicVariableServer "PVDZE_obj_Publish";
  638.                     };
  639.                 };
  640.             } else {
  641.                 deleteVehicle _tmpbuilt;
  642.                 cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"];
  643.             };
  644.  
  645.         } else {
  646.             r_interrupt = false;
  647.             if (vehicle player == player) then {
  648.                 [objNull, player, rSwitchMove,""] call RE;
  649.                 player playActionNow "stop";
  650.             };
  651.  
  652.             deleteVehicle _tmpbuilt;
  653.  
  654.             cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"];
  655.         };
  656.  
  657.     } else {
  658.         cutText [format[(localize "str_epoch_player_47"),_text,_reason], "PLAIN DOWN"];
  659.     };
  660. };
  661.  
  662. DZE_ActionInProgress = false;
  663. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  680. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  681. <client side mission directory>\custom\actions\dayz_spaceInterrupt.sqf
  682. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  683.  
  684. private ["_dikCode","_handled","_primaryWeapon","_secondaryWeapon","_nearbyObjects","_nill","_shift","_ctrl","_alt","_dropPrimary","_dropSecondary","_iItem","_removed","_iPos","_radius","_item"];
  685. _dikCode =  _this select 1;
  686.  
  687. _handled = false;
  688.  
  689. if (_dikCode in[0x02,0x03,0x04,0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
  690.     _handled = true;
  691. };
  692.  
  693. if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3)) then {
  694.     if(diag_tickTime - dayz_lastCheckBit > 10) then {
  695.         dayz_lastCheckBit = diag_tickTime;
  696.         call dayz_forceSave;
  697.     };
  698.     call dayz_EjectPlayer;
  699. };
  700.  
  701. // esc
  702. if (_dikCode == 0x01) then {
  703.     DZE_cancelBuilding = true;
  704.     call dayz_EjectPlayer;
  705. };
  706. // Disable ESC after death
  707. if (_dikCode == 0x01 && r_player_dead) then {
  708.     _handled = true;
  709. };
  710.  
  711. // surrender
  712. if (_dikCode in actionKeys "Surrender") then {
  713.    
  714.     _vehicle = vehicle player;
  715.     _inVehicle = (_vehicle != player);
  716.     _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  717.     _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder and !_inVehicle);
  718.    
  719.     if (_canDo and !DZE_Surrender and !(player isKindOf  "PZombie_VB")) then {
  720.         DZE_Surrender = true;
  721.         _dropPrimary = false;
  722.         _dropSecondary = false;
  723.  
  724.         _primaryWeapon = primaryWeapon player;
  725.         if (_primaryWeapon != "") then {_dropPrimary = true;};
  726.         _secondaryWeapon = "";
  727.         {
  728.             if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith {
  729.                     _secondaryWeapon = _x;
  730.             };
  731.         } forEach (weapons player);
  732.         if (_secondaryWeapon != "") then {_dropSecondary = true;};
  733.  
  734.         if (_dropPrimary or _dropSecondary) then {
  735.             player playActionNow "PutDown";
  736.             _iPos = getPosATL player;
  737.             _radius = 1;
  738.             _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
  739.             _item setposATL _iPos;
  740.             if (_dropPrimary) then {
  741.                 _iItem = _primaryWeapon;
  742.                 _removed = ([player,_iItem,1] call BIS_fnc_invRemove);
  743.                 if (_removed == 1) then {
  744.                     _item addWeaponCargoGlobal [_iItem,1];
  745.                 };
  746.             };
  747.             if (_dropSecondary) then {
  748.                 _iItem = _secondaryWeapon;
  749.                 _removed = ([player,_iItem,1] call BIS_fnc_invRemove);
  750.                 if (_removed == 1) then {
  751.                     _item addWeaponCargoGlobal [_iItem,1];
  752.                 };
  753.             };
  754.             player reveal _item;
  755.         };
  756.  
  757.         // set publicvariable that allows other player to access gear
  758.         player setVariable ["DZE_Surrendered", true, true];
  759.         // surrender animation
  760.         player playMove "AmovPercMstpSsurWnonDnon";
  761.     };
  762.     _handled = true;
  763. };
  764.  
  765. if (_dikCode in actionKeys "MoveForward") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
  766. if (_dikCode in actionKeys "MoveLeft") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
  767. if (_dikCode in actionKeys "MoveRight") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
  768. if (_dikCode in actionKeys "MoveBack") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
  769.  
  770. //Prevent exploit of drag body
  771. if ((_dikCode in actionKeys "Prone") and r_drag_sqf) exitWith { force_dropBody = true; };
  772. if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) exitWith { force_dropBody = true; };
  773.  
  774. _shift =    _this select 2;
  775. _ctrl =     _this select 3;
  776. _alt =      _this select 4;
  777.  
  778. //diag_log format["Keypress: %1", _this];
  779. if ((_dikCode in actionKeys "Gear") and (vehicle player != player) and !_shift and !_ctrl and !_alt && !dialog) then {
  780.             createGearDialog [player, "RscDisplayGear"];
  781.             _handled = true;
  782. };
  783.  
  784. if (_dikCode in (actionKeys "GetOver")) then {
  785.    
  786.     if (player isKindOf  "PZombie_VB") then {
  787.         _handled = true;
  788.         DZE_PZATTACK = true;
  789.     } else {
  790.         _nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
  791.         if (count _nearbyObjects > 0) then {
  792.             if((diag_tickTime - dayz_lastCheckBit > 4)) then {
  793.                 [objNull, player, rSwitchMove,"GetOver"] call RE;
  794.                 player playActionNow "GetOver";
  795.                 dayz_lastCheckBit = diag_tickTime;
  796.             } else {
  797.                 _handled = true;
  798.             };
  799.         };
  800.     };
  801. };
  802. //if (_dikCode == 57) then {_handled = true}; // space
  803. //if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
  804. if (_dikCode == 210) then {
  805.     if (isNil 'debugMonitor') then {
  806.         debugMonitor = false;
  807.         _nill = execvm "custom\debug_monitor\debug_monitor.sqf";
  808.     } else {
  809.         debugMonitor = !debugMonitor;
  810.         hintSilent '';
  811.         _nill = execvm "custom\debug_monitor\debug_monitor.sqf";
  812.     };
  813. };
  814.  
  815. if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
  816. if (_dikCode in actionKeys "PushToTalk" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
  817.     dayz_lastCheckBit = diag_tickTime;
  818.     [player,50,true,(getPosATL player)] spawn player_alertZombies;
  819. };
  820. if (_dikCode in actionKeys "VoiceOverNet" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
  821.     dayz_lastCheckBit = diag_tickTime;
  822.     [player,50,true,(getPosATL player)] spawn player_alertZombies;
  823. };
  824. if (_dikCode in actionKeys "PushToTalkDirect" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
  825.     dayz_lastCheckBit = diag_tickTime;
  826.     [player,15,false,(getPosATL player)] spawn player_alertZombies;
  827. };
  828. if (_dikCode in actionKeys "Chat" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
  829.     dayz_lastCheckBit = diag_tickTime;
  830.     [player,15,false,(getPosATL player)] spawn player_alertZombies;
  831. };
  832. /*
  833. if (_dikCode in actionKeys "User20" && (diag_tickTime - dayz_lastCheckBit > 5)) then {
  834.     dayz_lastCheckBit = diag_tickTime;
  835.     _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
  836. };
  837. */
  838. // numpad 8 0x48 now pgup 0xC9 1
  839. if ((_dikCode == 0xC9 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User15")) then {
  840.     DZE_Q = true;
  841. };
  842. // numpad 2 0x50 now pgdn 0xD1
  843. if ((_dikCode == 0xD1 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User16")) then {
  844.     DZE_Z = true;
  845. };
  846.  
  847.  
  848. // numpad 8 0x48 now pgup 0xC9 0.1
  849. if ((_dikCode == 0xC9 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User13")) then {
  850.     DZE_Q_alt = true;
  851. };
  852. // numpad 2 0x50 now pgdn 0xD1
  853. if ((_dikCode == 0xD1 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User14")) then {
  854.     DZE_Z_alt = true;
  855. };
  856.  
  857.  
  858. // numpad 8 0x48 now pgup 0xC9 0.01
  859. if ((_dikCode == 0xC9 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User7")) then {
  860.     DZE_Q_ctrl = true;
  861. };
  862. // numpad 2 0x50 now pgdn 0xD1
  863. if ((_dikCode == 0xD1 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User8")) then {
  864.     DZE_Z_ctrl = true;
  865. };
  866.  
  867.  
  868.  
  869.  
  870. // numpad 4 0x4B now Q 0x10
  871. if (_dikCode == 0x10 or (_dikCode in actionKeys "User17")) then {
  872.     DZE_4 = true;
  873. };     
  874. // numpad 6 0x4D now E 0x12
  875. if (_dikCode == 0x12 or (_dikCode in actionKeys "User18")) then {
  876.     DZE_6 = true;
  877. };
  878. // numpad 5 0x4C now space 0x39
  879. if (_dikCode == 0x39 or (_dikCode in actionKeys "User19")) then {
  880.     DZE_5 = true;
  881. };
  882.  
  883. // F key
  884. if ((_dikCode == 0x21 and (!_alt and !_ctrl)) or (_dikCode in actionKeys "User6")) then {
  885.     DZE_F = true;
  886. };
  887.  
  888. // manually kick in admin mode if it doesnt load
  889. if (_dikCode == 0x43) then {
  890. [] execVM "admintools\AdminList.sqf";
  891. [] execVM "admintools\Activate.sqf";
  892. cutText ['LOADING ADMINTOOLS!','WHITE IN'];
  893. };
  894.  
  895. _handled
  896. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  913. <client side mission directory>\custom\snap_pro\_not_in_use_here.dayz_spaceInterrupt.sqf
  914. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  931. <client side mission directory>\custom\snap_pro\_not_in_use_here.player_build.sqf
  932. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  949.  
  950. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  951. <client side mission directory>\custom\snap_pro\snap_build.sqf
  952. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  953. /*-----------------------------------------------------------*/
  954. // Created by Raymix
  955. // Last update - August 21 2014
  956. /*-----------------------------------------------------------*/
  957.  
  958. private ["_object","_objectSnapGizmo","_objColorActive","_objColorInactive","_classname","_whitelist","_points","_radius","_cfg","_cnt","_pos","_findWhitelisted","_nearbyObject","_posNearby","_selectedAction","_newPos","_pointsNearby","_onWater","_waterBase"];
  959. //Args
  960. snapActionState = _this select 3 select 0;
  961. _object = _this select 3 select 1;
  962. _classname = _this select 3 select 2;
  963. _objectHelper = _this select 3 select 3;
  964. _selectedAction = _this select 3 select 4;
  965.  
  966. //Snap config file
  967. _cfg = (missionConfigFile >> "SnapBuilding" >> _classname);
  968. _whitelist = getArray (_cfg >> "snapTo");
  969. _points = getArray (_cfg >> "points");
  970. _radius = getNumber (_cfg >> "radius");
  971.  
  972. //colors
  973. _objColorActive = "#(argb,8,8,3)color(0,0.92,0.06,1,ca)";
  974. _objColorInactive = "#(argb,8,8,3)color(0.04,0.84,0.92,0.3,ca)";
  975.  
  976.  
  977. fnc_snapActionCleanup = {
  978.     private ["_s1","_s2","_s3","_cnt"];
  979.     _s1 = _this select 0;
  980.     _s2 = _this select 1;
  981.     _s3 = _this select 2;
  982.     player removeAction s_player_toggleSnap; s_player_toggleSnap = -1;
  983.     player removeAction s_player_toggleSnapSelect; s_player_toggleSnapSelect = -1;
  984.     if (count s_player_toggleSnapSelectPoint != 0) then {{player removeAction _x;} count s_player_toggleSnapSelectPoint; s_player_toggleSnapSelectPoint=[]; snapActions = -1;};
  985.     if (_s1 > 0) then {
  986.         s_player_toggleSnap = player addaction [format[("<t color=""#ffffff"">" + ("Snap: %1") +"</t>"),snapActionState],"custom\snap_pro\snap_build.sqf",[snapActionState,_object,_classname,_objectHelper],6,false,true];
  987.     };
  988.     if (_s2 > 0) then {
  989.         s_player_toggleSnapSelect = player addaction [format[("<t color=""#ffffff"">" + ("Snap Point: %1") +"</t>"),snapActionStateSelect],"custom\snap_pro\snap_build.sqf",[snapActionStateSelect,_object,_classname,_objectHelper],5,false,true];
  990.     };
  991.     if (_s3 > 0) then {
  992.         s_player_toggleSnapSelectPoint=[];
  993.         _cnt = 0;
  994.         {snapActions = player addaction [format[("<t color=""#ffffff"">" + ("%1)Select: %2") +"</t>"),_cnt,_x select 3],"custom\snap_pro\snap_build.sqf",["Selected",_object,_classname,_objectHelper,_cnt],4,false,false];
  995.         s_player_toggleSnapSelectPoint set [count s_player_toggleSnapSelectPoint,snapActions];
  996.         _cnt = _cnt+1;
  997.     }count _points;
  998.     };
  999. };
  1000.  
  1001. fnc_initSnapPoints = {
  1002.     snapGizmos = [];
  1003.     {
  1004.         _objectSnapGizmo = "Sign_sphere10cm_EP1" createVehicleLocal [0,0,0];
  1005.         _objectSnapGizmo setobjecttexture [0,_objColorInactive];
  1006.         _objectSnapGizmo attachTo [_object,[_x select 0,_x select 1,_x select 2]];
  1007.         snapGizmos set [count snapGizmos,_objectSnapGizmo];
  1008.     } count _points;
  1009. };
  1010.  
  1011. fnc_initSnapPointsNearby = {
  1012.     _pos = [_object] call FNC_GetPos;
  1013.     _findWhitelisted = []; _pointsNearby = [];
  1014.     _findWhitelisted = nearestObjects [_pos,_whitelist,(_radius + DZE_snapExtraRange)]-[_object];
  1015.     snapGizmosNearby = []; 
  1016.     {  
  1017.         _nearbyObject = _x;
  1018.         _pointsNearby = getArray (missionConfigFile >> "SnapBuilding" >> (typeOf _x) >> "points");
  1019.         {
  1020.             _objectSnapGizmo = "Sign_sphere10cm_EP1" createVehicleLocal [0,0,0];
  1021.             _objectSnapGizmo setobjecttexture [0,_objColorInactive];
  1022.             _objectSnapGizmo setDir (getDir _nearbyObject);
  1023.             _posNearby = _nearbyObject modelToWorld [_x select 0,_x select 1,_x select 2];
  1024.             if (surfaceIsWater _posNearby) then {
  1025.                 _objectSnapGizmo setPosASL [(_posNearby) select 0,(_posNearby) select 1,(getPosASL _nearbyObject select 2) + (_x select 2)];
  1026.             } else {
  1027.                 _objectSnapGizmo setPosATL _posNearby;
  1028.             };
  1029.             snapGizmosNearby set [count snapGizmosNearby,_objectSnapGizmo];
  1030.         } count _pointsNearby;
  1031.     } forEach _findWhitelisted;
  1032. };
  1033.  
  1034. fnc_initSnapPointsCleanup = {
  1035.     {detach _x;deleteVehicle _x;}count snapGizmos;snapGizmos=[];
  1036.     {detach _x;deleteVehicle _x;}count snapGizmosNearby;snapGizmosNearby=[];
  1037.     snapActionState = "OFF";
  1038. };
  1039.  
  1040. fnc_snapDistanceCheck = {
  1041.     while {snapActionState != "OFF"} do {
  1042.     private ["_distClosestPointFound","_distCheck","_distClosest","_distClosestPoint","_testXPos","_testXDir","_distClosestPointFoundPos","_distClosestPointFoundDir","_distClosestAttached","_distCheckAttached","_distClosestAttachedFoundPos"];
  1043.     _distClosestPointFound = objNull; _distCheck = 0; _distClosest = 10; _distClosestPoint = objNull; _testXPos = []; _distClosestPointFoundPos =[]; _distClosestPointFoundDir = 0;
  1044.         {  
  1045.             if (_x !=_distClosestPointFound) then {_x setobjecttexture [0,_objColorInactive];};
  1046.             _testXPos = [_x] call FNC_GetPos;
  1047.             _distCheck = _objectHelper distance _testXPos;
  1048.             _distClosestPoint = _x;
  1049.                 if (_distCheck < _distClosest) then {
  1050.                     _distClosest = _distCheck;
  1051.                     _distClosestPointFound setobjecttexture [0,_objColorInactive];
  1052.                     _distClosestPointFound = _x;
  1053.                     _distClosestPointFound setobjecttexture [0,_objColorActive];
  1054.                 };
  1055.         } count snapGizmosNearby;  
  1056.        
  1057.         if (!isNull _distClosestPointFound) then {
  1058.             if (snapActionStateSelect == "Manual") then {
  1059.                 if (helperDetach) then {
  1060.                     _onWater = surfaceIsWater position _distClosestPointFound;
  1061.                     _distClosestPointFoundDir = getDir _distClosestPointFound;
  1062.                     if (_onWater) then {
  1063.                         _distClosestPointFoundPos = getPosASL _distClosestPointFound;
  1064.                         _objectHelper setPosASL _distClosestPointFoundPos;
  1065.                     } else {
  1066.                         _distClosestPointFoundPos = getPosATL _distClosestPointFound;
  1067.                         _objectHelper setPosATL _distClosestPointFoundPos;
  1068.                     };
  1069.                     _objectHelper setDir _distClosestPointFoundDir;
  1070.                     waitUntil {sleep 0.1; !helperDetach};
  1071.                 };
  1072.             } else {
  1073.                 _distClosestAttached = objNull; _distCheckAttached = 0; _distClosest = 10; _distClosestAttachedFoundPos = [];
  1074.                 {
  1075.                     if (_x !=_distClosestAttached) then {_x setobjecttexture [0,_objColorInactive];};
  1076.                     _testXPos = [_x] call FNC_GetPos;
  1077.                     _distCheckAttached = _distClosestPointFound distance _testXPos;
  1078.                     _distClosestPoint = _x;
  1079.                         if (_distCheckAttached < _distClosest) then {
  1080.                             _distClosest = _distCheckAttached;
  1081.                             _distClosestAttached setobjecttexture [0,_objColorInactive];
  1082.                             _distClosestAttached = _x;
  1083.                             _distClosestAttached setobjecttexture [0,_objColorActive];
  1084.                         };
  1085.                 } count snapGizmos;
  1086.            
  1087.                 if (helperDetach) then {
  1088.                     _distClosestPointFoundDir = getDir _distClosestPointFound;
  1089.                     _onWater = surfaceIsWater position _distClosestPointFound;
  1090.                     if (_onWater) then {
  1091.                         _distClosestPointFoundPos = getPosASL _distClosestPointFound;
  1092.                         _distClosestAttachedFoundPos = getPosASL _distClosestAttached;
  1093.                         detach _object;
  1094.                         _objectHelper setPosASL _distClosestAttachedFoundPos;
  1095.                         _object attachTo [_objectHelper];
  1096.                         _objectHelper setPosASL _distClosestPointFoundPos;
  1097.                     } else {
  1098.                         _distClosestPointFoundPos = getPosATL _distClosestPointFound;
  1099.                         _distClosestAttachedFoundPos = getPosATL _distClosestAttached;
  1100.                         detach _object;
  1101.                         _objectHelper setPosATL _distClosestAttachedFoundPos;
  1102.                         _object attachTo [_objectHelper];
  1103.                         _objectHelper setPosATL _distClosestPointFoundPos;
  1104.                     };
  1105.                     _objectHelper setDir _distClosestPointFoundDir;
  1106.                     waitUntil {sleep 0.1; !helperDetach};
  1107.                 };
  1108.             };
  1109.         };
  1110.         sleep 0.1;
  1111.     };
  1112. };
  1113.  
  1114. fnc_initSnapTutorial = {
  1115. /*
  1116.     Shows help dialog for player ONCE per log in, explaining controls.
  1117.     Add snapTutorial = false; to your init.sqf to disable this tutorial completely.
  1118.     You can also add this bool to the end of this function to only show tutorial once per player login (not recommended)
  1119. */
  1120.     private ["_bldTxtSwitch","_bldTxtEnable","_bldTxtClrO","_bldTxtClrC","_bldTxtClrW","_bldTxtClrR","_bldTxtClrG","_bldTxtSz","_bldTxtSzT","_bldTxtShdw","_bldTxtAlgnL","_bldTxtUndrln","_bldTxtBold","_bldTxtFinal","_bldTxtStringTitle","_bldTxtStringSD","_bldTxtStringSE","_bldTxtStringSA","_bldTxtStringSM","_bldTxtStringPG","_bldTxtStringAPG","_bldTxtStringCPG","_bldTxtStringQE","_bldTxtStringQEF","_bldTxtStringFD","_bldTxtStringFS"];
  1121.         if (isNil "snapTutorial") then {
  1122.             _bldTxtSwitch = _this select 0;
  1123.             _bldTxtEnable = _this select 1;
  1124.             _bldTxtClrO = "color='#ff8800'"; //orange
  1125.             _bldTxtClrC = "color='#17DBEC'"; //cyan
  1126.             _bldTxtClrW = "color='#ffffff'"; //white
  1127.             _bldTxtClrR = "color='#fd0a05'"; //red
  1128.             _bldTxtClrG = "color='#11ef00'"; //green
  1129.             _bldTxtSz = "size='0.76'"; //Title font size
  1130.             _bldTxtSzT = "size='0.4'"; //Text font size
  1131.             _bldTxtShdw = "shadow='1'"; //Font shadow
  1132.             _bldTxtAlgnL = "align='left'"; //Text align left
  1133.             _bldTxtUndrln = "underline='true'";
  1134.             _bldTxtBold = "font='Zeppelin33'"; //Bold text
  1135.             _bldTxtFinal = "";
  1136.            
  1137.             //Delete on init
  1138.             800 cutRsc ["Default", "PLAIN"];
  1139.             sleep 0.1;
  1140.            
  1141.             //Init Tutorial text
  1142.             if (_bldTxtEnable) then {
  1143.                 _bldTxtStringTitle = format ["<t %1%2%3%4>Snap Building <t %5%6%7>Pro 1.4</t></t><br />",_bldTxtClrO,_bldTxtSz,_bldTxtShdw,_bldTxtAlgnL,_bldTxtClrW,_bldTxtUndrln,_bldTxtBold];
  1144.                 _bldTxtStringSD = format["<t %1%4%5%6>[Snap]<t %2> Disabled:</t> <t %3>use action menu to enable.</t></t><br /><br />",_bldTxtClrC,_bldTxtClrR,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1145.                 _bldTxtStringSE = format["<t %1%4%5%6>[Snap]<t %2> Enabled:</t> <t %3>use action menu to disable.</t></t><br /><br />",_bldTxtClrC,_bldTxtClrG,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1146.                 _bldTxtStringSA = format["<t %1%3%4%5>[Snap Point]<t %2> AUTOMATIC: Automatic snap point detection.</t></t><br /><br />",_bldTxtClrC,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1147.                 _bldTxtStringSM = format["<t %1%3%4%5>[Snap Point]<t %2> MANUAL: Select your preferred snap point.</t></t><br /><br />",_bldTxtClrC,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1148.                 _bldTxtStringPG = format["<t %1%3%4%5>[PgUP / PgDOWN]<t %2>: Adjust height of object by 10cm</t></t><br />",_bldTxtClrC,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1149.                 _bldTxtStringAPG = format["<t %1%3%4%5>[Alt]+[PgUP / PgDOWN]<t %2>: Adjust height of object by 1m</t></t><br />",_bldTxtClrC,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1150.                 _bldTxtStringCPG = format["<t %1%3%4%5>[Ctrl]+[PgUP / PgDOWN]<t %2>: Adjust height of object by 1cm</t></t><br />",_bldTxtClrC,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1151.                 _bldTxtStringQE = format["<t %1%3%4%5>[Q / E]<t %2>: Rotate object 180 degrees while holding.</t></t><br />",_bldTxtClrC,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1152.                 _bldTxtStringQEF = format["<t %1%3%4%5>[Q / E]<t %2>: Rotate object 45 degrees while dropped or snapped.</t></t><br /><br />",_bldTxtClrC,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1153.                 _bldTxtStringFD = format["<t %1%3%4%5>[F]<t %2>: Drop / Pick up object.</t></t><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1154.                 _bldTxtStringFS = format["<t %1%3%4%5>[F]<t %2>: Snap /Pick up object.</t></t><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
  1155.                 switch (_bldTxtSwitch) do {
  1156.                     case "init": {
  1157.                         _bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSD + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFD;
  1158.                     };
  1159.                     case "OnAuto": {
  1160.                         _bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSE + _bldTxtStringSA + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFS;
  1161.                     };
  1162.                     case "manual": {
  1163.                         _bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSE + _bldTxtStringSM + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFS;
  1164.                     };
  1165.                 };
  1166.  
  1167.                 [
  1168.                     _bldTxtFinal, //structured text
  1169.                     0.73 * safezoneW + safezoneX, //number - x
  1170.                     0.65 * safezoneH + safezoneY, //number - y
  1171.                     30, //number - duration
  1172.                     1, // number - fade in time
  1173.                     0, // number - delta y
  1174.                     800 //number - layer ID
  1175.                 ] spawn bis_fnc_dynamicText;
  1176.             };
  1177.         }; 
  1178. };
  1179.  
  1180. switch (snapActionState) do {
  1181.     case "Init": {
  1182.         ["init",true] call fnc_initSnapTutorial;
  1183.         snapActionState = "OFF";
  1184.         [1,0,0] call fnc_snapActionCleanup;
  1185.         [] spawn {
  1186.         while {true} do {
  1187.             if(!DZE_ActionInProgress || DZE_cancelBuilding) exitWith {call fnc_initSnapPointsCleanup;[0,0,0] call fnc_snapActionCleanup; ["",false] call fnc_initSnapTutorial; snapActionState = "OFF";};
  1188.             sleep 2;
  1189.             };
  1190.         };
  1191.     };
  1192.     case "OFF": {
  1193.         ["OnAuto",true] call fnc_initSnapTutorial;
  1194.         snapActionState = "ON"; snapActionStateSelect = "Auto";
  1195.         [1,1,0] call fnc_snapActionCleanup;
  1196.         call fnc_initSnapPoints;
  1197.         call fnc_initSnapPointsNearby;
  1198.         sleep 0.25;
  1199.         call fnc_snapDistanceCheck;
  1200.     };
  1201.    
  1202.     case "ON": {
  1203.         ["init",true] call fnc_initSnapTutorial;
  1204.         snapActionState = "OFF";
  1205.         [1,0,0] call fnc_snapActionCleanup;
  1206.         call fnc_initSnapPointsCleanup;
  1207.     };
  1208.    
  1209.     case "Auto": {
  1210.         ["manual",true] call fnc_initSnapTutorial;
  1211.         snapActionState = "ON";snapActionStateSelect = "Manual";
  1212.         [1,1,1] call fnc_snapActionCleanup;
  1213.     };
  1214.    
  1215.     case "Manual": {
  1216.         ["OnAuto",true] call fnc_initSnapTutorial;
  1217.         snapActionState = "ON";snapActionStateSelect = "Auto";
  1218.         [1,1,0] call fnc_snapActionCleanup;
  1219.     };
  1220.    
  1221.     case "Selected": { _cnt = 0; _newPos = [];
  1222. {  
  1223.     _x setobjecttexture [0,_objColorInactive];
  1224.     if (_cnt == _selectedAction) then {
  1225.         _newPos = [(getPosATL _x select 0),(getPosATL _x select 1),(getPosATL _x select 2)];
  1226.         detach _object;
  1227.         detach _objectHelper;
  1228.         _objectHelper setDir (getDir _object);
  1229.         _objectHelper setPosATL _newPos;
  1230.         _object attachTo [_objectHelper];
  1231.         _x setobjecttexture [0,_objColorActive];
  1232.         if (!helperDetach) then {_objectHelper attachTo [player]; _objectHelper setDir ((getDir _objectHelper)-(getDir player));}; 
  1233.     };
  1234.     _cnt = _cnt+1;
  1235. }count snapGizmos;
  1236.     };
  1237. };
  1238. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1247.  
  1248. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1249. <client side mission directory>\custom\snap_pro\snappoints.hpp
  1250. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1251.  
  1252. /*-----------------------------------------------------------*/
  1253. // Created by Raymix
  1254. // Last update - August 21 2014
  1255. /*-----------------------------------------------------------*/
  1256.  
  1257.  
  1258. class SnapBuilding {
  1259.     //Barriers whitelist
  1260.     class Barrier {
  1261.         snapTo[] = {
  1262.             "Land_HBarrier5_DZ",
  1263.             "Land_HBarrier3_DZ",
  1264.             "Land_HBarrier1_DZ",
  1265.             "Sandbag1_DZ",
  1266.             "BagFenceRound_DZ",
  1267.             "Fort_RazorWire"
  1268.         };
  1269.         radius = 5;
  1270.     };
  1271.     //snap points
  1272.     class Land_HBarrier5Preview: Barrier{ //fix for broken offsets in ghost
  1273.         points[] = {
  1274.         {0,0,0,"Pivot"},
  1275.         {0,-0.75,0.1,"Back"},
  1276.         {0,0.75,0.1,"Front"},
  1277.         {-2.85,0,0.1,"Left"},
  1278.         {2.85,0,0.1,"Right"},
  1279.         {0,0,0.9,"Top"}
  1280.         };
  1281.     };
  1282.     class Land_HBarrier5_DZ: Land_HBarrier5Preview {
  1283.         points[] = {
  1284.         {0,0,0,"Pivot"},
  1285.         {0,-0.75,0,"Back"},
  1286.         {0,0.75,0,"Front"},
  1287.         {-2.85,0,0,"Left"},
  1288.         {2.85,0,0,"Right"},
  1289.         {0,0,0.9,"Top"}
  1290.         };
  1291.     };
  1292.    
  1293.     class Land_HBarrier3ePreview: Barrier { //whitelist inheritance
  1294.         points[] = {
  1295.         {0,0,0,"Pivot"},
  1296.         {0,-0.75,0,"Back"},
  1297.         {0,0.75,0,"Front"},
  1298.         {-1.7,0,0,"Left"},
  1299.         {1.7,0,0,"Right"},
  1300.         {0,0,0.9,"Top"}
  1301.         };
  1302.     };
  1303.     class Land_HBarrier3_DZ: Land_HBarrier3ePreview{}; //point inheritance
  1304.  
  1305.     class Land_HBarrier1Preview: Barrier {
  1306.         points[] = {
  1307.         {0,0,0,"Pivot"},
  1308.         {0,-0.75,0,"Back"},
  1309.         {0,0.75,0,"Front"},
  1310.         {-0.6,0,0,"Left"},
  1311.         {0.6,0,0,"Right"},
  1312.         {0,0,0.9,"Top"}
  1313.         };
  1314.     };
  1315.     class Land_HBarrier1_DZ: Land_HBarrier1Preview{};
  1316.        
  1317.     class Fort_RazorWirePreview: Barrier {
  1318.         points[] = {
  1319.         {0,0,0,"Pivot"},
  1320.         {0,-0.95,-0.3,"Back"},
  1321.         {0,0.95,-0.3,"Front"},
  1322.         {-4.1,0,-0.3,"Left"},
  1323.         {4.1,0,-0.3,"Right"},
  1324.         {0,0,1,"Top"}
  1325.         };
  1326.     };
  1327.     class Fort_RazorWire: Fort_RazorWirePreview {};
  1328.    
  1329.     class Sandbag1_DZ: Barrier {
  1330.         points[] = {
  1331.         {0,0,0,"Pivot"},
  1332.         {-1.5,0,0,"Left"},
  1333.         {1.5,0,0,"Right"},
  1334.         {0,0,0.4,"Top"}
  1335.         };
  1336.     };
  1337.    
  1338.     class BagFenceRound_DZ: Barrier {
  1339.         points[] = {
  1340.         {0,0,0,"Pivot"},
  1341.         {-1.295,0.38,0,"Left"},
  1342.         {1.295,0.38,0,"Right"},
  1343.         {0,0,0.4,"Top"}
  1344.         };
  1345.     };
  1346.    
  1347.     //Snapping whitelists for Floors, walls and stairs
  1348.     class FloorsWallsStairs {
  1349.         snapTo[] = {
  1350.             "WoodFloorQuarter_DZ",
  1351.             "WoodFloorHalf_DZ",
  1352.             "WoodFloor_DZ",
  1353.             "WoodStairs_DZ",
  1354.             "WoodStairsSans_DZ",
  1355.             "WoodSmallWallDoor_DZ",
  1356.             "WoodSmallWall_DZ",
  1357.             "WoodSmallWallWin_DZ",
  1358.             "Land_DZE_WoodDoor",
  1359.             "Land_DZE_WoodDoorLocked",
  1360.             "WoodLargeWall_DZ",
  1361.             "Land_DZE_LargeWoodDoor",
  1362.             "WoodLargeWallWin_DZ",
  1363.             "WoodLargeWallDoor_DZ",
  1364.             "Land_DZE_GarageWoodDoor",
  1365.             "Land_DZE_GarageWoodDoorLocked",
  1366.             "Land_DZE_LargeWoodDoorLocked",
  1367.             "WoodSmallWallThird_DZ",
  1368.             "CinderWall_DZ",
  1369.             "CinderWallDoorway_DZ",
  1370.             "CinderWallDoorLocked_DZ",
  1371.             "CinderWallDoor_DZ",
  1372.             "CinderWallSmallDoorway_DZ",
  1373.             "CinderWallDoorSmallLocked_DZ",
  1374.             "CinderWallHalf_DZ",
  1375.             "CinderWallDoorSmall_DZ",
  1376.             "MetalFloor_DZ"
  1377.         };
  1378.         radius = 7;
  1379.     };
  1380.    
  1381.     class WoodFloorQuarter_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost
  1382.         points[] = {
  1383.         {0,0,0,"Pivot"},
  1384.         {0,-1.23,0,"Back"},
  1385.         {0,1.23,0,"Front"},
  1386.         {-1.24,0,0,"Left"},
  1387.         {1.24,0,0,"Right"}
  1388.         };
  1389.     };
  1390.    
  1391.     class WoodFloorQuarter_DZ: FloorsWallsStairs {
  1392.         points[] = {
  1393.         {0,0,0,"Pivot"},
  1394.         {0,-1.23,0.137726,"Back"},
  1395.         {0,1.23,0.137726,"Front"},
  1396.         {-1.24,0,0.137726,"Left"},
  1397.         {1.24,0,0.137726,"Right"}
  1398.         };
  1399.     };
  1400.    
  1401.     class WoodFloorHalf_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost
  1402.         points[] = {
  1403.         {0,0,0,"Pivot"},
  1404.         {0,-2.34,0,"Back"},
  1405.         {0,2.34,0,"Front"},
  1406.         {-1.25,0,0,"Left"},
  1407.         {1.25,0,0,"Right"}
  1408.         };
  1409.     };
  1410.     class WoodFloorHalf_DZ: FloorsWallsStairs{
  1411.         points[] = {
  1412.         {0,0,0,"Pivot"},
  1413.         {0,-2.34,0.1407,"Back"},
  1414.         {0,2.34,0.1407,"Front"},
  1415.         {-1.25,0,0.1407,"Left"},
  1416.         {1.25,0,0.1407,"Right"}
  1417.         };
  1418.     };
  1419.    
  1420.     class WoodFloor_Preview_DZ: FloorsWallsStairs {
  1421.         points[] = {
  1422.         {0,0,0,"Pivot"},
  1423.         {0,-2.33,0.130,"Back"},
  1424.         {0,2.33,0.130,"Front"},
  1425.         {-2.495,0,0.130,"Left"},
  1426.         {2.495,0,0.130,"Right"}
  1427.         };
  1428.         radius = 10;
  1429.     };
  1430.     class WoodFloor_DZ: WoodFloor_Preview_DZ{};
  1431.    
  1432.     class Stairs_DZE: FloorsWallsStairs {
  1433.         points[] = {
  1434.         {0,0,0,"Pivot"},
  1435.         {1.56055,-0.78,1.5,"Back"},
  1436.         {1.56055,0.78,1.5,"Front"},
  1437.         {1.73926,0.05,2.9,"Top"},
  1438.         {-1.73926,0.05,0,"Bottom"}
  1439.         };
  1440.     };
  1441.     class WoodStairs_DZ: Stairs_DZE {};
  1442.     class WoodStairs_Preview_DZ: Stairs_DZE {};
  1443.     class WoodStairsSans_Preview_DZ: Stairs_DZE {};
  1444.     class WoodStairsSans_DZ: Stairs_DZE {};
  1445.  
  1446.     class WoodSmall_DZE: FloorsWallsStairs { // Small wood walls
  1447.         points[] = {
  1448.         {0,0,0,"Pivot"},
  1449.         {-2.285, 0, 1.5,"Left"},
  1450.         {2.285, 0, 1.5,"Right"},
  1451.         {0, 0, 3,"Top"}
  1452.         };
  1453.     };
  1454.     class WoodSmallWallDoor_Preview_DZ: WoodSmall_DZE {};
  1455.     class WoodSmallWall_Preview_DZ: WoodSmall_DZE {};
  1456.     class WoodSmallWallWin_Preview_DZ: WoodSmall_DZE {};
  1457.     class WoodSmallWallDoor_DZ: WoodSmall_DZE {};
  1458.     class WoodSmallWall_DZ: WoodSmall_DZE {};
  1459.     class WoodSmallWallWin_DZ: WoodSmall_DZE {};
  1460.     class Land_DZE_WoodDoor: WoodSmall_DZE {};
  1461.     class Land_DZE_WoodDoorLocked: WoodSmall_DZE {};
  1462.     class WoodDoor_Preview_DZ: WoodSmall_DZE{};
  1463.    
  1464.     class WoodLarge_DZE: FloorsWallsStairs { //Large wood walls
  1465.         points[] = {
  1466.         {0,0,0,"Pivot"},
  1467.         {-2.45, 0, 1.5,"Left"},
  1468.         {2.45, 0, 1.5,"Right"},
  1469.         {0, 0, 3,"Top"}
  1470.         };
  1471.     };
  1472.     class WoodLargeWall_Preview_DZ: WoodLarge_DZE {};
  1473.     class WoodLargeWallWin_Preview_DZ: WoodLarge_DZE {};
  1474.     class WoodLargeWallDoor_Preview_DZ: WoodLarge_DZE {};
  1475.     class WoodSmallWallThird_Preview_DZ: WoodLarge_DZE {
  1476.         points[] = {
  1477.         {0,0,0,"Pivot"},
  1478.         {-2.445, 0, 1.5,"Left"},
  1479.         {2.445, 0, 1.5,"Right"},
  1480.         {0, 0, 1.17,"Top"}
  1481.         };
  1482.     };
  1483.     class WoodSmallWallThird_DZ: WoodSmallWallThird_Preview_DZ{};
  1484.     class WoodLargeWall_DZ: WoodLarge_DZE {};
  1485.     class Land_DZE_LargeWoodDoor: WoodLarge_DZE {};
  1486.     class WoodLargeWallWin_DZ: WoodLarge_DZE {};
  1487.     class WoodLargeWallDoor_DZ: WoodLarge_DZE {};
  1488.     class Land_DZE_GarageWoodDoor: WoodLarge_DZE {};
  1489.     class GarageWoodDoor_Preview_DZ: WoodLarge_DZE {};
  1490.     class Land_DZE_GarageWoodDoorLocked: WoodLarge_DZE {};
  1491.     class Land_DZE_LargeWoodDoorLocked: WoodLarge_DZE {};
  1492.     class LargeWoodDoor_Preview_DZ: WoodLarge_DZE {};
  1493.    
  1494.     class Cinder_DZE: FloorsWallsStairs { //All cinder walls and doors
  1495.         points[] = {
  1496.         {0,0,0,"Pivot"},
  1497.         {-2.752, 0, 1.5,"Left"},
  1498.         {2.752, 0, 1.5,"Right"},
  1499.         {0, 0, 3.37042,"Top"}
  1500.         };
  1501.         radius = 10;
  1502.     };
  1503.     class CinderWall_Preview_DZ: Cinder_DZE {};
  1504.     class CinderWallDoorway_Preview_DZ: Cinder_DZE {};
  1505.     class CinderWallSmallDoorway_Preview_DZ: Cinder_DZE {};
  1506.     class CinderWallHalf_Preview_DZ: Cinder_DZE {
  1507.         points[] = {
  1508.         {0,0,0,"Pivot"},
  1509.         {-2.752, 0, 1.5,"Left"},
  1510.         {2.752, 0, 1.5,"Right"},
  1511.         {0, 0, 1.5,"Top"}
  1512.         };
  1513.     };
  1514.     class CinderWall_DZ: Cinder_DZE {};
  1515.     class CinderWallDoorway_DZ: Cinder_DZE {};
  1516.     class CinderWallDoorLocked_DZ: Cinder_DZE {};
  1517.     class CinderWallDoor_DZ: Cinder_DZE {};
  1518.     class CinderWallSmallDoorway_DZ: Cinder_DZE {};
  1519.     class CinderWallDoorSmallLocked_DZ: Cinder_DZE {};
  1520.     class CinderWallHalf_DZ: Cinder_DZE {
  1521.         points[] = {
  1522.         {0,0,0,"Pivot"},
  1523.         {-2.752, 0, 1.5,"Left"},
  1524.         {2.752, 0, 1.5,"Right"},
  1525.         {0, 0, 1.5,"Top"}
  1526.         };
  1527.     };
  1528.     class CinderWallDoorSmall_DZ: Cinder_DZE {};
  1529.    
  1530.     class MetalFloor_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost
  1531.         points[] = {
  1532.         {0,0,0.011,"Pivot"},
  1533.         {0, -2.64, 0.009,"Back"},
  1534.         {0, 2.64, 0.009,"Front"},
  1535.         {-2.64, 0, 0.009,"Left"},
  1536.         {2.64, 0, 0.009,"Right"}
  1537.         };
  1538.         radius = 12;
  1539.     };
  1540.     class MetalFloor_DZ: FloorsWallsStairs{
  1541.         points[] = {
  1542.         {0,0,0,"Pivot"},
  1543.         {0, -2.64, 0.15,"Back"},
  1544.         {0, 2.64, 0.15,"Front"},
  1545.         {-2.64, 0, 0.15,"Left"},
  1546.         {2.64, 0, 0.15,"Right"}
  1547.         };
  1548.         radius = 12;
  1549.     };
  1550.    
  1551.    
  1552.     //Non essential Items that only snap to themselves, do whitelist inheritance if you want these to snap
  1553.     class WoodCrate_DZ {
  1554.         snapTo[] = {
  1555.             "WoodCrate_DZ"
  1556.         };
  1557.         radius = 5;
  1558.         points[] = {
  1559.         {0,0,0,"Pivot"},
  1560.         {0,-0.47,0,"Back"},
  1561.         {0,0.47,0,"Front"},
  1562.         {-0.47,0,0,"Left"},
  1563.         {0.47,0,0,"Right"},
  1564.         {0,0,0.47,"Top"}
  1565.         };
  1566.     };
  1567.        
  1568.     class MetalPanel_DZ {
  1569.         snapTo[] = {
  1570.             "MetalPanel_DZ"
  1571.         };
  1572.         radius = 5;
  1573.         points[] = {
  1574.         {0,0,0,"Pivot"},
  1575.         {-1.5,0,0,"Left"},
  1576.         {1.5,0,0,"Right"}
  1577.         };
  1578.     };
  1579.    
  1580.         class MetalGate_DZ {
  1581.         snapTo[] = {
  1582.             "MetalGate_DZ"
  1583.         };
  1584.         radius = 5;
  1585.         points[] = {
  1586.         {0,0,0,"Pivot"},
  1587.         {-4.1,0,0,"Left"}
  1588.         };
  1589.     };
  1590.    
  1591.     class StickFence_DZ {
  1592.         snapTo[] = {
  1593.             "StickFence_DZ"
  1594.         };
  1595.         radius = 10;
  1596.         points[] = {
  1597.         {0,0,0,"Pivot"},
  1598.         {-2.95,0,0.3,"Left"},
  1599.         {2.95,0,0.3,"Right"}
  1600.         };
  1601.     };
  1602.    
  1603.     class Fence_corrugated_DZ {
  1604.         snapTo[] = {
  1605.             "Fence_corrugated_DZ"
  1606.         };
  1607.         radius = 10;
  1608.         points[] = {
  1609.         {0,0,0,"Pivot"},
  1610.         {-1.95,0,0.88,"Left"},
  1611.         {1.95,0,0.88,"Right"}
  1612.         };
  1613.     };
  1614.    
  1615.     class WoodRamp_Preview_DZ {
  1616.         snapTo[] = {
  1617.             "WoodRamp_DZ"
  1618.         };
  1619.         radius = 7;
  1620.         points[] = {
  1621.         {0,0,0,"Pivot"},
  1622.         {0.65,-1.7,1.2,"Back"},
  1623.         {0.65,1.5,1.2,"Front"},
  1624.         {3.34,-0.115,2.82,"Top"}
  1625.         };
  1626.     };
  1627.     class WoodRamp_DZ: WoodRamp_Preview_DZ{};
  1628.    
  1629.     class WoodLadder_Preview_DZ {
  1630.         snapTo[] = {
  1631.             "WoodLadder_DZ"
  1632.         };
  1633.         radius = 5;
  1634.         points[] = {
  1635.         {0,0,0,"Pivot"},
  1636.         {-0.4,0,1.725,"Left"},
  1637.         {0.4,0,1.725,"Right"}
  1638.         };
  1639.     };
  1640.     class WoodLadder_DZ: WoodLadder_Preview_DZ{};
  1641.    
  1642.     class VaultStorageLocked {
  1643.         snapTo[] = {
  1644.             "VaultStorageLocked",
  1645.             "VaultStorage"
  1646.         };
  1647.         radius = 5;
  1648.         points[] = {
  1649.         {0,0,0,"Pivot"},
  1650.         {0,0.284,0.615,"Back"},
  1651.         {0,0,1.23,"Top"},
  1652.         {-0.362,0,0.615,"Left"},
  1653.         {0.362,0,0.615,"Right"}
  1654.         };
  1655.        
  1656.     };
  1657.     class VaultStorage: VaultStorageLocked {};
  1658. };
  1659. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement