Advertisement
Guest User

Untitled

a guest
Apr 12th, 2014
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. private ["_isBuildable","_charPos","_character","_id","_pos","_z","_nearestGates","_inMotion","_lever","_text"];
  2. _character = _this select 1;
  3. _id = _this select 2;
  4. _lever = _this select 3;
  5. _isBuildable = true;
  6. _charPos = getposATL _character;
  7. _inMotion = _lever getVariable ["inMotion",0];
  8. _lever removeAction _id;
  9. _nearestGates = nearestObjects [_lever, ["Land_Ind_Shed_01_main","Land_Ind_Shed_01_end","Land_Ind_SawMillPen"], BBFlagRadius];
  10. //dayz_updateNearbyObjects = [_charPos, _isBuildable];
  11. //publicVariableServer "dayz_updateNearbyObjects";
  12. // if (isServer) then {
  13. // dayz_updateNearbyObjects call server_updateNearbyObjects;
  14. // };
  15.  
  16. //[_charPos, _isBuildable] call server_updateNearbyObjects;
  17. if (typeOf(_lever) == "Infostand_2_EP1") then {
  18. if (_inMotion == 0) then {
  19.  
  20. _lever setVariable ["inMotion", 1, true];
  21.  
  22. {
  23. //_pos = getPosATL _x; // changed from getpos
  24. //_z = _pos select 2;
  25. _gateLowered = _x getVariable ["RoofLowered", false];
  26. //if (_z <= -2) then {
  27. if (_gateLowered) then {
  28. _text = "All Roofs";
  29. cutText [format["Raising the %1",_text], "PLAIN DOWN"];
  30. //_pos set [2,0];
  31. //_x setPos _pos;
  32.  
  33. _posATL = getPosATL _x;
  34. _z = _posATL select 2;
  35. _z = _z+10;
  36. _posATL set [2,_z];
  37. _x setPosATL _posATL;
  38.  
  39.  
  40. [nil,_x,rSAY,["trap_bear_0",60]] call RE;
  41. sleep .5;
  42. [nil,_x,rSAY,["trap_bear_0",60]] call RE;
  43. _x setVariable ["RoofLowered", false, true];
  44. } else {
  45. _text = "All Roofs";
  46. cutText [format["Lowering the %1",_text], "PLAIN DOWN"];
  47.  
  48. _posATL = getPosATL _x;
  49. _z = _posATL select 2;
  50. _z = _z-10;
  51. _posATL set [2,_z];
  52. _x setPosATL _posATL;
  53. [nil,_x,rSAY,["trap_bear_0",60]] call RE;
  54. _x setVariable ["RoofLowered", true, true];
  55. };
  56.  
  57. sleep 1;
  58.  
  59. } foreach _nearestGates;
  60. _lever setVariable ["inMotion", 0, true];
  61. };
  62. };
  63. //The Fence_corrugated_plate is now its own single gate and not tied to a panel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement