Advertisement
Guest User

fn_selfActions.sqf

a guest
Mar 29th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 38.63 KB | None | 0 0
  1. scriptName "Functions\misc\fn_selfActions.sqf";
  2. /***********************************************************
  3.     ADD ACTIONS FOR SELF
  4.     - Function
  5.     - [] call fnc_usec_selfActions;
  6. ************************************************************/
  7. private ["_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_isModularDoor","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached"];
  8.  
  9. if (DZE_ActionInProgress) exitWith {}; // Do not allow if any script is running.
  10.  
  11. _vehicle = vehicle player;
  12. _isPZombie = player isKindOf "PZombie_VB";
  13. _inVehicle = (_vehicle != player);
  14.  
  15. _onLadder =     (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  16. _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
  17.  
  18. _nearLight =    nearestObject [player,"LitObject"];
  19. _canPickLight = false;
  20. if (!isNull _nearLight) then {
  21.     if (_nearLight distance player < 4) then {
  22.         _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
  23.     };
  24. };
  25.  
  26. //Grab Flare
  27. if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
  28.     if (s_player_grabflare < 0) then {
  29.         _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
  30.         s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
  31.         s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
  32.     };
  33. } else {
  34.     player removeAction s_player_grabflare;
  35.     player removeAction s_player_removeflare;
  36.     s_player_grabflare = -1;
  37.     s_player_removeflare = -1;
  38. };
  39.  
  40. if (DZE_HeliLift) then {
  41.     _hasAttached = _vehicle getVariable["hasAttached",false];
  42.     if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) < 30) && (speed _vehicle < 5) && (typeName _hasAttached == "OBJECT")) then {
  43.         if (s_player_heli_detach < 0) then {
  44.             dayz_myLiftVehicle = _vehicle;
  45.             s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""];
  46.         };
  47.     } else {
  48.         dayz_myLiftVehicle removeAction s_player_heli_detach;
  49.         s_player_heli_detach = -1;
  50.     };
  51. };
  52.  
  53. if(DZE_HaloJump) then {
  54.     if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) > 400)) then {
  55.         if (s_halo_action < 0) then {
  56.             DZE_myHaloVehicle = _vehicle;
  57.             s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""];
  58.         };
  59.     } else {
  60.         DZE_myHaloVehicle removeAction s_halo_action;
  61.         s_halo_action = -1;
  62.     };
  63. };
  64.  
  65. if (!DZE_ForceNameTagsOff) then {
  66.     if (s_player_showname < 0 && !_isPZombie) then {
  67.         if (DZE_ForceNameTags) then {
  68.             s_player_showname = 1;
  69.             player setVariable["DZE_display_name",true,true];
  70.         } else {
  71.             s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false, "",""];
  72.             s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false, "",""];
  73.         };
  74.     };
  75. };
  76.  
  77. if(_isPZombie) then {
  78.     if (s_player_callzombies < 0) then {
  79.         s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
  80.     };
  81.     if (DZE_PZATTACK) then {
  82.         call pz_attack;
  83.         DZE_PZATTACK = false;
  84.     };
  85.     if (s_player_pzombiesvision < 0) then {
  86.         s_player_pzombiesvision = player addAction [localize "STR_EPOCH_ACTIONS_NIGHTVIS", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 4, false, true, "nightVision", "_this == _target"];
  87.     };
  88.     if (!isNull cursorTarget && (player distance cursorTarget < 3)) then {  //Has some kind of target
  89.         _isAnimal = cursorTarget isKindOf "Animal";
  90.         _isZombie = cursorTarget isKindOf "zZombie_base";
  91.         _isHarvested = cursorTarget getVariable["meatHarvested",false];
  92.         _isMan = cursorTarget isKindOf "Man";
  93.         // Pzombie Gut human corpse || animal
  94.         if (!alive cursorTarget && (_isAnimal || _isMan) && !_isZombie && !_isHarvested) then {
  95.             if (s_player_pzombiesfeed < 0) then {
  96.                 s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""];
  97.             };
  98.         } else {
  99.             player removeAction s_player_pzombiesfeed;
  100.             s_player_pzombiesfeed = -1;
  101.         };
  102.     } else {
  103.         player removeAction s_player_pzombiesfeed;
  104.         s_player_pzombiesfeed = -1;
  105.     };
  106. };
  107.  
  108. // Increase distance only if AIR || SHIP
  109. _allowedDistance = 4;
  110. _isAir = cursorTarget isKindOf "Air";
  111. _isShip = cursorTarget isKindOf "Ship";
  112. if(_isAir || _isShip) then {
  113.     _allowedDistance = 8;
  114. };
  115.  
  116. if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then {   //Has some kind of target
  117.  
  118.     // set cursortarget to variable
  119.     _cursorTarget = cursorTarget;
  120.  
  121.     // get typeof cursortarget once
  122.     _typeOfCursorTarget = typeOf _cursorTarget;
  123.  
  124.     // hintsilent _typeOfCursorTarget;
  125.  
  126.     _isVehicle = _cursorTarget isKindOf "AllVehicles";
  127.     _isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
  128.     _isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
  129.    
  130.     // get items && magazines only once
  131.     _magazinesPlayer = magazines player;
  132.  
  133.     //boiled Water
  134.     _hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
  135.     _hastinitem = false;
  136.     {
  137.         if (_x in _magazinesPlayer) then {
  138.             _hastinitem = true;
  139.         };
  140.     } count boil_tin_cans;
  141.     _hasFuelE =     "ItemJerrycanEmpty" in _magazinesPlayer;
  142.     _hasFuelBarrelE =   "ItemFuelBarrelEmpty" in _magazinesPlayer;
  143.     _hasHotwireKit =    "ItemHotwireKit" in _magazinesPlayer;
  144.  
  145.     _itemsPlayer = items player;
  146.    
  147.     _temp_keys = [];
  148.     _temp_keys_names = [];
  149.     // find available keys
  150.     _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
  151.     {
  152.         if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
  153.             _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
  154.             _ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
  155.             _temp_keys_names set [_ownerKeyId,_ownerKeyName];
  156.             _temp_keys set [count _temp_keys,str(_ownerKeyId)];
  157.         };
  158.     } count _itemsPlayer;
  159.  
  160.     _hasKnife =     "ItemKnife" in _itemsPlayer;
  161.     _hasToolbox =   "ItemToolbox" in _itemsPlayer;
  162.  
  163.     _isMan = _cursorTarget isKindOf "Man";
  164.     _traderType = _typeOfCursorTarget;
  165.     _ownerID = _cursorTarget getVariable ["CharacterID","0"];
  166.     _isAnimal = _cursorTarget isKindOf "Animal";
  167.     _isDog =  (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
  168.     _isZombie = _cursorTarget isKindOf "zZombie_base";
  169.     _isDestructable = _cursorTarget isKindOf "BuiltItems";
  170.     _isWreck = _typeOfCursorTarget in DZE_isWreck;
  171.     _isWreckBuilding = _typeOfCursorTarget in DZE_isWreckBuilding;
  172.     _isModular = _cursorTarget isKindOf "ModularItems";
  173.     _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
  174.  
  175.     _isRemovable = _typeOfCursorTarget in DZE_isRemovable;
  176.     _isDisallowRepair = _typeOfCursorTarget in ["M240Nest_DZ"];
  177.  
  178.     _isTent = _cursorTarget isKindOf "TentStorage";
  179.    
  180.     _isAlive = alive _cursorTarget;
  181.    
  182.     _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  183.    
  184.     _rawmeat = meatraw;
  185.     _hasRawMeat = false;
  186.     {
  187.         if (_x in _magazinesPlayer) then {
  188.             _hasRawMeat = true;
  189.         };
  190.     } count _rawmeat;
  191.    
  192.     _isFuel = false;
  193.     if (_hasFuelE || _hasFuelBarrelE) then {
  194.         {
  195.             if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
  196.         } count dayz_fuelsources;
  197.     };
  198.  
  199.     // diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID));
  200.    
  201.     // logic vars
  202.     _player_flipveh = false;
  203.     _player_deleteBuild = false;
  204.     _player_lockUnlock_crtl = false;
  205.  
  206.      if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
  207.          if (s_player_maintain_area < 0) then {
  208.             s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
  209.             s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
  210.          };
  211.      } else {
  212.             player removeAction s_player_maintain_area;
  213.             s_player_maintain_area = -1;
  214.             player removeAction s_player_maintain_area_preview;
  215.             s_player_maintain_area_preview = -1;
  216.      };
  217.  
  218.     // CURSOR TARGET ALIVE
  219.     if(_isAlive) then {
  220.        
  221.         //Allow player to delete objects
  222.         if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
  223.             if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  224.                 _player_deleteBuild = true;
  225.             };
  226.         };
  227.        
  228.         //Allow owners to delete modulars
  229.                 if(_isModular && (dayz_characterID == _ownerID)) then {
  230.                         if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  231.                                 _player_deleteBuild = true;
  232.                         };
  233.                 };
  234.         //Allow owners to delete modular doors without locks
  235.                 if(_isModularDoor && (dayz_characterID == _ownerID)) then {
  236.                         if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  237.                                 _player_deleteBuild = true;
  238.                         };     
  239.                 }; 
  240.         // CURSOR TARGET VEHICLE
  241.         if(_isVehicle) then {
  242.            
  243.             //flip vehicle small vehicles by your self && all other vehicles with help nearby
  244.             if (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (count (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) select 2) < 0.5) then {
  245.                 _playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
  246.                 if(_isVehicletype || (_playersNear >= 2)) then {
  247.                     _player_flipveh = true;
  248.                 };
  249.             };
  250.  
  251.  
  252.             if(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) then {
  253.                 _player_lockUnlock_crtl = true;
  254.             };
  255.  
  256.         };
  257.    
  258.     };
  259.  
  260.     if(_player_deleteBuild) then {
  261.         if (s_player_deleteBuild < 0) then {
  262.             s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  263.         };
  264.     } else {
  265.         player removeAction s_player_deleteBuild;
  266.         s_player_deleteBuild = -1;
  267.     };
  268.    
  269.     if (DZE_HeliLift) then {
  270.         _liftHeli = objNull;
  271.         _found = false;
  272.    
  273.         _allowTow = false;
  274.         if ((count (crew _cursorTarget)) == 0) then {
  275.             {
  276.                 if(!_allowTow) then {
  277.                     _allowTow = _cursorTarget isKindOf _x;
  278.                 };
  279.             } count DZE_HeliAllowToTow;
  280.         };
  281.  
  282.         //diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow];
  283.  
  284.         if (_allowTow) then {
  285.             _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
  286.             {
  287.                 if(!_found) then {
  288.                     _posL = [_x] call FNC_getPos;
  289.                     _posC = [_cursorTarget] call FNC_getPos;
  290.                     _height = (_posL select 2) - (_posC select 2);
  291.                     _hasAttached = _x getVariable["hasAttached",false];
  292.                     if(_height < 15 && _height > 5 && (typeName _hasAttached != "OBJECT")) then {
  293.                         if(((abs((_posL select 0) - (_posC select 0))) < 10) && ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
  294.                             _liftHeli = _x;
  295.                             _found = true;
  296.                         };
  297.                     };
  298.                 };
  299.             } count _liftHelis;
  300.         };
  301.  
  302.         //diag_log format["HELI: %1 TARGET: %2",_found,_cursorTarget];
  303.  
  304.         _attached = _cursorTarget getVariable["attached",false];
  305.         if(_found && _allowTow && _canDo && !locked _cursorTarget && !_isPZombie && (typeName _attached != "OBJECT")) then {
  306.             if (s_player_heli_lift < 0) then {
  307.                 s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true, "",""];
  308.             };
  309.         } else {
  310.             player removeAction s_player_heli_lift;
  311.             s_player_heli_lift = -1;
  312.         };
  313.     };
  314.    
  315.     // Allow Owner to lock && unlock vehicle  
  316.     if(_player_lockUnlock_crtl) then {
  317.         if (s_player_lockUnlock_crtl < 0) then {
  318.             _hasKey = _ownerID in _temp_keys;
  319.             _oldOwner = (_ownerID == dayz_playerUID);
  320.             if(locked _cursorTarget) then {
  321.                 if(_hasKey || _oldOwner) then {
  322.                     _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (parseNumber _ownerID))], 2, true, true, "", ""];
  323.                     s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  324.                     s_player_lockUnlock_crtl = 1;
  325.                 } else {
  326.                     if(_hasHotwireKit) then {
  327.                         _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
  328.                     } else {
  329.                         _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, true, true, "", ""];
  330.                     };
  331.                     s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  332.                     s_player_lockUnlock_crtl = 1;
  333.                 };
  334.             } else {
  335.                 if(_hasKey || _oldOwner) then {
  336.                     _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
  337.                     s_player_lockunlock set [count s_player_lockunlock,_lock];
  338.                     s_player_lockUnlock_crtl = 1;
  339.                 };
  340.             };
  341.         };
  342.          
  343.     } else {
  344.         {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  345.         s_player_lockUnlock_crtl = -1;
  346.     };
  347.  
  348.     if(DZE_AllowForceSave) then {
  349.         //Allow player to force save
  350.         if((_isVehicle || _isTent) && !_isMan) then {
  351.             if (s_player_forceSave < 0) then {
  352.                 s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
  353.             };
  354.         } else {
  355.             player removeAction s_player_forceSave;
  356.             s_player_forceSave = -1;
  357.         };
  358.     };
  359.  
  360.    
  361.    
  362.     If(DZE_AllowCargoCheck) then {
  363.         if((_isVehicle || _isTent || _isnewstorage) && _isAlive && !_isMan && !locked _cursorTarget) then {
  364.             if (s_player_checkGear < 0) then {
  365.                 s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""];
  366.             };
  367.         } else {
  368.             player removeAction s_player_checkGear;
  369.             s_player_checkGear = -1;
  370.         };
  371.     };
  372.    
  373.    
  374.     //flip vehicle small vehicles by your self && all other vehicles with help nearby
  375.     if(_player_flipveh) then {
  376.         if (s_player_flipveh  < 0) then {
  377.             s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];     
  378.         };
  379.     } else {
  380.         player removeAction s_player_flipveh;
  381.         s_player_flipveh = -1;
  382.     };
  383.    
  384.     //Allow player to fill jerrycan
  385.     if((_hasFuelE || _hasFuelBarrelE) && _isFuel) then {
  386.         if (s_player_fillfuel < 0) then {
  387.             s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
  388.         };
  389.     } else {
  390.         player removeAction s_player_fillfuel;
  391.         s_player_fillfuel = -1;
  392.     };
  393.    
  394.     // logic vars for addactions
  395.     _player_butcher = false;
  396.     _player_studybody = false;
  397.     _player_SurrenderedGear = false;
  398.  
  399.     // CURSOR TARGET NOT ALIVE
  400.     if (!_isAlive) then {
  401.  
  402.         // Gut animal/zed
  403.         if((_isAnimal || _isZombie) && _hasKnife) then {
  404.             _isHarvested = _cursorTarget getVariable["meatHarvested",false];
  405.             if (!_isHarvested) then {
  406.                 _player_butcher = true;
  407.             };
  408.         };
  409.  
  410.         // Study body
  411.         if (_isMan && !_isZombie && !_isAnimal) then {
  412.             _player_studybody = true;
  413.         }
  414.     } else {
  415.         // unit alive
  416.  
  417.         // gear access on surrendered player
  418.         if(_isMan && !_isZombie && !_isAnimal) then {
  419.             _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",false];
  420.             if (_isSurrendered) then {
  421.                 _player_SurrenderedGear = true;
  422.             };
  423.         };
  424.     };
  425.  
  426.  
  427.     // Human Gut animal || zombie
  428.     if (_player_butcher) then {
  429.         if (s_player_butcher < 0) then {
  430.             if(_isZombie) then {
  431.                 s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, true, true, "", ""];
  432.             } else {
  433.                 s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
  434.             };
  435.         };
  436.     } else {
  437.         player removeAction s_player_butcher;
  438.         s_player_butcher = -1;
  439.     };
  440.  
  441.     // Study Body
  442.     if (_player_studybody) then {
  443.         if (s_player_studybody < 0) then {
  444.             s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true, "",""];
  445.         };
  446.     } else {
  447.         player removeAction s_player_studybody;
  448.         s_player_studybody = -1;
  449.     };
  450.  
  451.     // logic vars
  452.     _player_cook = false;
  453.     _player_boil = false;
  454.  
  455.     // CURSOR TARGET IS FIRE
  456.     if (inflamed _cursorTarget) then {
  457.        
  458.         //Fireplace Actions check
  459.         if (_hasRawMeat) then {
  460.             _player_cook = true;   
  461.         };
  462.        
  463.         // Boil water
  464.         if (_hasbottleitem && _hastinitem) then {
  465.             _player_boil = true;
  466.         };
  467.     };
  468.  
  469.     if (_player_SurrenderedGear) then {
  470.         if (s_player_SurrenderedGear < 0) then {
  471.             s_player_SurrenderedGear = player addAction [localize "STR_EPOCH_ACTIONS_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true, "", ""];
  472.         };
  473.     } else {
  474.         player removeAction s_player_SurrenderedGear;
  475.         s_player_SurrenderedGear = -1;
  476.     };
  477.  
  478.     //Fireplace Actions check
  479.     if (_player_cook) then {
  480.         if (s_player_cook < 0) then {
  481.             s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""];
  482.         };
  483.     } else {
  484.         player removeAction s_player_cook;
  485.         s_player_cook = -1;
  486.     };
  487.    
  488.     // Boil water
  489.     if (_player_boil) then {
  490.         if (s_player_boil < 0) then {
  491.             s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""];
  492.         };
  493.     } else {
  494.         player removeAction s_player_boil;
  495.         s_player_boil = -1;
  496.     };
  497.    
  498.     if(_cursorTarget == dayz_hasFire) then {
  499.         if ((s_player_fireout < 0) && !(inflamed _cursorTarget) && (player distance _cursorTarget < 3)) then {
  500.             s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true, "",""];
  501.         };
  502.     } else {
  503.         player removeAction s_player_fireout;
  504.         s_player_fireout = -1;
  505.     };
  506.    
  507.     //Packing my tent
  508.     if(_isTent && (player distance _cursorTarget < 3)) then {
  509.         if (_ownerID == dayz_characterID) then {
  510.             if (s_player_packtent < 0) then {
  511.                 s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""];
  512.             };
  513.         } else {
  514.             if(("ItemJerrycan" in _magazinesPlayer) && ("ItemMatchbox_DZE" in weapons player)) then {
  515.                 if (s_player_packtent < 0) then {
  516.                     s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  517.                 };
  518.             };
  519.         };
  520.     } else {
  521.         player removeAction s_player_packtent;
  522.         s_player_packtent = -1;
  523.     };
  524.  
  525.     //Allow owner to unlock vault
  526.     if((_typeOfCursorTarget in DZE_LockableStorage) && _ownerID != "0" && (player distance _cursorTarget < 3)) then {
  527.         if (s_player_unlockvault < 0) then {
  528.             if(_typeOfCursorTarget in DZE_LockedStorage) then {
  529.                 if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then {
  530.                     _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
  531.                     s_player_combi set [count s_player_combi,_combi];
  532.                 } else {
  533.                     _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  534.                     s_player_combi set [count s_player_combi,_combi];
  535.                 };
  536.                 s_player_unlockvault = 1;
  537.             } else {
  538.                 if(_ownerID != dayz_combination && _ownerID != dayz_playerUID) then {
  539.                     _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  540.                     s_player_combi set [count s_player_combi,_combi];
  541.                     s_player_unlockvault = 1;
  542.                 };
  543.             };
  544.         };
  545.     } else {
  546.         {player removeAction _x} count s_player_combi;s_player_combi = [];
  547.         s_player_unlockvault = -1;
  548.     };
  549.  
  550.     //Allow owner to pack vault
  551.     if(_typeOfCursorTarget in DZE_UnLockedStorage && _ownerID != "0" && (player distance _cursorTarget < 3)) then {
  552.  
  553.         if (s_player_lockvault < 0) then {
  554.             if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then {
  555.                 s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true, "",""];
  556.             };
  557.         };
  558.         if (s_player_packvault < 0 && (_ownerID == dayz_combination || _ownerID == dayz_playerUID)) then {
  559.             s_player_packvault = player addAction [format["<t color='#ff0000'>%1</t>",(format[localize "STR_EPOCH_ACTIONS_PACK",_text])], "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, false, true, "",""];
  560.         };
  561.     } else {
  562.         player removeAction s_player_packvault;
  563.         s_player_packvault = -1;
  564.         player removeAction s_player_lockvault;
  565.         s_player_lockvault = -1;
  566.     };
  567.  
  568.    
  569.  
  570.     //Player Deaths
  571.     if(_typeOfCursorTarget == "Info_Board_EP1") then {
  572.         if (s_player_information < 0) then {
  573.             s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true, "",""];
  574.         };
  575.     } else {
  576.         player removeAction s_player_information;
  577.         s_player_information = -1;
  578.     };
  579.    
  580.     //Fuel Pump
  581.     if(_typeOfCursorTarget in dayz_fuelpumparray) then {   
  582.         if (s_player_fuelauto < 0) then {
  583.            
  584.             // check if Generator_DZ is running within 30 meters
  585.             _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
  586.             _findNearestGen = [];
  587.             {
  588.                 if (alive _x && (_x getVariable ["GeneratorRunning", false])) then {
  589.                     _findNearestGen set [(count _findNearestGen),_x];
  590.                 };
  591.             } count _findNearestGens;
  592.             _IsNearRunningGen = count (_findNearestGen);
  593.            
  594.             // show that pump needs power if no generator nearby.
  595.             if(_IsNearRunningGen > 0) then {
  596.                 s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true, "",""];
  597.             } else {
  598.                 s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  599.             };
  600.         };
  601.     } else {
  602.         player removeAction s_player_fuelauto;
  603.         s_player_fuelauto = -1;
  604.     };
  605.  
  606.     //Fuel Pump on truck
  607.     if(_typeOfCursorTarget in DZE_fueltruckarray && alive _cursorTarget) then {
  608.         if (s_player_fuelauto2 < 0) then {
  609.             // show that fuel truck pump needs power.
  610.             if(isEngineOn _cursorTarget) then {
  611.                 s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true, "",""];
  612.             } else {
  613.                 s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  614.             };
  615.         };
  616.     } else {
  617.         player removeAction s_player_fuelauto2;
  618.         s_player_fuelauto2 = -1;
  619.     };
  620.  
  621.     // inplace upgrade tool
  622.     if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
  623.         if ((s_player_lastTarget select 0) != _cursorTarget) then {
  624.             if (s_player_upgrade_build > 0) then {
  625.                 player removeAction s_player_upgrade_build;
  626.                 s_player_upgrade_build = -1;
  627.             };
  628.         };
  629.         if (s_player_upgrade_build < 0) then {
  630.             // s_player_lastTarget = _cursorTarget;
  631.             s_player_lastTarget set [0,_cursorTarget];
  632.             s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "\z\addons\dayz_code\actions\player_upgrade.sqf",_cursorTarget, -1, false, true, "",""];
  633.         };
  634.     } else {
  635.         player removeAction s_player_upgrade_build;
  636.         s_player_upgrade_build = -1;
  637.     };
  638.    
  639.     // downgrade system
  640.     if((_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") && (DZE_Lock_Door == _ownerID)) then {
  641.         if ((s_player_lastTarget select 1) != _cursorTarget) then {
  642.             if (s_player_downgrade_build > 0) then {   
  643.                 player removeAction s_player_downgrade_build;
  644.                 s_player_downgrade_build = -1;
  645.             };
  646.         };
  647.  
  648.         if (s_player_downgrade_build < 0) then {
  649.             s_player_lastTarget set [1,_cursorTarget];
  650.             s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "\z\addons\dayz_code\actions\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true, "",""];
  651.         };
  652.     } else {
  653.         player removeAction s_player_downgrade_build;
  654.         s_player_downgrade_build = -1;
  655.     };
  656.  
  657.     // inplace maintenance tool
  658.     if((_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ") && (damage _cursorTarget >= DZE_DamageBeforeMaint)) then {
  659.         if ((s_player_lastTarget select 2) != _cursorTarget) then {
  660.             if (s_player_maint_build > 0) then {   
  661.                 player removeAction s_player_maint_build;
  662.                 s_player_maint_build = -1;
  663.             };
  664.         };
  665.  
  666.         if (s_player_maint_build < 0) then {
  667.             s_player_lastTarget set [2,_cursorTarget];
  668.             s_player_maint_build = player addAction [format[localize "STR_EPOCH_ACTIONS_MAINTAIN",_text], "\z\addons\dayz_code\actions\player_buildingMaint.sqf",_cursorTarget, -2, false, true, "",""];
  669.         };
  670.     } else {
  671.         player removeAction s_player_maint_build;
  672.         s_player_maint_build = -1;
  673.     };
  674.  
  675.  
  676.     //Start Generator
  677.     if(_cursorTarget isKindOf "Generator_DZ") then {
  678.         if (s_player_fillgen < 0) then {
  679.            
  680.             // check if not running
  681.             if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
  682.                 s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true, "",""];               
  683.             } else {
  684.             // check if not filled && player has jerry.
  685.                 if((_cursorTarget getVariable ["GeneratorFilled", false])) then {
  686.                     s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  687.                 } else {
  688.                     if("ItemJerrycan" in _magazinesPlayer) then {
  689.                         s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  690.                     };
  691.                 };
  692.             };
  693.         };
  694.     } else {
  695.         player removeAction s_player_fillgen;
  696.         s_player_fillgen = -1;
  697.     };
  698.  
  699.     //Towing with tow truck
  700.     /*
  701.     if(_typeOfCursorTarget == "TOW_DZE") then {
  702.         if (s_player_towing < 0) then {
  703.             if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
  704.                 s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];              
  705.             } else {
  706.                 s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];             
  707.             };
  708.         };
  709.     } else {
  710.         player removeAction s_player_towing;
  711.         s_player_towing = -1;
  712.     };
  713.     */
  714.  
  715.  
  716.     //Sleep
  717.     if(_isTent && _ownerID == dayz_characterID) then {
  718.         if ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) then {
  719.             s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
  720.         };
  721.     } else {
  722.         player removeAction s_player_sleep;
  723.         s_player_sleep = -1;
  724.     };
  725.    
  726.     //Repairing Vehicles
  727.     if ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) then {
  728.         if (s_player_repair_crtl < 0) then {
  729.             dayz_myCursorTarget = _cursorTarget;
  730.             _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  731.             _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  732.             s_player_repairActions set [count s_player_repairActions,_menu];
  733.             s_player_repairActions set [count s_player_repairActions,_menu1];
  734.             s_player_repair_crtl = 1;
  735.         } else {
  736.             {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  737.             s_player_repair_crtl = -1;
  738.         };
  739.     };
  740.  
  741.     // All Traders
  742.     if (_isMan && !_isPZombie && _traderType in serverTraders) then {
  743.        
  744.         if (s_player_parts_crtl < 0) then {
  745.  
  746.             // get humanity
  747.             _humanity = player getVariable ["humanity",0];
  748.             _traderMenu = call compile format["menu_%1;",_traderType];
  749.  
  750.             // diag_log ("TRADER = " + str(_traderMenu));
  751.            
  752.             _low_high = "low";
  753.             _humanity_logic = false;
  754.             if((_traderMenu select 2) == "friendly") then {
  755.                 _humanity_logic = (_humanity < -5000);
  756.             };
  757.             if((_traderMenu select 2) == "hostile") then {
  758.                 _low_high = "high";
  759.                 _humanity_logic = (_humanity > -5000);
  760.             };
  761.             if((_traderMenu select 2) == "hero") then {
  762.                 _humanity_logic = (_humanity < 5000);
  763.             };
  764.             if(_humanity_logic) then {
  765.                 _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
  766.                 s_player_parts set [count s_player_parts,_cancel];
  767.             } else {
  768.                
  769.                 // Static Menu
  770.                 {
  771.                     //diag_log format["DEBUG TRADER: %1", _x];
  772.                     _buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
  773.                     s_player_parts set [count s_player_parts,_buy];
  774.                
  775.                 } count (_traderMenu select 1);
  776.                 // Database menu
  777.                 _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  778.                 s_player_parts set [count s_player_parts,_buy];
  779.  
  780.             };
  781.             s_player_parts_crtl = 1;
  782.            
  783.         };
  784.     } else {
  785.         {player removeAction _x} count s_player_parts;s_player_parts = [];
  786.         s_player_parts_crtl = -1;
  787.     };
  788.  
  789.    
  790.     if(dayz_tameDogs) then {
  791.        
  792.         //Dog
  793.         if (_isDog && _isAlive && (_hasRawMeat) && _ownerID == "0" && player getVariable ["dogID", 0] == 0) then {
  794.             if (s_player_tamedog < 0) then {
  795.                 s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""];
  796.             };
  797.         } else {
  798.             player removeAction s_player_tamedog;
  799.             s_player_tamedog = -1;
  800.         };
  801.         if (_isDog && _ownerID == dayz_characterID && _isAlive) then {
  802.             _dogHandle = player getVariable ["dogID", 0];
  803.             if (s_player_feeddog < 0 && _hasRawMeat) then {
  804.                 s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""];
  805.             };
  806.             if (s_player_waterdog < 0 && "ItemWaterbottle" in _magazinesPlayer) then {
  807.                 s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""];
  808.             };
  809.             if (s_player_staydog < 0) then {
  810.                 _lieDown = _dogHandle getFSMVariable "_actionLieDown";
  811.                 if (_lieDown) then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  812.                 s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true,"",""];
  813.             };
  814.             if (s_player_trackdog < 0) then {
  815.                 s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true,"",""];
  816.             };
  817.             if (s_player_barkdog < 0) then {
  818.                 s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true,"",""];
  819.             };
  820.             if (s_player_warndog < 0) then {
  821.                 _warn = _dogHandle getFSMVariable "_watchDog";
  822.                 if (_warn) then { _text = (localize "str_epoch_player_247"); _warn = false; } else { _text = (localize "str_epoch_player_248"); _warn = true; };
  823.                 s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true,"",""];       
  824.             };
  825.             if (s_player_followdog < 0) then {
  826.                 s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true,"",""];
  827.             };
  828.         } else {
  829.             player removeAction s_player_feeddog;
  830.             s_player_feeddog = -1;
  831.             player removeAction s_player_waterdog;
  832.             s_player_waterdog = -1;
  833.             player removeAction s_player_staydog;
  834.             s_player_staydog = -1;
  835.             player removeAction s_player_trackdog;
  836.             s_player_trackdog = -1;
  837.             player removeAction s_player_barkdog;
  838.             s_player_barkdog = -1;
  839.             player removeAction s_player_warndog;
  840.             s_player_warndog = -1;
  841.             player removeAction s_player_followdog;
  842.             s_player_followdog = -1;
  843.         };
  844.     };
  845.  
  846. } else {
  847.     //Engineering
  848.     {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  849.     s_player_repair_crtl = -1;
  850.  
  851.     {player removeAction _x} count s_player_combi;s_player_combi = [];
  852.        
  853.     dayz_myCursorTarget = objNull;
  854.     s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  855.  
  856.     {player removeAction _x} count s_player_parts;s_player_parts = [];
  857.     s_player_parts_crtl = -1;
  858.  
  859.     {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  860.     s_player_lockUnlock_crtl = -1;
  861.  
  862.     player removeAction s_player_checkGear;
  863.     s_player_checkGear = -1;
  864.  
  865.     player removeAction s_player_SurrenderedGear;
  866.     s_player_SurrenderedGear = -1;
  867.  
  868.     //Others
  869.     player removeAction s_player_plotManagement;
  870.     s_player_plotManagement = -1;
  871.     player removeAction s_player_forceSave;
  872.     s_player_forceSave = -1;
  873.     player removeAction s_player_flipveh;
  874.     s_player_flipveh = -1;
  875.     player removeAction s_player_sleep;
  876.     s_player_sleep = -1;
  877.     player removeAction s_player_deleteBuild;
  878.     s_player_deleteBuild = -1;
  879.     player removeAction s_player_butcher;
  880.     s_player_butcher = -1;
  881.     player removeAction s_player_cook;
  882.     s_player_cook = -1;
  883.     player removeAction s_player_boil;
  884.     s_player_boil = -1;
  885.     player removeAction s_player_fireout;
  886.     s_player_fireout = -1;
  887.     player removeAction s_player_packtent;
  888.     s_player_packtent = -1;
  889.     player removeAction s_player_fillfuel;
  890.     s_player_fillfuel = -1;
  891.     player removeAction s_player_studybody;
  892.     s_player_studybody = -1;
  893.     //Dog
  894.     player removeAction s_player_tamedog;
  895.     s_player_tamedog = -1;
  896.     player removeAction s_player_feeddog;
  897.     s_player_feeddog = -1;
  898.     player removeAction s_player_waterdog;
  899.     s_player_waterdog = -1;
  900.     player removeAction s_player_staydog;
  901.     s_player_staydog = -1;
  902.     player removeAction s_player_trackdog;
  903.     s_player_trackdog = -1;
  904.     player removeAction s_player_barkdog;
  905.     s_player_barkdog = -1;
  906.     player removeAction s_player_warndog;
  907.     s_player_warndog = -1;
  908.     player removeAction s_player_followdog;
  909.     s_player_followdog = -1;
  910.    
  911.     // vault
  912.     player removeAction s_player_unlockvault;
  913.     s_player_unlockvault = -1;
  914.     player removeAction s_player_packvault;
  915.     s_player_packvault = -1;
  916.     player removeAction s_player_lockvault;
  917.     s_player_lockvault = -1;
  918.  
  919.     player removeAction s_player_information;
  920.     s_player_information = -1;
  921.     player removeAction s_player_fillgen;
  922.     s_player_fillgen = -1;
  923.     player removeAction s_player_upgrade_build;
  924.     s_player_upgrade_build = -1;
  925.     player removeAction s_player_maint_build;
  926.     s_player_maint_build = -1;
  927.     player removeAction s_player_downgrade_build;
  928.     s_player_downgrade_build = -1;
  929.     player removeAction s_player_towing;
  930.     s_player_towing = -1;
  931.     player removeAction s_player_fuelauto;
  932.     s_player_fuelauto = -1;
  933.     player removeAction s_player_fuelauto2;
  934.     s_player_fuelauto2 = -1;
  935. };
  936.  
  937.  
  938.  
  939. //Dog actions on player self
  940. _dogHandle = player getVariable ["dogID", 0];
  941. if (_dogHandle > 0) then {
  942.     _dog = _dogHandle getFSMVariable "_dog";
  943.     _ownerID = "0";
  944.     if (!isNull cursorTarget) then { _ownerID = cursorTarget getVariable ["CharacterID","0"]; };
  945.     if (_canDo && !_inVehicle && alive _dog && _ownerID != dayz_characterID) then {
  946.         if (s_player_movedog < 0) then {
  947.             s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, false, true, "", ""];
  948.         };
  949.         if (s_player_speeddog < 0) then {
  950.             _text = (localize "str_epoch_player_249");
  951.             _speed = 0;
  952.             if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = (localize "str_epoch_player_250"); };
  953.             s_player_speeddog = player addAction [format[localize "str_actions_speeddog", _text], "\z\addons\dayz_code\actions\dog\speed.sqf",[player getVariable ["dogID", 0],_speed], 0, false, true, "", ""];
  954.         };
  955.         if (s_player_calldog < 0) then {
  956.             s_player_calldog = player addAction [localize "str_actions_calldog", "\z\addons\dayz_code\actions\dog\follow.sqf", [player getVariable ["dogID", 0], true], 2, false, true, "", ""];
  957.         };
  958.     };
  959. } else {
  960.     player removeAction s_player_movedog;      
  961.     s_player_movedog =      -1;
  962.     player removeAction s_player_speeddog;
  963.     s_player_speeddog =     -1;
  964.     player removeAction s_player_calldog;
  965.     s_player_calldog =      -1;
  966. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement