SHARE
TWEET

fn_selfactions.sqf

a guest Feb 18th, 2017 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. scriptName "Functions\misc\fn_selfActions.sqf";
  2.  
  3. 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"];
  4.  
  5. if (DZE_ActionInProgress) exitWith {};
  6.  
  7. _vehicle = vehicle player;
  8. _isPZombie = player isKindOf "PZombie_VB";
  9. _inVehicle = (_vehicle != player);
  10. _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  11. _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
  12. _nearLight =    nearestObject [player,"LitObject"];
  13. _canPickLight = false;
  14.  
  15.  
  16. ///////spawns events manually
  17.  
  18. _adminsList= call compile preProcessFileLineNumbers "superadmins.sqf";
  19. if((getPlayerUID player) in _adminsList) then {
  20.         if (s_player_run_events < 0) then {
  21.         s_player_run_events = player addaction [("<t color=""#0074E8"">" + ("Events Menu") +"</t>"),"custom\execute.sqf","",5,false,true,"",""];
  22.         };    
  23. } else {
  24.     player removeAction s_player_run_events;
  25.     s_player_run_events = -1;
  26. };
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. if (!isNull _nearLight) then {
  34.     if (_nearLight distance player < 4) then {
  35.         _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
  36.     };
  37. };
  38.  
  39.  
  40.  
  41.  
  42. if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
  43.     if (s_player_grabflare < 0) then {
  44.         _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
  45.         s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
  46.         s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
  47.     };
  48. } else {
  49.     player removeAction s_player_grabflare;
  50.     player removeAction s_player_removeflare;
  51.     s_player_grabflare = -1;
  52.     s_player_removeflare = -1;
  53. };
  54.  
  55.  
  56.  
  57. if (DZE_HeliLift) then {
  58.     _hasAttached = _vehicle getVariable["hasAttached",false];
  59.     if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) < 30) && (speed _vehicle < 5) && (typeName _hasAttached == "OBJECT")) then {
  60.         if (s_player_heli_detach < 0) then {
  61.             dayz_myLiftVehicle = _vehicle;
  62.             s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""];
  63.         };
  64.     } else {
  65.         dayz_myLiftVehicle removeAction s_player_heli_detach;
  66.         s_player_heli_detach = -1;
  67.     };
  68. };
  69.  
  70. if(DZE_HaloJump) then {
  71.     if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) > 400)) then {
  72.         if (s_halo_action < 0) then {
  73.             DZE_myHaloVehicle = _vehicle;
  74.             s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""];
  75.         };
  76.     } else {
  77.         DZE_myHaloVehicle removeAction s_halo_action;
  78.         s_halo_action = -1;
  79.     };
  80. };
  81.  
  82. if (!DZE_ForceNameTagsOff) then {
  83.     if (s_player_showname < 0 && !_isPZombie) then {
  84.         if (DZE_ForceNameTags) then {
  85.             s_player_showname = 1;
  86.             player setVariable["DZE_display_name",true,true];
  87.         } else {
  88.             s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false, "",""];
  89.             s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false, "",""];
  90.         };
  91.     };
  92. };
  93.  
  94. if(_isPZombie) then {
  95.     if (s_player_callzombies < 0) then {
  96.         s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
  97.     };
  98.     if (DZE_PZATTACK) then {
  99.         call pz_attack;
  100.         DZE_PZATTACK = false;
  101.     };
  102.     if (s_player_pzombiesvision < 0) then {
  103.         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"];
  104.     };
  105.     if (!isNull cursorTarget && (player distance cursorTarget < 3)) then {
  106.         _isAnimal = cursorTarget isKindOf "Animal";
  107.         _isZombie = cursorTarget isKindOf "zZombie_base";
  108.         _isHarvested = cursorTarget getVariable["meatHarvested",false];
  109.         _isMan = cursorTarget isKindOf "Man";
  110.         if (!alive cursorTarget && (_isAnimal || _isMan) && !_isZombie && !_isHarvested) then {
  111.             if (s_player_pzombiesfeed < 0) then {
  112.                 s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""];
  113.             };
  114.         } else {
  115.             player removeAction s_player_pzombiesfeed;
  116.             s_player_pzombiesfeed = -1;
  117.         };
  118.     } else {
  119.         player removeAction s_player_pzombiesfeed;
  120.         s_player_pzombiesfeed = -1;
  121.     };
  122. };
  123.  
  124. _allowedDistance = 4;
  125. _isAir = cursorTarget isKindOf "Air";
  126. _isShip = cursorTarget isKindOf "Ship";
  127.  
  128. if(_isAir || _isShip) then {
  129.     _allowedDistance = 8;
  130. };
  131.  
  132. if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then {   //Has some kind of target
  133.  
  134.     _cursorTarget = cursorTarget;
  135.     _typeOfCursorTarget = typeOf _cursorTarget;
  136.     _isVehicle = _cursorTarget isKindOf "AllVehicles";
  137.     _isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
  138.     _isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
  139.     _magazinesPlayer = magazines player;
  140.     _hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
  141.     _hastinitem = false;
  142.  
  143.     {
  144.         if (_x in _magazinesPlayer) then {
  145.             _hastinitem = true;
  146.         };
  147.     } count boil_tin_cans;
  148.  
  149.     _hasFuelE = "ItemJerrycanEmpty" in _magazinesPlayer;
  150.     _hasFuelBarrelE = "ItemFuelBarrelEmpty" in _magazinesPlayer;
  151.     _hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
  152.     _itemsPlayer = items player;
  153.     _temp_keys = [];
  154.     _temp_keys_names = [];
  155.     _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
  156.  
  157.     {
  158.         if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
  159.             _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
  160.             _ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
  161.             _temp_keys_names set [_ownerKeyId,_ownerKeyName];
  162.             _temp_keys set [count _temp_keys,str(_ownerKeyId)];
  163.         };
  164.     } count _itemsPlayer;
  165.  
  166.     _hasKnife = "ItemKnife" in _itemsPlayer;
  167.     _hasToolbox = "ItemToolbox" in _itemsPlayer;
  168.     _isMan = _cursorTarget isKindOf "Man";
  169.     _traderType = _typeOfCursorTarget;
  170.     _ownerID = _cursorTarget getVariable ["CharacterID","0"];
  171.     _isAnimal = _cursorTarget isKindOf "Animal";
  172.     _isDog =  (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
  173.     _isZombie = _cursorTarget isKindOf "zZombie_base";
  174.     _isDestructable = _cursorTarget isKindOf "BuiltItems";
  175.     _isWreck = _typeOfCursorTarget in DZE_isWreck;
  176.     _isWreckBuilding = _typeOfCursorTarget in DZE_isWreckBuilding;
  177.     //_isModular = _cursorTarget isKindOf "ModularItems";
  178.     _isModular = (_cursorTarget isKindOf "ModularItems") or ((typeOf _cursorTarget) in DZE_SurvivedHouseRemove);
  179.     _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
  180.     _isRemovable = _typeOfCursorTarget in DZE_isRemovable;
  181.     _isDisallowRepair = _typeOfCursorTarget in ["M240Nest_DZ"];
  182.     _isTent = _cursorTarget isKindOf "TentStorage";
  183.     _isAlive = alive _cursorTarget;
  184.     _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  185.     _rawmeat = meatraw;
  186.     _hasRawMeat = false;
  187.  
  188.     {
  189.         if (_x in _magazinesPlayer) then {
  190.             _hasRawMeat = true;
  191.         };
  192.     } count _rawmeat;
  193.  
  194.     _isFuel = false;
  195.  
  196.     if (_hasFuelE || _hasFuelBarrelE) then {
  197.         {
  198.             if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
  199.         } count dayz_fuelsources;
  200.     };
  201.  
  202.     _player_flipveh = false;
  203.     _player_deleteBuild = false;
  204.     _player_lockUnlock_crtl = false;
  205.  
  206.  
  207.  
  208.  
  209.    
  210.    
  211.    
  212.     ////////////////WORKSHOP///
  213. if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "MAP_kulna")) then {
  214.  
  215. if (s_player_manageworkshop < 0) then {
  216.     s_player_manageworkshop = player addAction ["<t color='#66CCFF'>MANAGE WORKSHOP</t>", "custom\scripts\workshop\hpp\workshopmenu.sqf", [], 5, false];
  217.     };
  218.     } else {
  219.    
  220.     player removeAction s_player_manageworkshop;
  221.     s_player_manageworkshop = -1;
  222.     };
  223.  
  224.  
  225.    
  226.     ////////////////hospital hero///
  227. if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "GUE_WarfareBFieldhHospital")) then {
  228. if (s_player_hospitalhero < 0) then {
  229.     s_player_hospitalhero = player addAction ["<t color='#ff5200'>Heal-in-Tent</t>", "custom\scripts\workshop\sqfs\healhospital.sqf", [], 5, false];
  230.     };
  231.     } else {
  232.     player removeAction s_player_hospitalhero;
  233.     s_player_hospitalhero = -1;
  234.     };
  235.     ///////////////////////////////////////////
  236.     if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
  237.    
  238.     if (s_player_workshop < 0) then {
  239.    
  240.  
  241.     _adminList = ["0152"]; // Add admins here if you admins to able to manage all plotpoles
  242.     _owner = _cursorTarget getVariable ["CharacterID","0"];
  243.     _friends = _cursorTarget getVariable ["plotfriends", []];
  244.     _fuid = [];
  245.     {
  246.     _friendUID = _x select 0;
  247.     _fuid = _fuid + [_friendUID];
  248.     } forEach _friends;
  249.     _allowed = [_owner];    
  250.     _allowed = [_owner] + _adminList + _fuid;
  251.     if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then{            
  252.    
  253.     s_player_workshop = player addAction ["<t color='#66CCFF'>CRAFT-WORKSHOP</t>", "custom\scripts\workshop\createworkshop.sqf", [], 5, false];
  254.     };
  255.     };
  256.    
  257.    
  258.    
  259.     if (s_player_plotManagement < 0) then {
  260.     _adminList = ["0152"]; // Add admins here if you admins to able to manage all plotpoles
  261.     _owner = _cursorTarget getVariable ["CharacterID","0"];
  262.     _friends = _cursorTarget getVariable ["plotfriends", []];
  263.     _fuid = [];
  264.     {
  265.     _friendUID = _x select 0;
  266.     _fuid = _fuid + [_friendUID];
  267.     } forEach _friends;
  268.     _allowed = [_owner];    
  269.     _allowed = [_owner] + _adminList + _fuid;
  270.     if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then{            
  271.     s_player_plotManagement = player addAction ["<t color='#0059FF'>PLOT-MANAGE</t>", "plotManagement\initPlotManagement.sqf", [], 5, false];
  272.     };
  273. };
  274.  
  275.          
  276.     } else {
  277.    
  278.     player removeAction s_player_workshop;
  279.     s_player_workshop = -1;
  280.     player removeAction s_player_plotManagement;
  281.     s_player_plotManagement = -1;
  282.     player removeAction s_player_maintain_area;
  283.     s_player_maintain_area = -1;
  284.     player removeAction s_player_maintain_area_preview;
  285.     s_player_maintain_area_preview = -1;
  286. };
  287.  
  288.  
  289.    
  290.     if(_isAlive) then {
  291.        
  292.         if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
  293.             if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  294.                 _player_deleteBuild = true;
  295.             };
  296.         };
  297.  
  298. ///Allow owners to delete modulars
  299. if(_isModular) then {
  300.         if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  301.             _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
  302.             _IsNearPlot = count (_findNearestPoles);
  303.             _fuid  = [];
  304.             _allowed = [];
  305.             if(_IsNearPlot > 0)then{
  306.                 _thePlot = _findNearestPoles select 0;
  307.                 _owner =  _thePlot getVariable ["CharacterID","010"];
  308.                 _friends = _thePlot getVariable ["plotfriends", []];
  309.                 {
  310.                   _friendUID = _x select 0;
  311.                   _fuid  =  _fuid  + [_friendUID];
  312.                 } forEach _friends;
  313.                 _allowed = [_owner];    
  314.                 _allowed = [_owner] +  _fuid;  
  315.                 if (_owner == dayz_characterID || (getPlayerUID player) in _allowed) then {  // // If u want that the object also belongs to someone on the plotpole.
  316.                     _player_deleteBuild = true;
  317.                 };                  
  318.             }else{
  319.                 if(_owner == dayz_characterID)then{
  320.                     _player_deleteBuild = true;
  321.                 };
  322.             };                                        
  323.         };
  324. };
  325. //Allow owners to delete modular doors without locks
  326. if(_isModularDoor) then {
  327.         if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {        
  328.             _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
  329.             _IsNearPlot = count (_findNearestPoles);
  330.             _fuid  = [];
  331.             _allowed = [];
  332.             if(_IsNearPlot > 0)then{
  333.                 _thePlot = _findNearestPoles select 0;
  334.                 _owner =  _thePlot getVariable ["CharacterID","010"];
  335.                 _friends = _thePlot getVariable ["plotfriends", []];
  336.                 {
  337.                   _friendUID = _x select 0;
  338.                   _fuid  =  _fuid  + [_friendUID];
  339.                 } forEach _friends;
  340.                 _allowed = [_owner];    
  341.                 _allowed = [_owner] +  _fuid;  
  342.                 if (_owner == dayz_characterID || (getPlayerUID player) in _allowed) then { //  // If u want that the object also belongs to someone on the plotpole.
  343.                     _player_deleteBuild = true;
  344.                 };                  
  345.             }else{
  346.                 if(_owner == dayz_characterID)then{
  347.                     _player_deleteBuild = true;
  348.                 };
  349.             };                              
  350.         };      
  351. };
  352.        
  353.         if(_isVehicle) then {
  354.            
  355.             if (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (count (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) select 2) < 0.5) then {
  356.                 _playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
  357.                 if(_isVehicletype || (_playersNear >= 2)) then {
  358.                     _player_flipveh = true;
  359.                 };
  360.             };
  361.  
  362.             if(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) then {
  363.                 _player_lockUnlock_crtl = true;
  364.             };
  365.         };
  366.     };
  367.  
  368.     if(_player_deleteBuild) then {
  369.         if (s_player_deleteBuild < 0) then {
  370.             s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  371.         };
  372.     } else {
  373.         player removeAction s_player_deleteBuild;
  374.         s_player_deleteBuild = -1;
  375.     };
  376.  
  377.     if (DZE_HeliLift) then {
  378.  
  379.         _liftHeli = objNull;
  380.         _found = false;
  381.         _allowTow = false;
  382.  
  383.         if ((count (crew _cursorTarget)) == 0) then {
  384.             {
  385.                 if(!_allowTow) then {
  386.                     _allowTow = _cursorTarget isKindOf _x;
  387.                 };
  388.             } count DZE_HeliAllowToTow;
  389.         };
  390.  
  391.         if (_allowTow) then {
  392.             _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
  393.             {
  394.                 if(!_found) then {
  395.                     _posL = [_x] call FNC_getPos;
  396.                     _posC = [_cursorTarget] call FNC_getPos;
  397.                     _height = (_posL select 2) - (_posC select 2);
  398.                     _hasAttached = _x getVariable["hasAttached",false];
  399.                     if(_height < 15 && _height > 5 && (typeName _hasAttached != "OBJECT")) then {
  400.                         if(((abs((_posL select 0) - (_posC select 0))) < 10) && ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
  401.                             _liftHeli = _x;
  402.                             _found = true;
  403.                         };
  404.                     };
  405.                 };
  406.             } count _liftHelis;
  407.         };
  408.  
  409.         _attached = _cursorTarget getVariable["attached",false];
  410.  
  411.         if(_found && _allowTow && _canDo && !locked _cursorTarget && !_isPZombie && (typeName _attached != "OBJECT")) then {
  412.             if (s_player_heli_lift < 0) then {
  413.                 s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true, "",""];
  414.             };
  415.         } else {
  416.             player removeAction s_player_heli_lift;
  417.             s_player_heli_lift = -1;
  418.         };
  419.     };
  420.  
  421.     if(_player_lockUnlock_crtl) then {
  422.         if (s_player_lockUnlock_crtl < 0) then {
  423.             _hasKey = _ownerID in _temp_keys;
  424.             _oldOwner = (_ownerID == dayz_playerUID);
  425.             if(locked _cursorTarget) then {
  426.                 if(_hasKey || _oldOwner) then {
  427.                     _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, "", ""];
  428.                     s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  429.                     s_player_lockUnlock_crtl = 1;
  430.                 } else {
  431.                     if(_hasHotwireKit) then {
  432.                         _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
  433.                     } else {
  434.                         _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, true, true, "", ""];
  435.                     };
  436.                     s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  437.                     s_player_lockUnlock_crtl = 1;
  438.                 };
  439.             } else {
  440.                 if(_hasKey || _oldOwner) then {
  441.                     _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
  442.                     s_player_lockunlock set [count s_player_lockunlock,_lock];
  443.                     s_player_lockUnlock_crtl = 1;
  444.                 };
  445.             };
  446.         };
  447.     } else {
  448.         {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  449.         s_player_lockUnlock_crtl = -1;
  450.     };
  451.  
  452.     if(DZE_AllowForceSave) then {
  453.  
  454.     if((_isVehicle || _isTent) && !_isMan) then {
  455.             if (s_player_forceSave < 0) then {
  456.                 s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
  457.             };
  458.         } else {
  459.             player removeAction s_player_forceSave;
  460.             s_player_forceSave = -1;
  461.         };
  462.     };
  463.  
  464.    
  465.    
  466.     if(DZE_AllowCargoCheck) then {
  467.         if((_isVehicle || _isTent || _isnewstorage) && _isAlive && !_isMan && !locked _cursorTarget) then {
  468.             if (s_player_checkGear < 0) then {
  469.                 s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""];
  470.             };
  471.         } else {
  472.             player removeAction s_player_checkGear;
  473.             s_player_checkGear = -1;
  474.         };
  475.     };
  476.  
  477.     if(_player_flipveh) then {
  478.         if (s_player_flipveh  < 0) then {
  479.             s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];     
  480.         };
  481.     } else {
  482.         player removeAction s_player_flipveh;
  483.         s_player_flipveh = -1;
  484.     };
  485.  
  486.     if((_hasFuelE || _hasFuelBarrelE) && _isFuel) then {
  487.         if (s_player_fillfuel < 0) then {
  488.             s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
  489.         };
  490.     } else {
  491.         player removeAction s_player_fillfuel;
  492.         s_player_fillfuel = -1;
  493.     };
  494.    
  495.     _player_butcher = false;
  496.     _player_studybody = false;
  497.     _player_SurrenderedGear = false;
  498.  
  499.     if (!_isAlive) then {
  500.     if (_isZombie) then {
  501.     if (s_player_checkzed < 0) then {
  502.     s_player_checkzed = player addAction ["<t color='#ff5200'>CheckZed</t>", "custom\scripts\checkzed.sqf", [], 5, false];
  503.     };
  504.     } else {
  505.     player removeAction s_player_checkzed;
  506.     s_player_checkzed = -1;
  507.     };
  508.  
  509.         if((_isAnimal || _isZombie) && _hasKnife) then {
  510.             _isHarvested = _cursorTarget getVariable["meatHarvested",false];
  511.             if (!_isHarvested) then {
  512.                 _player_butcher = true;
  513.             };
  514.         };
  515.  
  516.         if (_isMan && !_isZombie && !_isAnimal) then {
  517.             _player_studybody = true;
  518.         }
  519.     } else {
  520.  
  521.         if(_isMan && !_isZombie && !_isAnimal) then {
  522.             _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",false];
  523.             if (_isSurrendered) then {
  524.                 _player_SurrenderedGear = true;
  525.             };
  526.         };
  527.     };
  528.  
  529.     if (_player_butcher) then {
  530.         if (s_player_butcher < 0) then {
  531.             if(_isZombie) then {
  532.                 s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, true, true, "", ""];
  533.             } else {
  534.                 s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
  535.             };
  536.         };
  537.     } else {
  538.         player removeAction s_player_butcher;
  539.         s_player_butcher = -1;
  540.     };
  541.  
  542.     if (_player_studybody) then {
  543.         if (s_player_studybody < 0) then {
  544.                 s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "ZSC\actions\check_wallet.sqf",_cursorTarget, 0, false, true, "",""];
  545.         };
  546.     } else {
  547.         player removeAction s_player_studybody;
  548.         s_player_studybody = -1;
  549.     };
  550.  
  551.     _player_cook = false;
  552.     _player_boil = false;
  553.  
  554.     if (inflamed _cursorTarget) then {
  555.  
  556.         if (_hasRawMeat) then {
  557.             _player_cook = true;   
  558.         };
  559.  
  560.         if (_hasbottleitem && _hastinitem) then {
  561.             _player_boil = true;
  562.         };
  563.     };
  564.  
  565.     if (_player_SurrenderedGear) then {
  566.         if (s_player_SurrenderedGear < 0) then {
  567.             s_player_SurrenderedGear = player addAction [localize "STR_EPOCH_ACTIONS_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true, "", ""];
  568.         };
  569.     } else {
  570.         player removeAction s_player_SurrenderedGear;
  571.         s_player_SurrenderedGear = -1;
  572.     };
  573.  
  574.     if (_player_cook) then {
  575.         if (s_player_cook < 0) then {
  576.             s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""];
  577.         };
  578.     } else {
  579.         player removeAction s_player_cook;
  580.         s_player_cook = -1;
  581.     };
  582.  
  583.     if (_player_boil) then {
  584.         if (s_player_boil < 0) then {
  585.             s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""];
  586.         };
  587.     } else {
  588.         player removeAction s_player_boil;
  589.         s_player_boil = -1;
  590.     };
  591.  
  592.     if(_cursorTarget == dayz_hasFire) then {
  593.         if ((s_player_fireout < 0) && !(inflamed _cursorTarget) && (player distance _cursorTarget < 3)) then {
  594.             s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true, "",""];
  595.         };
  596.     } else {
  597.         player removeAction s_player_fireout;
  598.         s_player_fireout = -1;
  599.     };
  600.  
  601.     if(_isTent && (player distance _cursorTarget < 3)) then {
  602.         if (_ownerID == dayz_characterID) then {
  603.             if (s_player_packtent < 0) then {
  604.                 s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""];
  605.             };
  606.         } else {
  607.             if(("ItemJerrycan" in _magazinesPlayer) && ("ItemMatchbox_DZE" in weapons player)) then {
  608.                 if (s_player_packtent < 0) then {
  609.                     s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  610.                 };
  611.             };
  612.         };
  613.     } else {
  614.         player removeAction s_player_packtent;
  615.         s_player_packtent = -1;
  616.     };
  617.  
  618.    
  619.    
  620.     if((_typeOfCursorTarget in DZE_LockableStorage) && _ownerID != "0" && (player distance _cursorTarget < 3)) then {
  621.         if (s_player_unlockvault < 0) then {
  622.             if(_typeOfCursorTarget in DZE_LockedStorage) then {
  623.                 if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then {
  624.                     _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
  625.                     s_player_combi set [count s_player_combi,_combi];
  626.                 } else {
  627.                     _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  628.                     s_player_combi set [count s_player_combi,_combi];
  629.                 };
  630.                 s_player_unlockvault = 1;
  631.             } else {
  632.                 if(_ownerID != dayz_combination && _ownerID != dayz_playerUID) then {
  633.                     _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  634.                     s_player_combi set [count s_player_combi,_combi];
  635.                     s_player_unlockvault = 1;
  636.                 };
  637.             };
  638.         };
  639.     } else {
  640.         {player removeAction _x} count s_player_combi;s_player_combi = [];
  641.         s_player_unlockvault = -1;
  642.     };
  643.  
  644.     if(_typeOfCursorTarget in ZSC_MoneyStorage && (player distance _cursorTarget < 5)) then {
  645.         if (s_bank_dialog < 0) then {
  646.                 s_bank_dialog = player addAction ["Money Storage", "ZSC\actions\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  647.         };
  648.     } else {
  649.         player removeAction s_bank_dialog;
  650.         s_bank_dialog = -1;
  651.     };
  652.  
  653.     // cars
  654.     if( _isVehicle && !_isMan &&_isAlive && !_isMan && !locked _cursorTarget && !(_cursorTarget isKindOf "Bicycle") && (player distance _cursorTarget < 5)) then {     
  655.         if (s_bank_dialog2 < 0) then {
  656.             s_bank_dialog2 = player addAction ["Money Storage", "ZSC\actions\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  657.         };         
  658.     } else {       
  659.         player removeAction s_bank_dialog2;
  660.         s_bank_dialog2 = -1;
  661.     };
  662.    
  663.  
  664.     if(_typeOfCursorTarget in DZE_UnLockedStorage && _ownerID != "0" && (player distance _cursorTarget < 3)) then {
  665.  
  666.         if (s_player_lockvault < 0) then {
  667.             if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then {
  668.                 s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true, "",""];
  669.             };
  670.         };
  671.         if (s_player_packvault < 0 && (_ownerID == dayz_combination || _ownerID == dayz_playerUID)) then {
  672.             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, "",""];
  673.         };
  674.  
  675.     } else {
  676.         player removeAction s_player_packvault;
  677.         s_player_packvault = -1;
  678.         player removeAction s_player_lockvault;
  679.         s_player_lockvault = -1;
  680.     };
  681.  
  682.     if(_typeOfCursorTarget == "Info_Board_EP1") then {
  683.         if (s_player_information < 0) then {
  684.             s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true, "",""];
  685.         };
  686.     } else {
  687.         player removeAction s_player_information;
  688.         s_player_information = -1;
  689.     };
  690.    
  691.     if (_isMan and _isAlive and !_isZombie and !_isAnimal and !(_traderType in serverTraders)) then {
  692.         if (s_givemoney_dialog < 0) then {
  693.             s_givemoney_dialog = player addAction [format["Give Money to %1", (name _cursorTarget)], "ZSC\actions\give_player_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  694.         };
  695.     } else {
  696.         player removeAction s_givemoney_dialog;
  697.         s_givemoney_dialog = -1;
  698.     };
  699.    
  700.     if(_typeOfCursorTarget in dayz_fuelpumparray) then {   
  701.         if (s_player_fuelauto < 0) then {
  702.            
  703.             _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
  704.             _findNearestGen = [];
  705.             {
  706.                 if (alive _x && (_x getVariable ["GeneratorRunning", false])) then {
  707.                     _findNearestGen set [(count _findNearestGen),_x];
  708.                 };
  709.             } count _findNearestGens;
  710.             _IsNearRunningGen = count (_findNearestGen);
  711.            
  712.             if(_IsNearRunningGen > 0) then {
  713.                 s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true, "",""];
  714.             } else {
  715.                 s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  716.             };
  717.         };
  718.     } else {
  719.         player removeAction s_player_fuelauto;
  720.         s_player_fuelauto = -1;
  721.     };
  722.  
  723.     if(_typeOfCursorTarget in DZE_fueltruckarray && alive _cursorTarget) then {
  724.         if (s_player_fuelauto2 < 0) then {
  725.             if(isEngineOn _cursorTarget) then {
  726.                 s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true, "",""];
  727.             } else {
  728.                 s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  729.             };
  730.         };
  731.     } else {
  732.         player removeAction s_player_fuelauto2;
  733.         s_player_fuelauto2 = -1;
  734.     };
  735.  
  736.     if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
  737.         if ((s_player_lastTarget select 0) != _cursorTarget) then {
  738.             if (s_player_upgrade_build > 0) then {
  739.                 player removeAction s_player_upgrade_build;
  740.                 s_player_upgrade_build = -1;
  741.             };
  742.         };
  743.         if (s_player_upgrade_build < 0) then {
  744.             s_player_lastTarget set [0,_cursorTarget];
  745.             s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "plotManagement\player_upgrade.sqf",_cursorTarget, -1, false, true, "",""];
  746.         };
  747.     } else {
  748.         player removeAction s_player_upgrade_build;
  749.         s_player_upgrade_build = -1;
  750.     };
  751.  
  752.     if((_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") && (DZE_Lock_Door == _ownerID)) then {
  753.         if ((s_player_lastTarget select 1) != _cursorTarget) then {
  754.             if (s_player_downgrade_build > 0) then {   
  755.                 player removeAction s_player_downgrade_build;
  756.                 s_player_downgrade_build = -1;
  757.             };
  758.         };
  759.         if (s_player_downgrade_build < 0) then {
  760.             s_player_lastTarget set [1,_cursorTarget];
  761.             s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "plotManagement\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true, "",""];
  762.         };
  763.     } else {
  764.         player removeAction s_player_downgrade_build;
  765.         s_player_downgrade_build = -1;
  766.     };
  767.  
  768.     if((_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ") && (damage _cursorTarget >= DZE_DamageBeforeMaint)) then {
  769.         if ((s_player_lastTarget select 2) != _cursorTarget) then {
  770.             if (s_player_maint_build > 0) then {   
  771.                 player removeAction s_player_maint_build;
  772.                 s_player_maint_build = -1;
  773.             };
  774.         };
  775.         if (s_player_maint_build < 0) then {
  776.             s_player_lastTarget set [2,_cursorTarget];
  777.             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, "",""];
  778.         };
  779.     } else {
  780.         player removeAction s_player_maint_build;
  781.         s_player_maint_build = -1;
  782.     };
  783.  
  784.     if(_cursorTarget isKindOf "Generator_DZ") then {
  785.         if (s_player_fillgen < 0) then {
  786.            
  787.             if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
  788.                 s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true, "",""];               
  789.             } else {
  790.                 if((_cursorTarget getVariable ["GeneratorFilled", false])) then {
  791.                     s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  792.                 } else {
  793.                     if("ItemJerrycan" in _magazinesPlayer) then {
  794.                         s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  795.                     };
  796.                 };
  797.             };
  798.         };
  799.     } else {
  800.         player removeAction s_player_fillgen;
  801.         s_player_fillgen = -1;
  802.     };
  803.  
  804.     if(_isTent && _ownerID == dayz_characterID) then {
  805.         if ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) then {
  806.             s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
  807.         };
  808.     } else {
  809.         player removeAction s_player_sleep;
  810.         s_player_sleep = -1;
  811.     };
  812.    
  813.     if ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) then {
  814.         if (s_player_repair_crtl < 0) then {
  815.             dayz_myCursorTarget = _cursorTarget;
  816.             _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  817.             _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  818.             s_player_repairActions set [count s_player_repairActions,_menu];
  819.             s_player_repairActions set [count s_player_repairActions,_menu1];
  820.             s_player_repair_crtl = 1;
  821.         } else {
  822.             {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  823.             s_player_repair_crtl = -1;
  824.         };
  825.     };
  826.  
  827.     if (_isMan && !_isPZombie && _traderType in serverTraders) then {
  828.  
  829.         if (s_player_parts_crtl < 0) then {
  830.  
  831.             _humanity = player getVariable ["humanity",0];
  832.             _traderMenu = call compile format["menu_%1;",_traderType];         
  833.             _low_high = "low";
  834.             _required="";
  835.             _humanity_logic = false;
  836.             _friendship_logic = false;
  837.             _Playersurviveddays = dayz_Survived;
  838.            
  839.             if((_traderMenu select 2) == "friendship") then {
  840.                 _friendship_logic = (_Playersurviveddays < 1);
  841.                 _required="Survive almost 1 day";
  842.             };
  843.  
  844.             if((_traderMenu select 2) == "friendly") then {
  845.                 _humanity_logic = (_humanity < -5000);
  846.                 _required="more than -5000 H";
  847.             };
  848.             if((_traderMenu select 2) == "hostile") then {
  849.                 _low_high = "high";
  850.                 _humanity_logic = (_humanity > -5000);
  851.                 _required="humanity to high";
  852.             };
  853.             if((_traderMenu select 2) == "hero") then {
  854.                 _humanity_logic = (_humanity < 5000);
  855.                 _required="humanity to low";
  856.             };
  857.  
  858.             if(_humanity_logic || _friendship_logic) then {
  859.             _cancel = player addAction [format["You cannot acces to this trader: %1 !",_required], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];  
  860.                 s_player_parts set [count s_player_parts,_cancel];
  861.             } else {
  862.                
  863.                 {
  864.                     _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, "",""];
  865.                     s_player_parts set [count s_player_parts,_buy];
  866.                
  867.                 } count (_traderMenu select 1);
  868.                 _buyV = player addAction ["<t color='#0059FF'>Advanced Trading</t>", "zupa\advancedTrading\init.sqf",(_traderMenu select 0), 999, true, false, "",""];
  869.                 s_player_parts set [count s_player_parts,_buyV];
  870.                 _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  871.                 s_player_parts set [count s_player_parts,_buy];
  872.  
  873.             };
  874.             s_player_parts_crtl = 1;
  875.         };
  876.     } else {
  877.         {player removeAction _x} count s_player_parts;s_player_parts = [];
  878.         s_player_parts_crtl = -1;
  879.     };
  880.  
  881.     if(dayz_tameDogs) then {
  882.  
  883.         if (_isDog && _isAlive && (_hasRawMeat) && _ownerID == "0" && player getVariable ["dogID", 0] == 0) then {
  884.             if (s_player_tamedog < 0) then {
  885.                 s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""];
  886.             };
  887.         } else {
  888.             player removeAction s_player_tamedog;
  889.             s_player_tamedog = -1;
  890.         };
  891.  
  892.         if (_isDog && _ownerID == dayz_characterID && _isAlive) then {
  893.             _dogHandle = player getVariable ["dogID", 0];
  894.             if (s_player_feeddog < 0 && _hasRawMeat) then {
  895.                 s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""];
  896.             };
  897.             if (s_player_waterdog < 0 && "ItemWaterbottle" in _magazinesPlayer) then {
  898.                 s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""];
  899.             };
  900.             if (s_player_staydog < 0) then {
  901.                 _lieDown = _dogHandle getFSMVariable "_actionLieDown";
  902.                 if (_lieDown) then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  903.                 s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true,"",""];
  904.             };
  905.             if (s_player_trackdog < 0) then {
  906.                 s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true,"",""];
  907.             };
  908.             if (s_player_barkdog < 0) then {
  909.                 s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true,"",""];
  910.             };
  911.             if (s_player_warndog < 0) then {
  912.                 _warn = _dogHandle getFSMVariable "_watchDog";
  913.                 if (_warn) then { _text = (localize "str_epoch_player_247"); _warn = false; } else { _text = (localize "str_epoch_player_248"); _warn = true; };
  914.                 s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true,"",""];       
  915.             };
  916.             if (s_player_followdog < 0) then {
  917.                 s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true,"",""];
  918.             };
  919.         } else {
  920.             player removeAction s_player_feeddog;
  921.             s_player_feeddog = -1;
  922.             player removeAction s_player_waterdog;
  923.             s_player_waterdog = -1;
  924.             player removeAction s_player_staydog;
  925.             s_player_staydog = -1;
  926.             player removeAction s_player_trackdog;
  927.             s_player_trackdog = -1;
  928.             player removeAction s_player_barkdog;
  929.             s_player_barkdog = -1;
  930.             player removeAction s_player_warndog;
  931.             s_player_warndog = -1;
  932.             player removeAction s_player_followdog;
  933.             s_player_followdog = -1;
  934.         };
  935.     };
  936.  
  937. } else {
  938. //Engineering
  939.  
  940. player removeAction s_player_manageworkshop;
  941.     s_player_manageworkshop = -1;
  942. player removeAction s_player_workshop;
  943.     s_player_workshop = -1;
  944.     player removeAction s_player_hospitalhero;
  945.     s_player_hospitalhero = -1;
  946.     player removeAction s_player_plotManagement;
  947.     s_player_plotManagement = -1;
  948.    
  949.     player removeAction s_player_checkzed;
  950.     s_player_checkzed = -1;
  951.     player removeAction s_player_wep;
  952.     s_player_wep = -1;
  953.    
  954.     {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  955.     s_player_repair_crtl = -1;
  956.     {player removeAction _x} count s_player_combi;s_player_combi = [];
  957.     dayz_myCursorTarget = objNull;
  958.     s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  959.     {player removeAction _x} count s_player_parts;s_player_parts = [];
  960.     s_player_parts_crtl = -1;
  961.     {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  962.     s_player_lockUnlock_crtl = -1;
  963.     player removeAction s_player_checkGear;
  964.     s_player_checkGear = -1;
  965.     player removeAction s_player_SurrenderedGear;
  966.     s_player_SurrenderedGear = -1;
  967.     player removeAction s_player_forceSave;
  968.     s_player_forceSave = -1;
  969.     player removeAction s_player_flipveh;
  970.     s_player_flipveh = -1;
  971.     player removeAction s_player_sleep;
  972.     s_player_sleep = -1;
  973.     player removeAction s_player_deleteBuild;
  974.     s_player_deleteBuild = -1;
  975.     player removeAction s_player_butcher;
  976.     s_player_butcher = -1;
  977.     player removeAction s_player_cook;
  978.     s_player_cook = -1;
  979.     player removeAction s_player_boil;
  980.     s_player_boil = -1;
  981.     player removeAction s_player_fireout;
  982.     s_player_fireout = -1;
  983.     player removeAction s_player_packtent;
  984.     s_player_packtent = -1;
  985.     player removeAction s_player_fillfuel;
  986.     s_player_fillfuel = -1;
  987.     player removeAction s_player_studybody;
  988.     s_player_studybody = -1;
  989. player removeAction s_player_run_events;
  990.     s_player_run_events = -1;
  991.     player removeAction s_player_tamedog;
  992.     s_player_tamedog = -1;
  993.     player removeAction s_player_feeddog;
  994.     s_player_feeddog = -1;
  995.     player removeAction s_player_waterdog;
  996.     s_player_waterdog = -1;
  997.     player removeAction s_player_staydog;
  998.     s_player_staydog = -1;
  999.     player removeAction s_player_trackdog;
  1000.     s_player_trackdog = -1;
  1001.     player removeAction s_player_barkdog;
  1002.     s_player_barkdog = -1;
  1003.     player removeAction s_player_warndog;
  1004.     s_player_warndog = -1;
  1005.     player removeAction s_player_followdog;
  1006.     s_player_followdog = -1;
  1007.     player removeAction s_player_unlockvault;
  1008.     s_player_unlockvault = -1;
  1009.     player removeAction s_player_packvault;
  1010.     s_player_packvault = -1;
  1011.     player removeAction s_player_lockvault;
  1012.     s_player_lockvault = -1;
  1013.     player removeAction s_player_information;
  1014.     s_player_information = -1;
  1015.     player removeAction s_player_fillgen;
  1016.     s_player_fillgen = -1;
  1017.     player removeAction s_player_upgrade_build;
  1018.     s_player_upgrade_build = -1;
  1019.     player removeAction s_player_maint_build;
  1020.     s_player_maint_build = -1;
  1021.     player removeAction s_player_downgrade_build;
  1022.     s_player_downgrade_build = -1;
  1023.     player removeAction s_player_towing;
  1024.     s_player_towing = -1;
  1025.     player removeAction s_player_fuelauto;
  1026.     s_player_fuelauto = -1;
  1027.     player removeAction s_player_fuelauto2;
  1028.     s_player_fuelauto2 = -1;
  1029.     player removeAction s_givemoney_dialog;
  1030.     s_givemoney_dialog = -1;
  1031.     player removeAction s_bank_dialog;
  1032.     s_bank_dialog = -1;
  1033.     player removeAction s_bank_dialog2;
  1034.     s_bank_dialog2 = -1;
  1035.     player removeAction s_player_packOBJ;
  1036.     s_player_packOBJ = -1;
  1037. };
  1038.  
  1039. _dogHandle = player getVariable ["dogID", 0];
  1040.  
  1041. if (_dogHandle > 0) then {
  1042.     _dog = _dogHandle getFSMVariable "_dog";
  1043.     _ownerID = "0";
  1044.     if (!isNull cursorTarget) then { _ownerID = cursorTarget getVariable ["CharacterID","0"]; };
  1045.     if (_canDo && !_inVehicle && alive _dog && _ownerID != dayz_characterID) then {
  1046.         if (s_player_movedog < 0) then {
  1047.             s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, false, true, "", ""];
  1048.         };
  1049.         if (s_player_speeddog < 0) then {
  1050.             _text = (localize "str_epoch_player_249");
  1051.             _speed = 0;
  1052.             if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = (localize "str_epoch_player_250"); };
  1053.             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, "", ""];
  1054.         };
  1055.         if (s_player_calldog < 0) then {
  1056.             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, "", ""];
  1057.         };
  1058.     };
  1059. } else {
  1060.     player removeAction s_player_movedog;      
  1061.     s_player_movedog =      -1;
  1062.     player removeAction s_player_speeddog;
  1063.     s_player_speeddog =     -1;
  1064.     player removeAction s_player_calldog;
  1065.     s_player_calldog =      -1;
  1066. };
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077. ////////////ACCIONES4//
  1078. private["_playerPos","_nearbank"];
  1079.  
  1080. _playerPos = getPosATL player;
  1081. _nearbank = count nearestObjects [_playerPos, ["USMC_LHD_Crew_White"], 3] > 0;
  1082.  
  1083. if (_nearbank) then {
  1084.         if (s_player_acc4 < 0) then {
  1085.             s_player_acc4 = player addaction[("<t color=""#3399cc"">" + ("TIME-BONUSx$5.000") +"</t>"),"custom\scripts\acciones\acciones4.sqf"];
  1086.         };
  1087.     } else {
  1088.         player removeAction s_player_acc4;
  1089.         s_player_acc4 = -1;
  1090.     };
  1091. ////////////////
  1092. /////////////ACCIONES5//
  1093. private["_playerPos","_nearbank"];
  1094.  
  1095. _playerPos = getPosATL player;
  1096. _nearbank = count nearestObjects [_playerPos, ["USMC_LHD_Crew_White"], 3] > 0;
  1097.  
  1098. if (_nearbank) then {
  1099.         if (s_player_acc5 < 0) then {
  1100.             s_player_acc5 = player addaction[("<t color=""#3399cc"">" + ("TIME-BONUSx$10.000") +"</t>"),"custom\scripts\acciones\acciones5.sqf"];
  1101.         };
  1102.     } else {
  1103.         player removeAction s_player_acc5;
  1104.         s_player_acc5 = -1;
  1105.     };
  1106. ////////////////
  1107.  
  1108. ////////////ACCIONES//
  1109. private["_playerPos","_nearbank"];
  1110.  
  1111. _playerPos = getPosATL player;
  1112. _nearbank = count nearestObjects [_playerPos, ["USMC_LHD_Crew_White"], 3] > 0;
  1113.  
  1114. if (_nearbank) then {
  1115.         if (s_player_acc1 < 0) then {
  1116.             s_player_acc1 = player addaction[("<t color=""#3399cc"">" + ("SAFE-BONUSx$5000") +"</t>"),"custom\scripts\acciones\acciones1.sqf"];
  1117.         };
  1118.     } else {
  1119.         player removeAction s_player_acc1;
  1120.         s_player_acc1 = -1;
  1121.     };
  1122. ////////////////
  1123.  
  1124. /////////////APUESTA//
  1125. private["_playerPos","_neartrader"];
  1126.  
  1127. _playerPos = getPosATL player;
  1128. _neartrader = count nearestObjects [_playerPos, ["USMC_LHD_Crew_White"], 3] > 0;
  1129.  
  1130. if (_neartrader) then {
  1131.         if (s_player_apuesta < 0) then {
  1132.             s_player_apuesta = player addaction[("<t color=""#F7D708"">" + ("BlackJackx$500") +"</t>"),"custom\scripts\apuesta\apuesta.sqf"];
  1133.         };
  1134.     } else {
  1135.         player removeAction s_player_apuesta;
  1136.         s_player_apuesta = -1;
  1137.     };
  1138. ////////////////
  1139.  
  1140. /////////////APUESTAGRANDE//
  1141. private["_playerPos","_neartrader"];
  1142.  
  1143. _playerPos = getPosATL player;
  1144. _neartrader = count nearestObjects [_playerPos, ["USMC_LHD_Crew_White"], 3] > 0;
  1145.  
  1146. if (_neartrader) then {
  1147.         if (s_player_apuesta4 < 0) then {
  1148.             s_player_apuesta4 = player addaction[("<t color=""#FF0000"">" + ("BlackJackx$30.000") +"</t>"),"custom\scripts\apuesta\apuestagrande.sqf"];
  1149.         };
  1150.     } else {
  1151.         player removeAction s_player_apuesta4;
  1152.         s_player_apuesta4 = -1;
  1153.     };
  1154. ////////////////
  1155.  
  1156.  
  1157. /////////////gamer//
  1158. private["_playerPos","_neartrade"];
  1159.  
  1160. _playerPos = getPosATL player;
  1161. _neartrade = count nearestObjects [_playerPos, ["Soldier_TL_PMC_DZ"], 3] > 0;
  1162.  
  1163. if (_neartrade) then {
  1164.         if (s_player_game < 0) then {
  1165.             s_player_game = player addaction[("<t color=""#00C732"">" + ("FindUsedItems") +"</t>"),"custom\scripts\games\gamerandom.sqf"];
  1166.         };
  1167.     } else {
  1168.         player removeAction s_player_game;
  1169.         s_player_game = -1;
  1170.     };
  1171. /////////////////
  1172.  
  1173.  
  1174.  
  1175. /////////////russian R//
  1176. private["_playerPos","_neargamble"];
  1177.  
  1178. _playerPos = getPosATL player;
  1179. _neargamble = count nearestObjects [_playerPos, ["Soldier_TL_PMC_DZ"], 4] > 0;
  1180.  
  1181. if (_neargamble) then {
  1182.         if (s_player_rulete < 0) then {
  1183.             s_player_rulete = player addaction[("<t color=""#F7D708"">" + ("RussianRoulette") +"</t>"),"custom\scripts\games\russianr2.sqf"];
  1184.         };
  1185.     } else {
  1186.         player removeAction s_player_rulete;
  1187.         s_player_rulete = -1;
  1188.     };
  1189. /////////////////
  1190.  
  1191. /////////////gypsie//
  1192. private["_playerPos","_neartrader"];
  1193.  
  1194. _playerPos = getPosATL player;
  1195. _neartrader = count nearestObjects [_playerPos, ["TK_CIV_Woman01_EP1"], 4] > 0;
  1196.  
  1197. if (_neartrader) then {
  1198.         if (s_player_gypsie < 0) then {
  1199.             s_player_gypsie = player addaction[("<t color=""#F7D708"">" + ("hear my luck") +"</t>"),"custom\scripts\gitana\gitana.sqf"];
  1200.         };
  1201.     } else {
  1202.         player removeAction s_player_gypsie;
  1203.         s_player_gypsie = -1;
  1204.     };
  1205. /////////////////
  1206. /////////////sex//
  1207. private["_playerPos","_neartrader"];
  1208.  
  1209. _playerPos = getPosATL player;
  1210. _neartrader = count nearestObjects [_playerPos, ["Hooker4"], 3] > 0;
  1211.  
  1212. if (_neartrader) then {
  1213.         if (s_player_sex < 0) then {
  1214.             s_player_sex = player addaction[("<t color=""#F7D708"">" + ("CompleteSex") +"</t>"),"custom\scripts\sex\sex.sqf"];
  1215.         };
  1216.     } else {
  1217.         player removeAction s_player_sex;
  1218.         s_player_sex = -1;
  1219.     };
  1220. /////////////////
  1221.  
  1222. //camping bag
  1223. private["_playerPos","_nearbag"];
  1224.  
  1225. _playerPos = getPosATL player;
  1226. _nearbag = count nearestObjects [_playerPos, ["Misc_Backpackheap_EP1"], 3] > 0;
  1227.  
  1228. if (_nearbag) then {
  1229.         if (s_player_cut < 0) then {
  1230.             s_player_cut = player addaction[("<t color=""#F7D708"">" + ("Cut Bags") +"</t>"),"custom\maps\action1.sqf"];
  1231.         };
  1232.     } else {
  1233.         player removeAction s_player_cut;
  1234.         s_player_cut = -1;
  1235.     };     
  1236.  
  1237. //camp tent
  1238. private["_playerPos","_neartent"];
  1239.  
  1240. _playerPos = getPosATL player;
  1241. _neartent = count nearestObjects [_playerPos, ["ACamp"], 3] > 0;
  1242.  
  1243. if (_neartent) then {
  1244.         if (s_player_cut2 < 0) then {
  1245.             s_player_cut2 = player addaction[("<t color=""#F7D708"">" + ("Open Tent") +"</t>"),"custom\maps\action2.sqf"];
  1246.         };
  1247.     } else {
  1248.         player removeAction s_player_cut2;
  1249.         s_player_cut2 = -1;
  1250.     };     
  1251.  
  1252.  
  1253.  private ["_hasitems"];
  1254.  
  1255. _hasitems = "ItemBandage" in magazines player;
  1256.  
  1257. if (_hasitems) then {
  1258. if (s_player_stickybomb2 < 0) then {
  1259.             s_player_stickybomb2 = player addaction[("<t color=""#F7D708"">" + ("STICKY BOMB") +"</t>"),"custom\stickybomb.sqf"];
  1260.         };
  1261.          
  1262.     } else {
  1263.         player removeAction s_player_stickybomb2;
  1264.         s_player_stickybomb2 = -1;
  1265.     };          
  1266.  
  1267. //defuse bomb
  1268. private["_playerPos","_nearbomb"];
  1269.  
  1270. _playerPos = getPosATL player;
  1271. _nearbomb = count nearestObjects [_playerPos, ["Training_target_EP1"], 3] > 0;
  1272.  
  1273. if (_nearbomb) then {
  1274.         if (s_player_def < 0) then {
  1275.             s_player_def = player addaction[("<t color=""#F7D708"">" + ("Defuse") +"</t>"),"custom\defusebomb.sqf"];
  1276.         };
  1277.     } else {
  1278.         player removeAction s_player_def;
  1279.         s_player_def = -1;
  1280.     };
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