SHARE
TWEET

FULL fn_SelfAction.sqf

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