Advertisement
ElDubya

Untitled

Mar 24th, 2015
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 54.28 KB | None | 0 0
  1. scriptName "Functions\misc\fn_selfActions.sqf";
  2. /***********************************************************
  3.     ADD ACTIONS FOR SELF
  4.     - Function
  5.     - [] call fnc_usec_selfActions;
  6. ************************************************************/
  7. private ["_buildOwner","_nearestBuilding","_nearestBuildList","_originHousing","_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_isModularDoor","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached"];
  8.  
  9. IF (DZE_ActionInProgress) exitWith {}; // Do NOT allow IF any script IS running.
  10.  
  11. _vehicle = vehicle player;
  12. _isPZombie = player isKindOf "PZombie_VB";
  13. _inVehicle = (_vehicle != player);
  14.  
  15. _onLadder =     (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  16. _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
  17.  
  18. _adminsList= CALL compile preProcessFileLineNumbers "superadmins.sqf";
  19. IF(("Cobalt_File" IN items player) AND ((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\fixes\execute.sqf","",5,FALSE,TRUE,"",""];
  22.         };    
  23. } ELSE {
  24.     player removeAction s_player_run_events;
  25.     s_player_run_events = -1;
  26. };
  27.  
  28. _nearLight =    nearestObject [player,"LitObject"];
  29. _canPickLight = FALSE;
  30. IF (!isNull _nearLight) THEN {
  31.     IF (_nearLight distance player < 4) THEN {
  32.         _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
  33.     };
  34. };
  35.  
  36. //Grab Flare
  37. IF (_canPickLight && !dayz_hasLight && !_isPZombie) THEN {
  38.     IF (s_player_grabflare < 0) THEN {
  39.         _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
  40.         s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, FALSE, TRUE, "", ""];
  41.         s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, FALSE, TRUE, "", ""];
  42.     };
  43. } ELSE {
  44.     player removeAction s_player_grabflare;
  45.     player removeAction s_player_removeflare;
  46.     s_player_grabflare = -1;
  47.     s_player_removeflare = -1;
  48. };
  49.  
  50. IF (_inVehicle && {_vehicle isKindOf "MV22"}) THEN {
  51.    IF (isEngineOn _vehicle) THEN {[_vehicle,0] CALL mv22_pack;};
  52.    IF (mv22_fold < 0) THEN {
  53.      themv22 = _vehicle;
  54.      IF !(isEngineOn themv22) THEN {
  55.        mv22_fold = themv22 addAction ["Fold","scripts\animate\mv22_fold.sqf","",5,FALSE,TRUE];
  56.        mv22_unfold = themv22 addAction ["UnFold","scripts\animate\mv22_unfold.sqf","",5,FALSE,TRUE];
  57.        mv22_open = themv22 addAction ["Open Ramp","scripts\animate\mv22_open.sqf","",5,FALSE,TRUE];
  58.        mv22_close = themv22 addAction ["Close Ramp","scripts\animate\mv22_close.sqf","",5,FALSE,TRUE];
  59.      };
  60.    };
  61.    IF (isEngineOn themv22) THEN {
  62.      themv22 removeAction mv22_fold;
  63.      mv22_fold = -1;
  64.      themv22 removeAction mv22_unfold;
  65.      mv22_unfold = -1;
  66.      themv22 removeAction mv22_open;
  67.      mv22_open = -1;
  68.      themv22 removeAction mv22_close;
  69.      mv22_close = -1;
  70.    };
  71. } ELSE {
  72.     IF (!isNil "themv22") THEN {
  73.        themv22 removeAction mv22_fold;
  74.        mv22_fold = -1;
  75.        themv22 removeAction mv22_unfold;
  76.        mv22_unfold = -1;
  77.        themv22 removeAction mv22_open;
  78.        mv22_open = -1;
  79.        themv22 removeAction mv22_close;
  80.        mv22_close = -1;
  81.    };
  82. };
  83.  
  84. IF (_inVehicle && {_vehicle isKindOf "ArmoredSUV_Base_PMC"}) THEN {
  85.    IF ((_vehicle animationPhase "HideGun_01") == 1) THEN {
  86.      _unit = _vehicle turretUnit [0];
  87.      IF (!(isNull _unit)) THEN {
  88.        _unit action ["moveToCargo",_vehicle,2];
  89.        titleText ["\n\nYou must open the hatch first.","PLAIN DOWN"];titleFadeOut 4;
  90.      };
  91.    };
  92.    IF (suv_close < 0) THEN {
  93.      thesuv = _vehicle;
  94.      suv_close = thesuv addAction ["Close Hatch","scripts\animate\suv_close.sqf","",5,FALSE,TRUE];
  95.      suv_open = thesuv addAction ["Open Hatch","scripts\animate\suv_open.sqf","",5,FALSE,TRUE];
  96.    };
  97. } ELSE {
  98.     IF (!isNil "thesuv") THEN {
  99.         thesuv removeAction suv_close;
  100.         suv_close = -1;
  101.         thesuv removeAction suv_open;
  102.         suv_open = -1;
  103.     };
  104. };
  105.  
  106. IF (DZE_HeliLift) THEN {
  107.     _hasAttached = _vehicle getVariable["hasAttached",FALSE];
  108.     IF(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] CALL FNC_getPos) SELECT 2) < 30) && (speed _vehicle < 5) && (typeName _hasAttached == "OBJECT")) THEN {
  109.         IF (s_player_heli_detach < 0) THEN {
  110.             dayz_myLiftVehicle = _vehicle;
  111.             s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,FALSE,TRUE,"",""];
  112.         };
  113.     } ELSE {
  114.         dayz_myLiftVehicle removeAction s_player_heli_detach;
  115.         s_player_heli_detach = -1;
  116.     };
  117. };
  118.  
  119. IF(DZE_HaloJump) THEN {
  120.     IF(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] CALL FNC_getPos) SELECT 2) > 400)) THEN {
  121.         IF (s_halo_action < 0) THEN {
  122.             DZE_myHaloVehicle = _vehicle;
  123.             s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,FALSE,TRUE,"",""];
  124.         };
  125.     } ELSE {
  126.         DZE_myHaloVehicle removeAction s_halo_action;
  127.         s_halo_action = -1;
  128.     };
  129. };
  130.  
  131. IF (!DZE_ForceNameTagsOff) THEN {
  132.     IF (s_player_showname < 0 && !_isPZombie) THEN {
  133.         IF (DZE_ForceNameTags) THEN {
  134.             s_player_showname = 1;
  135.             player setVariable["DZE_display_name",TRUE,TRUE];
  136.         } ELSE {
  137.             s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",TRUE, 0, TRUE, FALSE, "",""];
  138.             s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",FALSE, 0, TRUE, FALSE, "",""];
  139.         };
  140.     };
  141. };
  142.  
  143. IF(DZE_Origins_Building_System) THEN {
  144.     IF(isnil "s_player_build_origins_house") THEN {s_player_build_origins_house = -1;};
  145.     IF(isnil "s_player_build_origins_garage") THEN {s_player_build_origins_garage = -1;};
  146.     IF(isnil "s_player_build_origins_stronghold") THEN {s_player_build_origins_stronghold = -1;};
  147.     IF(isnil "s_player_origins_unlock") THEN {s_player_origins_unlock = -1;};
  148.     IF(isnil "s_player_origins_stronghold_doors") THEN {s_player_origins_stronghold_doors = -1;};
  149.     _cursorTarget = cursorTarget;
  150.     IF (!isNull _cursorTarget) THEN {
  151.         _typeOfCursorTarget = (typeOf _cursorTarget);
  152.         IF(_typeOfCursorTarget == DZE_Origins_Container ) THEN {
  153.             IF((player distance _cursorTarget) < DZE_Origins_Build_Distance) THEN {
  154.                 private["_humanity","_playerUID","_hasLevel1","_hasLevel2","_hasLevel3","_hasSG","_hasLG","_hasKING","_hasSH","_canBuildHouse","_houselevel","_humanityNeed","_actionText","_classname","_neededMaterials","_canBuildSH","_canBuildGarage"];
  155.                 _humanity = player getVariable["humanity",0];
  156.                 _playerUID = dayz_playerUID;
  157.                 _hasLevel1 = (_playerUID IN owner_H1 || _playerUID IN owner_B1);
  158.                 _hasLevel2 = (_playerUID IN owner_H2 || _playerUID IN owner_B2);
  159.                 _hasLevel3 = (_playerUID IN owner_H3 || _playerUID IN owner_B3);
  160.                 _hasSG = (_playerUID IN owner_SG);
  161.                 _hasLG = (_playerUID IN owner_LG);
  162.                 _hasKING = (_playerUID IN owner_KING);
  163.                 _hasSH = (_playerUID IN owner_SH);
  164.  
  165.                 {
  166.                     _houselevel = _x SELECT 0;
  167.                     _humanityNeed = _x SELECT 1;
  168.                     _actionText = _x SELECT 2;
  169.                     _classname = _x SELECT 3;
  170.                     _neededMaterials = _x SELECT 4;
  171.                     _canBuildHouse = FALSE;
  172.                     _canBuildGarage = FALSE;
  173.                     _canBuildSH = FALSE;
  174.  
  175.                     IF((_humanityNeed > 0 && _humanity >= _humanityNeed) || (_humanityNeed < 0 && _humanity <= _humanityNeed)) THEN {
  176.                         IF(_houselevel IN ["H1","B1"] && !_hasLevel1) THEN {
  177.                             _canBuildHouse = TRUE;
  178.                         };
  179.                         IF(_houselevel IN ["H2","B2"] && !_hasLevel2) THEN {
  180.                             _canBuildHouse = TRUE;
  181.                         };
  182.                         IF(_houselevel IN ["H3","B3"] && !_hasLevel3) THEN {
  183.                             _canBuildHouse = TRUE;
  184.                         };
  185.                         IF(_houselevel IN ["SGH","SGB"] && _hasLevel1 && !_hasSG) THEN {
  186.                             _canBuildGarage = TRUE;
  187.                         };
  188.                         IF(_houselevel IN ["LGH","LGB"] && _hasLevel3 && !_hasLG) THEN {
  189.                             _canBuildGarage = TRUE;
  190.                         };
  191.                         IF(_houselevel IN ["KINGH","KINGB"] && _hasLevel3 && _hasLG && !_hasKING) THEN {
  192.                             _canBuildGarage = TRUE;
  193.                         };  
  194.                         IF(_houselevel IN ["SHH","SHB"] && _hasLevel1 && _hasLevel2 && _hasLevel3 && !_hasSH) THEN {
  195.                             _canBuildSH = TRUE;
  196.                         };
  197.                     };
  198.  
  199.                     IF(_canBuildHouse) THEN {
  200.                         IF(s_player_build_origins_house < 0) THEN {
  201.                             s_player_build_origins_house = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  202.                         };
  203.                     };
  204.                     IF(_canBuildGarage) THEN {
  205.                         IF(s_player_build_origins_garage < 0) THEN {
  206.                             s_player_build_origins_garage = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  207.                         };
  208.                     };
  209.                     IF(_canBuildSH) THEN {
  210.                         IF(s_player_build_origins_stronghold < 0) THEN {
  211.                             s_player_build_origins_stronghold = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  212.                         };
  213.                     };
  214.  
  215.                 } forEach DZE_Origins_Build_HousesGarages;
  216.             } ELSE {
  217.                 [1] CALL origins_removeActions;
  218.             };
  219.         };
  220.  
  221.         IF(_typeOfCursorTarget IN DZE_Origins_Buildings && (player distance _cursorTarget) < DZE_Origins_LockUnlock_Distance) THEN {
  222.             private["_ownerUID","_ownerName","_playerUID","_state","_openClose"];
  223.             _playerUID = dayz_playerUID;
  224.             _ownerUID = _cursorTarget getVariable ["OwnerUID","0"];
  225.             _ownerName = _cursorTarget getVariable ["OwnerName","0"];
  226.  
  227.             IF(_playerUID != _ownerUID && !(_typeOfCursorTarget IN DZE_Origins_Stronghold)) exitWith {
  228.                 cutText [format["This house was built by %1", _ownerName], "PLAIN DOWN",5];
  229.                 sleep 5;
  230.             };
  231.             _state = (_cursorTarget getVariable ["CanBeUpdated",FALSE]);
  232.             IF(_typeOfCursorTarget IN DZE_Origins_Stronghold && _state) THEN {
  233.                 private["_strongholdDoorsOpen"];
  234.                 _strongholdDoorsOpen = (_cursorTarget getVariable ["DoorsOpen",FALSE]);
  235.                 IF(_strongholdDoorsOpen) THEN {
  236.                     IF(s_player_origins_stronghold_doors < 0) THEN {
  237.                         s_player_origins_stronghold_doors = player addAction [ "Close Doors","origins\origins_strongholdDoors.sqf",[_cursorTarget,0]];
  238.                     };
  239.                 } ELSE {
  240.                     IF(s_player_origins_stronghold_doors < 0)THEN {
  241.                         s_player_origins_stronghold_doors = player addAction [ "Open Doors","origins\origins_strongholdDoors.sqf",[_cursorTarget,1]];
  242.                     };
  243.                 };
  244.             } ELSE {
  245.                 [3] CALL origins_removeActions;
  246.             };
  247.  
  248.             IF(s_player_origins_unlock < 0) THEN {
  249.                 _matched = FALSE;
  250.                 {
  251.                     IF(_typeOfCursorTarget == (_x SELECT 0)) THEN {
  252.                         IF(_state) THEN {
  253.                             _openClose = format["Lock %1", _X SELECT 1];
  254.                         } ELSE {
  255.                             _openClose = format["Unlock %1", _X SELECT 1];
  256.                         };
  257.                         _matched = TRUE;
  258.                     };
  259.                     IF (_matched) exitWith {
  260.                         s_player_origins_unlock = player addAction [_openClose, "origins\player_lockUnlock.sqf", [_cursorTarget,_typeOfCursorTarget,_state]];
  261.                     };
  262.                 } COUNT DZE_Origins_NameLookup;
  263.             };
  264.         } ELSE {
  265.             [2] CALL origins_removeActions;
  266.         };
  267.     } ELSE {
  268.         [0] CALL origins_removeActions;
  269.     };
  270. };
  271.  
  272. //allow demolition OF Origins Housing
  273.     IF (typeOf _vehicle =="ori_excavator") THEN
  274.     {
  275.         IF (bucketOut < 0) THEN {
  276.             bucketOut = _vehicle addAction ["Bucket Out","custom\build\bucketOut.sqf","",5,FALSE,TRUE];
  277.         };
  278.         IF(bucketIn < 0) THEN {
  279.             bucketIn = _vehicle addAction ["Bucket In","custom\build\bucketIn.sqf","",5,FALSE,TRUE];
  280.         };
  281.                
  282.                 _originHousing = DZE_Origins_Buildings;
  283.         _nearestBuildList = nearestObjects [_vehicle, _originHousing, 20];
  284.         _nearestBuilding = _nearestBuildList SELECT 0;
  285.             _buildOwner = _nearestBuilding getVariable['OwnerUID','0'];
  286.             IF(s_demolish == -1) THEN {
  287.                 IF (_buildOwner == (getplayerUID player)) THEN {    
  288.                     s_demolish = _vehicle addaction [("<t color=""#ff0000"">" + format["Demolish %1",typeOf(_nearestBuilding)] +"</t>"),"custom\build\demolish.sqf",_nearestBuilding,6,FALSE,TRUE,"",""];
  289.                     sleep 5;
  290.                 };
  291.             } ELSE {
  292.                 _vehicle removeAction s_demolish;
  293.                 s_demolish = -1;
  294.             };    
  295.     } ELSE {
  296.         _vehicle removeAction bucketIn;
  297.         bucketIn = -1;
  298.         _vehicle removeAction bucketOut;
  299.         bucketOut = -1;
  300.         _vehicle removeAction s_demolish;
  301.         s_demolish = -1;
  302.     };
  303.  
  304. IF(_isPZombie) THEN {
  305.     IF (s_player_callzombies < 0) THEN {
  306.         s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, TRUE, FALSE, "",""];
  307.     };
  308.     IF (DZE_PZATTACK) THEN {
  309.         CALL pz_attack;
  310.         DZE_PZATTACK = FALSE;
  311.     };
  312.     IF (s_player_pzombiesvision < 0) THEN {
  313.         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"];
  314.     };
  315.     IF (!isNull cursorTarget && (player distance cursorTarget < 3)) THEN {  //Has SOME kind OF target
  316.         _isAnimal = cursorTarget isKindOf "Animal";
  317.         _isZombie = cursorTarget isKindOf "zZombie_base";
  318.         _isHarvested = cursorTarget getVariable["meatHarvested",FALSE];
  319.         _isMan = cursorTarget isKindOf "Man";
  320.         // Pzombie Gut human corpse || animal
  321.         IF (!alive cursorTarget && (_isAnimal || _isMan) && !_isZombie && !_isHarvested) THEN {
  322.             IF (s_player_pzombiesfeed < 0) THEN {
  323.                 s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, TRUE, FALSE, "",""];
  324.             };
  325.         } ELSE {
  326.             player removeAction s_player_pzombiesfeed;
  327.             s_player_pzombiesfeed = -1;
  328.         };
  329.     } ELSE {
  330.         player removeAction s_player_pzombiesfeed;
  331.         s_player_pzombiesfeed = -1;
  332.     };
  333. };
  334.  
  335. // Increase distance ONLY IF AIR || SHIP
  336. _allowedDistance = 4;
  337. _isAir = cursorTarget isKindOf "Air";
  338. _isShip = cursorTarget isKindOf "Ship";
  339. IF(_isAir || _isShip) THEN {
  340.     _allowedDistance = 8;
  341. };
  342.  
  343. IF (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) THEN {   //Has SOME kind OF target
  344.  
  345.     // SET cursortarget TO variable
  346.     _cursorTarget = cursorTarget;
  347.  
  348.     // GET typeof cursortarget once
  349.     _typeOfCursorTarget = typeOf _cursorTarget;
  350.  
  351.     // hintsilent _typeOfCursorTarget;
  352.  
  353.     _isVehicle = _cursorTarget isKindOf "AllVehicles";
  354.     _isVehicletype = _typeOfCursorTarget IN ["ATV_US_EP1","ATV_CZ_EP1"];
  355.     _isnewstorage = _typeOfCursorTarget IN DZE_isNewStorage;
  356.    
  357.     // GET items && magazines ONLY once
  358.     _magazinesPlayer = magazines player;
  359.  
  360.     //boiled Water
  361.     _hasbottleitem = "ItemWaterbottle" IN _magazinesPlayer;
  362.     _hastinitem = FALSE;
  363.     {
  364.         IF (_x IN _magazinesPlayer) THEN {
  365.             _hastinitem = TRUE;
  366.         };
  367.     } COUNT boil_tin_cans;
  368.     _hasFuelE =     "ItemJerrycanEmpty" IN _magazinesPlayer;
  369.     _hasFuelBarrelE =   "ItemFuelBarrelEmpty" IN _magazinesPlayer;
  370.     _hasHotwireKit =    "ItemHotwireKit" IN _magazinesPlayer;
  371.  
  372.     _itemsPlayer = items player;
  373.    
  374.     _temp_keys = [];
  375.     _temp_keys_names = [];
  376.     // find available KEYS
  377.     _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
  378.     {
  379.         IF (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) IN _key_colors) THEN {
  380.             _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
  381.             _ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
  382.             _temp_keys_names SET [_ownerKeyId,_ownerKeyName];
  383.             _temp_keys SET [COUNT _temp_keys,str(_ownerKeyId)];
  384.         };
  385.     } COUNT _itemsPlayer;
  386.  
  387.     _hasKnife =     "ItemKnife" IN _itemsPlayer;
  388.     _hasToolbox =   "ItemToolbox" IN _itemsPlayer;
  389.  
  390.     _isMan = _cursorTarget isKindOf "Man";
  391.     _traderType = _typeOfCursorTarget;
  392.     _ownerID = _cursorTarget getVariable ["CharacterID","0"];
  393.     _isAnimal = _cursorTarget isKindOf "Animal";
  394.     _isDog =  (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
  395.     _isZombie = _cursorTarget isKindOf "zZombie_base";
  396.     _isDestructable = _cursorTarget isKindOf "BuiltItems";
  397.     _isWreck = _typeOfCursorTarget IN DZE_isWreck;
  398.     _isWreckBuilding = _typeOfCursorTarget IN DZE_isWreckBuilding;
  399.     _isModular = _cursorTarget isKindOf "ModularItems";
  400.     _isModularDoor = _typeOfCursorTarget IN ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
  401.  
  402.     _isRemovable = _typeOfCursorTarget IN DZE_isRemovable;
  403.     _isDisallowRepair = _typeOfCursorTarget IN ["M240Nest_DZ"];
  404.  
  405.     _isTent = _cursorTarget isKindOf "TentStorage";
  406.    
  407.     _isAlive = alive _cursorTarget;
  408.    
  409.     _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  410.    
  411.     _rawmeat = meatraw;
  412.     _hasRawMeat = FALSE;
  413.     {
  414.         IF (_x IN _magazinesPlayer) THEN {
  415.             _hasRawMeat = TRUE;
  416.         };
  417.     } COUNT _rawmeat;
  418.    
  419.     _isFuel = FALSE;
  420.     IF (_hasFuelE || _hasFuelBarrelE) THEN {
  421.         {
  422.             IF(_cursorTarget isKindOf _x) exitWith {_isFuel = TRUE;};
  423.         } COUNT dayz_fuelsources;
  424.     };
  425.  
  426.     // diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID));
  427.    
  428.     // logic vars
  429.     _player_flipveh = FALSE;
  430.     _player_deleteBuild = FALSE;
  431.     _player_lockUnlock_crtl = FALSE;
  432.  
  433.      IF (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) THEN {
  434.      IF (s_player_plotManagement < 0) THEN {
  435.         _adminList = ["76561197966087279","76561198038360592"]; // ADD admins here IF you admins TO able TO manage ALL plotpoles
  436.         _owner = _cursorTarget getVariable ["CharacterID","0"];
  437.         _friends = _cursorTarget getVariable ["plotfriends", []];
  438.         _fuid = [];
  439.         {
  440.         _friendUID = _x SELECT 0;
  441.         _fuid = _fuid + [_friendUID];
  442.         } forEach _friends;
  443.         _allowed = [_owner];    
  444.         _allowed = [_owner] + _adminList + _fuid;
  445.         IF(_owner == dayz_characterID || (getPlayerUID player) IN _allowed)THEN{            
  446.         s_player_plotManagement = player addAction ["<t color='#0059FF'>Manage Plot</t>", "plotManagement\initPlotManagement.sqf", [], 5, FALSE];
  447.         };
  448.     };
  449.          IF (s_player_maintain_area < 0) THEN {
  450.             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];
  451.             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];
  452.          };
  453.      } ELSE {
  454.             player removeAction s_player_plotManagement;
  455.             s_player_plotManagement = -1;
  456.             player removeAction s_player_maintain_area;
  457.             s_player_maintain_area = -1;
  458.             player removeAction s_player_maintain_area_preview;
  459.             s_player_maintain_area_preview = -1;
  460.      };
  461.  
  462.     // CURSOR TARGET ALIVE
  463.     IF(_isAlive) THEN {
  464.        
  465.         //Allow player TO DELETE objects
  466.         IF(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) THEN {
  467.             IF(_hasToolbox && "ItemCrowbar" IN _itemsPlayer) THEN {
  468.                 _player_deleteBuild = TRUE;
  469.             };
  470.         };
  471.        
  472. ///Allow owners TO DELETE modulars
  473. IF(_isModular) THEN {
  474.         IF(_hasToolbox && "ItemCrowbar" IN _itemsPlayer) THEN {
  475.             _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole SELECT 0];
  476.             _IsNearPlot = COUNT (_findNearestPoles);
  477.             _fuid  = [];
  478.             _allowed = [];
  479.             IF(_IsNearPlot > 0)THEN{
  480.                 _thePlot = _findNearestPoles SELECT 0;
  481.                 _owner =  _thePlot getVariable ["CharacterID","010"];
  482.                 _friends = _thePlot getVariable ["plotfriends", []];
  483.                 {
  484.                   _friendUID = _x SELECT 0;
  485.                   _fuid  =  _fuid  + [_friendUID];
  486.                 } forEach _friends;
  487.                 _allowed = [_owner];    
  488.                 _allowed = [_owner] +  _fuid;  
  489.                 IF (_owner == dayz_characterID || (getPlayerUID player) IN _allowed) THEN {  // // IF u want that the object also belongs TO someone ON the plotpole.
  490.                     _player_deleteBuild = TRUE;
  491.                 };                  
  492.             }ELSE{
  493.                 IF(_owner == dayz_characterID)THEN{
  494.                     _player_deleteBuild = TRUE;
  495.                 };
  496.             };                                        
  497.         };
  498. };
  499. //Allow owners TO DELETE modular doors WITHOUT locks
  500. IF(_isModularDoor) THEN {
  501.         IF(_hasToolbox && "ItemCrowbar" IN _itemsPlayer) THEN {        
  502.             _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole SELECT 0];
  503.             _IsNearPlot = COUNT (_findNearestPoles);
  504.             _fuid  = [];
  505.             _allowed = [];
  506.             IF(_IsNearPlot > 0)THEN{
  507.                 _thePlot = _findNearestPoles SELECT 0;
  508.                 _owner =  _thePlot getVariable ["CharacterID","010"];
  509.                 _friends = _thePlot getVariable ["plotfriends", []];
  510.                 {
  511.                   _friendUID = _x SELECT 0;
  512.                   _fuid  =  _fuid  + [_friendUID];
  513.                 } forEach _friends;
  514.                 _allowed = [_owner];    
  515.                 _allowed = [_owner] +  _fuid;  
  516.                 IF (_owner == dayz_characterID || (getPlayerUID player) IN _allowed) THEN { //  // IF u want that the object also belongs TO someone ON the plotpole.
  517.                     _player_deleteBuild = TRUE;
  518.                 };                  
  519.             }ELSE{
  520.                 IF(_owner == dayz_characterID)THEN{
  521.                     _player_deleteBuild = TRUE;
  522.                 };
  523.             };                              
  524.         };      
  525. };
  526.         // CURSOR TARGET VEHICLE
  527.         IF(_isVehicle) THEN {
  528.            
  529.             //flip vehicle small vehicles BY your SELF && ALL other vehicles WITH help nearby
  530.             IF (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (COUNT (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) SELECT 2) < 0.5) THEN {
  531.                 _playersNear = {isPlayer _x} COUNT (player nearEntities ["CAManBase", 6]);
  532.                 IF(_isVehicletype || (_playersNear >= 2)) THEN {
  533.                     _player_flipveh = TRUE;
  534.                 };
  535.             };
  536.  
  537.  
  538.             IF(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) THEN {
  539.                 _player_lockUnlock_crtl = TRUE;
  540.             };
  541.  
  542.         };
  543.    
  544.     };
  545.  
  546.     IF(_player_deleteBuild) THEN {
  547.         IF (s_player_deleteBuild < 0) THEN {
  548.             s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
  549.         };
  550.     } ELSE {
  551.         player removeAction s_player_deleteBuild;
  552.         s_player_deleteBuild = -1;
  553.     };
  554.    
  555.     IF (DZE_HeliLift) THEN {
  556.         _liftHeli = objNull;
  557.         _found = FALSE;
  558.    
  559.         _allowTow = FALSE;
  560.         IF ((COUNT (crew _cursorTarget)) == 0) THEN {
  561.             {
  562.                 IF(!_allowTow) THEN {
  563.                     _allowTow = _cursorTarget isKindOf _x;
  564.                 };
  565.             } COUNT DZE_HeliAllowToTow;
  566.         };
  567.  
  568.         //diag_log format["CREW: %1 ALLOW: %2",(COUNT (crew _cursorTarget)),_allowTow];
  569.  
  570.         IF (_allowTow) THEN {
  571.             _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
  572.             {
  573.                 IF(!_found) THEN {
  574.                     _posL = [_x] CALL FNC_getPos;
  575.                     _posC = [_cursorTarget] CALL FNC_getPos;
  576.                     _height = (_posL SELECT 2) - (_posC SELECT 2);
  577.                     _hasAttached = _x getVariable["hasAttached",FALSE];
  578.                     IF(_height < 15 && _height > 5 && (typeName _hasAttached != "OBJECT")) THEN {
  579.                         IF(((abs((_posL SELECT 0) - (_posC SELECT 0))) < 10) && ((abs((_posL SELECT 1) - (_posC SELECT 1))) < 10)) THEN {
  580.                             _liftHeli = _x;
  581.                             _found = TRUE;
  582.                         };
  583.                     };
  584.                 };
  585.             } COUNT _liftHelis;
  586.         };
  587.  
  588.         //diag_log format["HELI: %1 TARGET: %2",_found,_cursorTarget];
  589.  
  590.         _attached = _cursorTarget getVariable["attached",FALSE];
  591.         IF(_found && _allowTow && _canDo && !locked _cursorTarget && !_isPZombie && (typeName _attached != "OBJECT")) THEN {
  592.             IF (s_player_heli_lift < 0) THEN {
  593.                 s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, FALSE, TRUE, "",""];
  594.             };
  595.         } ELSE {
  596.             player removeAction s_player_heli_lift;
  597.             s_player_heli_lift = -1;
  598.         };
  599.     };
  600.    
  601.     // Allow Owner TO LOCK && UNLOCK vehicle  
  602.     IF(_player_lockUnlock_crtl) THEN {
  603.         IF (s_player_lockUnlock_crtl < 0) THEN {
  604.             _hasKey = _ownerID IN _temp_keys;
  605.             _oldOwner = (_ownerID == dayz_playerUID);
  606.             IF(locked _cursorTarget) THEN {
  607.                 IF(_hasKey || _oldOwner) THEN {
  608.                     _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, "", ""];
  609.                     s_player_lockunlock SET [COUNT s_player_lockunlock,_Unlock];
  610.                     s_player_lockUnlock_crtl = 1;
  611.                 } ELSE {
  612.                     IF(_hasHotwireKit) THEN {
  613.                         _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, TRUE, TRUE, "", ""];
  614.                     } ELSE {
  615.                         _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, TRUE, TRUE, "", ""];
  616.                     };
  617.                     s_player_lockunlock SET [COUNT s_player_lockunlock,_Unlock];
  618.                     s_player_lockUnlock_crtl = 1;
  619.                 };
  620.             } ELSE {
  621.                 IF(_hasKey || _oldOwner) THEN {
  622.                     _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
  623.                     s_player_lockunlock SET [COUNT s_player_lockunlock,_lock];
  624.                     s_player_lockUnlock_crtl = 1;
  625.                 };
  626.             };
  627.         };
  628.          
  629.     } ELSE {
  630.         {player removeAction _x} COUNT s_player_lockunlock;s_player_lockunlock = [];
  631.         s_player_lockUnlock_crtl = -1;
  632.     };
  633.  
  634.     IF(DZE_AllowForceSave) THEN {
  635.         //Allow player TO force save
  636.         IF((_isVehicle || _isTent) && !_isMan) THEN {
  637.             IF (s_player_forceSave < 0) THEN {
  638.                 s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
  639.             };
  640.         } ELSE {
  641.             player removeAction s_player_forceSave;
  642.             s_player_forceSave = -1;
  643.         };
  644.     };
  645.  
  646.    
  647.    
  648.     IF(DZE_AllowCargoCheck) THEN {
  649.             IF((_isVehicle || _isTent || _isnewstorage || _typeOfCursorTarget IN DZE_Origins_Buildings) && _isAlive && !_isMan && !locked _cursorTarget) THEN {         IF (s_player_checkGear < 0) THEN {
  650.                 s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
  651.             };
  652.         } ELSE {
  653.             player removeAction s_player_checkGear;
  654.             s_player_checkGear = -1;
  655.         };
  656.     };
  657.    
  658.    
  659.     //flip vehicle small vehicles BY your SELF && ALL other vehicles WITH help nearby
  660.     IF(_player_flipveh) THEN {
  661.         IF (s_player_flipveh  < 0) THEN {
  662.             s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];     
  663.         };
  664.     } ELSE {
  665.         player removeAction s_player_flipveh;
  666.         s_player_flipveh = -1;
  667.     };
  668.    
  669.     //Allow player TO fill jerrycan
  670.     IF((_hasFuelE || _hasFuelBarrelE) && _isFuel) THEN {
  671.         IF (s_player_fillfuel < 0) THEN {
  672.             s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, FALSE, TRUE, "", ""];
  673.         };
  674.     } ELSE {
  675.         player removeAction s_player_fillfuel;
  676.         s_player_fillfuel = -1;
  677.     };
  678.    
  679.     // logic vars FOR addactions
  680.     _player_butcher = FALSE;
  681.     _player_studybody = FALSE;
  682.     _player_SurrenderedGear = FALSE;
  683.    
  684.     IF ( cursorTarget isKindOf "GraveDZE") THEN {
  685.     _player_studybody = TRUE;
  686.     };
  687.  
  688.     // CURSOR TARGET NOT ALIVE
  689.     IF (!_isAlive) THEN {
  690.  
  691.         // Gut animal/zed
  692.         IF((_isAnimal || _isZombie) && _hasKnife) THEN {
  693.             _isHarvested = _cursorTarget getVariable["meatHarvested",FALSE];
  694.             IF (!_isHarvested) THEN {
  695.                 _player_butcher = TRUE;
  696.             };
  697.         };
  698.  
  699.         // Study body
  700.         IF (_isMan && !_isZombie && !_isAnimal) THEN {
  701.             _player_studybody = TRUE;
  702.         }
  703.     } ELSE {
  704.         // unit alive
  705.  
  706.         // gear access ON surrendered player
  707.         IF(_isMan && !_isZombie && !_isAnimal) THEN {
  708.             _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",FALSE];
  709.             IF (_isSurrendered) THEN {
  710.                 _player_SurrenderedGear = TRUE;
  711.             };
  712.         };
  713.     };
  714.  
  715.  
  716.     // Human Gut animal || zombie
  717.     IF (_player_butcher) THEN {
  718.         IF (s_player_butcher < 0) THEN {
  719.             IF(_isZombie) THEN {
  720.                 s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, TRUE, TRUE, "", ""];
  721.             } ELSE {
  722.                 s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
  723.             };
  724.         };
  725.     } ELSE {
  726.         player removeAction s_player_butcher;
  727.         s_player_butcher = -1;
  728.     };
  729.  
  730.     // Study Body
  731.     IF (_player_studybody) THEN {
  732.     IF (s_player_studybody < 0) THEN {
  733.         s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "ZSC\actions\check_wallet.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  734.     };
  735.     } ELSE {
  736.     player removeAction s_player_studybody;
  737.     s_player_studybody = -1;
  738.     };
  739.  
  740.     // logic vars
  741.     _player_cook = FALSE;
  742.     _player_boil = FALSE;
  743.  
  744.     // CURSOR TARGET IS FIRE
  745.     IF (inflamed _cursorTarget) THEN {
  746.        
  747.         //Fireplace Actions CHECK
  748.         IF (_hasRawMeat) THEN {
  749.             _player_cook = TRUE;   
  750.         };
  751.        
  752.         // Boil water
  753.         IF (_hasbottleitem && _hastinitem) THEN {
  754.             _player_boil = TRUE;
  755.         };
  756.     };
  757.  
  758.     IF (_player_SurrenderedGear) THEN {
  759.         IF (s_player_SurrenderedGear < 0) THEN {
  760.             s_player_SurrenderedGear = player addAction [localize "STR_EPOCH_ACTIONS_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
  761.         };
  762.     } ELSE {
  763.         player removeAction s_player_SurrenderedGear;
  764.         s_player_SurrenderedGear = -1;
  765.     };
  766.  
  767.     //Fireplace Actions CHECK
  768.     IF (_player_cook) THEN {
  769.         IF (s_player_cook < 0) THEN {
  770.             s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
  771.         };
  772.     } ELSE {
  773.         player removeAction s_player_cook;
  774.         s_player_cook = -1;
  775.     };
  776.    
  777.     // Boil water
  778.     IF (_player_boil) THEN {
  779.         IF (s_player_boil < 0) THEN {
  780.             s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
  781.         };
  782.     } ELSE {
  783.         player removeAction s_player_boil;
  784.         s_player_boil = -1;
  785.     };
  786.    
  787.     IF(_cursorTarget == dayz_hasFire) THEN {
  788.         IF ((s_player_fireout < 0) && !(inflamed _cursorTarget) && (player distance _cursorTarget < 3)) THEN {
  789.             s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  790.         };
  791.     } ELSE {
  792.         player removeAction s_player_fireout;
  793.         s_player_fireout = -1;
  794.     };
  795.    
  796.     //Packing my tent
  797.     IF(_isTent && (player distance _cursorTarget < 3)) THEN {
  798.         IF (_ownerID == dayz_characterID) THEN {
  799.             IF (s_player_packtent < 0) THEN {
  800.                 s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  801.             };
  802.         } ELSE {
  803.             IF(("ItemJerrycan" IN _magazinesPlayer) && ("ItemMatchbox_DZE" IN weapons player)) THEN {
  804.                 IF (s_player_packtent < 0) THEN {
  805.                     s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
  806.                 };
  807.             };
  808.         };
  809.     } ELSE {
  810.         player removeAction s_player_packtent;
  811.         s_player_packtent = -1;
  812.     };
  813.  
  814.     //Allow owner TO UNLOCK vault
  815.     IF((_typeOfCursorTarget IN DZE_LockableStorage) && _ownerID != "0" && (player distance _cursorTarget < 3)) THEN {
  816.         IF (s_player_unlockvault < 0) THEN {
  817.             IF(_typeOfCursorTarget IN DZE_LockedStorage) THEN {
  818.                 IF(_ownerID == dayz_combination || _ownerID == dayz_playerUID) THEN {
  819.                     _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  820.                     s_player_combi SET [COUNT s_player_combi,_combi];
  821.                 } ELSE {
  822.                     _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  823.                     s_player_combi SET [COUNT s_player_combi,_combi];
  824.                 };
  825.                 s_player_unlockvault = 1;
  826.             } ELSE {
  827.                 IF(_ownerID != dayz_combination && _ownerID != dayz_playerUID) THEN {
  828.                     _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  829.                     s_player_combi SET [COUNT s_player_combi,_combi];
  830.                     s_player_unlockvault = 1;
  831.                 };
  832.             };
  833.         };
  834.     } ELSE {
  835.         {player removeAction _x} COUNT s_player_combi;s_player_combi = [];
  836.         s_player_unlockvault = -1;
  837.     };
  838.    
  839.         IF(_typeOfCursorTarget IN ZSC_MoneyStorage && (player distance _cursorTarget < 5)) THEN {
  840.         IF (s_bank_dialog < 0) THEN {
  841.                 s_bank_dialog = player addAction ["Money Storage", "ZSC\actions\bank_dialog.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
  842.         };
  843.     } ELSE {
  844.         player removeAction s_bank_dialog;
  845.         s_bank_dialog = -1;
  846.     };
  847.  
  848.     // cars
  849.     IF( _isVehicle && !_isMan &&_isAlive && !_isMan && !locked _cursorTarget && !(_cursorTarget isKindOf "Bicycle") && (player distance _cursorTarget < 5)) THEN {     
  850.         IF (s_bank_dialog2 < 0) THEN {
  851.             s_bank_dialog2 = player addAction ["Money Storage", "ZSC\actions\bank_dialog.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
  852.         };         
  853.     } ELSE {       
  854.         player removeAction s_bank_dialog2;
  855.         s_bank_dialog2 = -1;
  856.     };
  857.  
  858.     //Allow owner TO pack vault
  859.     IF(_typeOfCursorTarget IN DZE_UnLockedStorage && _ownerID != "0" && (player distance _cursorTarget < 3)) THEN {
  860.  
  861.         IF (s_player_lockvault < 0) THEN {
  862.             IF(_ownerID == dayz_combination || _ownerID == dayz_playerUID) THEN {
  863.                 s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  864.             };
  865.         };
  866.         IF (s_player_packvault < 0 && (_ownerID == dayz_combination || _ownerID == dayz_playerUID)) THEN {
  867.             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, "",""];
  868.         };
  869.     } ELSE {
  870.         player removeAction s_player_packvault;
  871.         s_player_packvault = -1;
  872.         player removeAction s_player_lockvault;
  873.         s_player_lockvault = -1;
  874.     };
  875.  
  876.    
  877.  
  878.     //Player Deaths
  879.     IF(_typeOfCursorTarget == "Info_Board_EP1") THEN {
  880.         IF (s_player_information < 0) THEN {
  881.             s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, FALSE, TRUE, "",""];
  882.         };
  883.     } ELSE {
  884.         player removeAction s_player_information;
  885.         s_player_information = -1;
  886.     };
  887.    
  888.     IF (_isMan AND _isAlive AND !_isZombie AND !_isAnimal AND !(_traderType IN serverTraders)) THEN {
  889.     IF (s_givemoney_dialog < 0) THEN {
  890.         s_givemoney_dialog = player addAction [format["Give Money to %1", (name _cursorTarget)], "ZSC\actions\give_player_dialog.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
  891.     };
  892.     } ELSE {
  893.     player removeAction s_givemoney_dialog;
  894.     s_givemoney_dialog = -1;
  895.     };
  896.    
  897.     //Fuel Pump
  898.     IF(_typeOfCursorTarget IN dayz_fuelpumparray) THEN {   
  899.         IF (s_player_fuelauto < 0) THEN {
  900.            
  901.             // CHECK IF Generator_DZ IS running WITHIN 30 meters
  902.             _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
  903.             _findNearestGen = [];
  904.             {
  905.                 IF (alive _x && (_x getVariable ["GeneratorRunning", FALSE])) THEN {
  906.                     _findNearestGen SET [(COUNT _findNearestGen),_x];
  907.                 };
  908.             } COUNT _findNearestGens;
  909.             _IsNearRunningGen = COUNT (_findNearestGen);
  910.            
  911.             // SHOW that pump needs POWER IF no generator nearby.
  912.             IF(_IsNearRunningGen > 0) THEN {
  913.                 s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, FALSE, TRUE, "",""];
  914.             } ELSE {
  915.                 s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, FALSE, TRUE, "",""];
  916.             };
  917.         };
  918.     } ELSE {
  919.         player removeAction s_player_fuelauto;
  920.         s_player_fuelauto = -1;
  921.     };
  922.  
  923.     //Fuel Pump ON truck
  924.     IF(_typeOfCursorTarget IN DZE_fueltruckarray && alive _cursorTarget) THEN {
  925.         IF (s_player_fuelauto2 < 0) THEN {
  926.             // SHOW that fuel truck pump needs POWER.
  927.             IF(isEngineOn _cursorTarget) THEN {
  928.                 s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  929.             } ELSE {
  930.                 s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, FALSE, TRUE, "",""];
  931.             };
  932.         };
  933.     } ELSE {
  934.         player removeAction s_player_fuelauto2;
  935.         s_player_fuelauto2 = -1;
  936.     };
  937.  
  938.     // inplace upgrade tool
  939.     IF ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) THEN {
  940.         IF ((s_player_lastTarget SELECT 0) != _cursorTarget) THEN {
  941.             IF (s_player_upgrade_build > 0) THEN {
  942.                 player removeAction s_player_upgrade_build;
  943.                 s_player_upgrade_build = -1;
  944.             };
  945.         };
  946.         IF (s_player_upgrade_build < 0) THEN {
  947.             // s_player_lastTarget = _cursorTarget;
  948.             s_player_lastTarget SET [0,_cursorTarget];
  949.             s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "custom\BuildVectors\action\player_upgrade.sqf",_cursorTarget, -1, FALSE, TRUE, "",""];
  950.         };
  951.     } ELSE {
  952.         player removeAction s_player_upgrade_build;
  953.         s_player_upgrade_build = -1;
  954.     };
  955.    
  956.     // downgrade system
  957.     IF((_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") && (DZE_Lock_Door == _ownerID)) THEN {
  958.         IF ((s_player_lastTarget SELECT 1) != _cursorTarget) THEN {
  959.             IF (s_player_downgrade_build > 0) THEN {   
  960.                 player removeAction s_player_downgrade_build;
  961.                 s_player_downgrade_build = -1;
  962.             };
  963.         };
  964.  
  965.         IF (s_player_downgrade_build < 0) THEN {
  966.             s_player_lastTarget SET [1,_cursorTarget];
  967.             s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "custom\BuildVectors\action\player_buildingDowngrade.sqf",_cursorTarget, -2, FALSE, TRUE, "",""];
  968.         };
  969.     } ELSE {
  970.         player removeAction s_player_downgrade_build;
  971.         s_player_downgrade_build = -1;
  972.     };
  973.  
  974.     // inplace maintenance tool
  975.     IF((_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ") && (damage _cursorTarget >= DZE_DamageBeforeMaint)) THEN {
  976.         IF ((s_player_lastTarget SELECT 2) != _cursorTarget) THEN {
  977.             IF (s_player_maint_build > 0) THEN {   
  978.                 player removeAction s_player_maint_build;
  979.                 s_player_maint_build = -1;
  980.             };
  981.         };
  982.  
  983.         IF (s_player_maint_build < 0) THEN {
  984.             s_player_lastTarget SET [2,_cursorTarget];
  985.             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, "",""];
  986.         };
  987.     } ELSE {
  988.         player removeAction s_player_maint_build;
  989.         s_player_maint_build = -1;
  990.     };
  991.  
  992.  
  993.     //START Generator
  994.     IF(_cursorTarget isKindOf "Generator_DZ") THEN {
  995.         IF (s_player_fillgen < 0) THEN {
  996.            
  997.             // CHECK IF NOT running
  998.             IF((_cursorTarget getVariable ["GeneratorRunning", FALSE])) THEN {
  999.                 s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];               
  1000.             } ELSE {
  1001.             // CHECK IF NOT filled && player has jerry.
  1002.                 IF((_cursorTarget getVariable ["GeneratorFilled", FALSE])) THEN {
  1003.                     s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  1004.                 } ELSE {
  1005.                     IF("ItemJerrycan" IN _magazinesPlayer) THEN {
  1006.                         s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  1007.                     };
  1008.                 };
  1009.             };
  1010.         };
  1011.     } ELSE {
  1012.         player removeAction s_player_fillgen;
  1013.         s_player_fillgen = -1;
  1014.     };
  1015.  
  1016.     //Towing WITH tow truck
  1017.     /*
  1018.     if(_typeOfCursorTarget == "TOW_DZE") then {
  1019.         if (s_player_towing < 0) then {
  1020.             if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
  1021.                 s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];              
  1022.             } else {
  1023.                 s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];             
  1024.             };
  1025.         };
  1026.     } else {
  1027.         player removeAction s_player_towing;
  1028.         s_player_towing = -1;
  1029.     };
  1030.     */
  1031.  
  1032.  
  1033.     //Sleep
  1034.     IF(_isTent && _ownerID == dayz_characterID) THEN {
  1035.         IF ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) THEN {
  1036.             s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
  1037.         };
  1038.     } ELSE {
  1039.         player removeAction s_player_sleep;
  1040.         s_player_sleep = -1;
  1041.     };
  1042.    
  1043.     //Repairing Vehicles
  1044.     IF ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) THEN {
  1045.         IF (s_player_repair_crtl < 0) THEN {
  1046.             dayz_myCursorTarget = _cursorTarget;
  1047.             _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, TRUE, FALSE, "",""];
  1048.             _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, TRUE, FALSE, "",""];
  1049.             s_player_repairActions SET [COUNT s_player_repairActions,_menu];
  1050.             s_player_repairActions SET [COUNT s_player_repairActions,_menu1];
  1051.             s_player_repair_crtl = 1;
  1052.         } ELSE {
  1053.             {dayz_myCursorTarget removeAction _x} COUNT s_player_repairActions;s_player_repairActions = [];
  1054.             s_player_repair_crtl = -1;
  1055.         };
  1056.     };
  1057.  
  1058.     // ALL Traders
  1059.     IF (_isMan && !_isPZombie && _traderType IN serverTraders) THEN {
  1060.        
  1061.         IF (s_player_parts_crtl < 0) THEN {
  1062.  
  1063.             // GET humanity
  1064.             _humanity = player getVariable ["humanity",0];
  1065.             _traderMenu = CALL compile format["menu_%1;",_traderType];
  1066.  
  1067.             // diag_log ("TRADER = " + str(_traderMenu));
  1068.            
  1069.             _low_high = "low";
  1070.             _humanity_logic = FALSE;
  1071.             IF((_traderMenu SELECT 2) == "friendly") THEN {
  1072.                 _humanity_logic = (_humanity < -5000);
  1073.             };
  1074.             IF((_traderMenu SELECT 2) == "hostile") THEN {
  1075.                 _low_high = "high";
  1076.                 _humanity_logic = (_humanity > -5000);
  1077.             };
  1078.             IF((_traderMenu SELECT 2) == "minorhero") THEN {
  1079.                 _humanity_logic = (_humanity < 5000);
  1080.             };
  1081.             IF((_traderMenu SELECT 2) == "hero") THEN {
  1082.                 _humanity_logic = (_humanity < 10000);
  1083.             };
  1084.             IF((_traderMenu SELECT 2) == "superhero") THEN {
  1085.                 _humanity_logic = (_humanity < 20000);
  1086.             };
  1087.             IF(_humanity_logic) THEN {
  1088.                 _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, TRUE, FALSE, "",""];
  1089.                 s_player_parts SET [COUNT s_player_parts,_cancel];
  1090.             } ELSE {
  1091.                
  1092.                 // Static Menu
  1093.                 {
  1094.                     //diag_log format["DEBUG TRADER: %1", _x];
  1095.                     _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, "",""];
  1096.                     s_player_parts SET [COUNT s_player_parts,_buy];
  1097.                
  1098.                 } COUNT (_traderMenu SELECT 1);
  1099.                 _buyV = player addAction ["<t color='#0059FF'>Advanced Trading</t>", "zupa\advancedTrading\init.sqf",(_traderMenu SELECT 0), 999, TRUE, FALSE, "",""];
  1100.                 s_player_parts SET [COUNT s_player_parts,_buyV];
  1101.                 // DATABASE menu
  1102.                 _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu SELECT 0), 999, TRUE, FALSE, "",""];
  1103.                 s_player_parts SET [COUNT s_player_parts,_buy];
  1104.  
  1105.             };
  1106.             s_player_parts_crtl = 1;
  1107.            
  1108.         };
  1109.     } ELSE {
  1110.         {player removeAction _x} COUNT s_player_parts;s_player_parts = [];
  1111.         s_player_parts_crtl = -1;
  1112.     };
  1113.  
  1114.    
  1115.     IF(dayz_tameDogs) THEN {
  1116.        
  1117.         //Dog
  1118.         IF (_isDog && _isAlive && (_hasRawMeat) && _ownerID == "0" && player getVariable ["dogID", 0] == 0) THEN {
  1119.             IF (s_player_tamedog < 0) THEN {
  1120.                 s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, FALSE, TRUE, "", ""];
  1121.             };
  1122.         } ELSE {
  1123.             player removeAction s_player_tamedog;
  1124.             s_player_tamedog = -1;
  1125.         };
  1126.         IF (_isDog && _ownerID == dayz_characterID && _isAlive) THEN {
  1127.             _dogHandle = player getVariable ["dogID", 0];
  1128.             IF (s_player_feeddog < 0 && _hasRawMeat) THEN {
  1129.                 s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, FALSE, TRUE,"",""];
  1130.             };
  1131.             IF (s_player_waterdog < 0 && "ItemWaterbottle" IN _magazinesPlayer) THEN {
  1132.                 s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, FALSE, TRUE,"",""];
  1133.             };
  1134.             IF (s_player_staydog < 0) THEN {
  1135.                 _lieDown = _dogHandle getFSMVariable "_actionLieDown";
  1136.                 IF (_lieDown) THEN { _text = "str_actions_liedog"; } ELSE { _text = "str_actions_sitdog"; };
  1137.                 s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, FALSE, TRUE,"",""];
  1138.             };
  1139.             IF (s_player_trackdog < 0) THEN {
  1140.                 s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, FALSE, TRUE,"",""];
  1141.             };
  1142.             IF (s_player_barkdog < 0) THEN {
  1143.                 s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, FALSE, TRUE,"",""];
  1144.             };
  1145.             IF (s_player_warndog < 0) THEN {
  1146.                 _warn = _dogHandle getFSMVariable "_watchDog";
  1147.                 IF (_warn) THEN { _text = (localize "str_epoch_player_247"); _warn = FALSE; } ELSE { _text = (localize "str_epoch_player_248"); _warn = TRUE; };
  1148.                 s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, FALSE, TRUE,"",""];       
  1149.             };
  1150.             IF (s_player_followdog < 0) THEN {
  1151.                 s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,TRUE], 6, FALSE, TRUE,"",""];
  1152.             };
  1153.         } ELSE {
  1154.             player removeAction s_player_feeddog;
  1155.             s_player_feeddog = -1;
  1156.             player removeAction s_player_waterdog;
  1157.             s_player_waterdog = -1;
  1158.             player removeAction s_player_staydog;
  1159.             s_player_staydog = -1;
  1160.             player removeAction s_player_trackdog;
  1161.             s_player_trackdog = -1;
  1162.             player removeAction s_player_barkdog;
  1163.             s_player_barkdog = -1;
  1164.             player removeAction s_player_warndog;
  1165.             s_player_warndog = -1;
  1166.             player removeAction s_player_followdog;
  1167.             s_player_followdog = -1;
  1168.         };
  1169.     };
  1170.  
  1171. } ELSE {
  1172.     //Engineering
  1173.     player removeAction s_player_plotManagement;
  1174.     s_player_plotManagement = -1;
  1175.    
  1176.     {dayz_myCursorTarget removeAction _x} COUNT s_player_repairActions;s_player_repairActions = [];
  1177.     s_player_repair_crtl = -1;
  1178.  
  1179.     {player removeAction _x} COUNT s_player_combi;s_player_combi = [];
  1180.        
  1181.     dayz_myCursorTarget = objNull;
  1182.     s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  1183.  
  1184.     {player removeAction _x} COUNT s_player_parts;s_player_parts = [];
  1185.     s_player_parts_crtl = -1;
  1186.  
  1187.     {player removeAction _x} COUNT s_player_lockunlock;s_player_lockunlock = [];
  1188.     s_player_lockUnlock_crtl = -1;
  1189.  
  1190.     player removeAction s_player_checkGear;
  1191.     s_player_checkGear = -1;
  1192.  
  1193.     player removeAction s_player_SurrenderedGear;
  1194.     s_player_SurrenderedGear = -1;
  1195.  
  1196.     //Others
  1197.         player removeAction s_player_maintain_area;
  1198.         s_player_maintain_area = -1;
  1199.         player removeAction s_player_maintain_area_preview;
  1200.         s_player_maintain_area_preview = -1;
  1201.     player removeAction s_player_forceSave;
  1202.     s_player_forceSave = -1;
  1203.     player removeAction s_player_flipveh;
  1204.     s_player_flipveh = -1;
  1205.     player removeAction s_player_sleep;
  1206.     s_player_sleep = -1;
  1207.     player removeAction s_player_deleteBuild;
  1208.     s_player_deleteBuild = -1;
  1209.     player removeAction s_player_butcher;
  1210.     s_player_butcher = -1;
  1211.     player removeAction s_player_cook;
  1212.     s_player_cook = -1;
  1213.     player removeAction s_player_boil;
  1214.     s_player_boil = -1;
  1215.     player removeAction s_player_fireout;
  1216.     s_player_fireout = -1;
  1217.     player removeAction s_player_packtent;
  1218.     s_player_packtent = -1;
  1219.     player removeAction s_player_fillfuel;
  1220.     s_player_fillfuel = -1;
  1221.     player removeAction s_player_studybody;
  1222.     s_player_studybody = -1;
  1223.     //Dog
  1224.     player removeAction s_player_tamedog;
  1225.     s_player_tamedog = -1;
  1226.     player removeAction s_player_feeddog;
  1227.     s_player_feeddog = -1;
  1228.     player removeAction s_player_waterdog;
  1229.     s_player_waterdog = -1;
  1230.     player removeAction s_player_staydog;
  1231.     s_player_staydog = -1;
  1232.     player removeAction s_player_trackdog;
  1233.     s_player_trackdog = -1;
  1234.     player removeAction s_player_barkdog;
  1235.     s_player_barkdog = -1;
  1236.     player removeAction s_player_warndog;
  1237.     s_player_warndog = -1;
  1238.     player removeAction s_player_followdog;
  1239.     s_player_followdog = -1;
  1240.    
  1241.     // vault
  1242.     player removeAction s_player_unlockvault;
  1243.     s_player_unlockvault = -1;
  1244.     player removeAction s_player_packvault;
  1245.     s_player_packvault = -1;
  1246.     player removeAction s_player_lockvault;
  1247.     s_player_lockvault = -1;
  1248.  
  1249.     player removeAction s_player_information;
  1250.     s_player_information = -1;
  1251.     player removeAction s_player_fillgen;
  1252.     s_player_fillgen = -1;
  1253.     player removeAction s_player_upgrade_build;
  1254.     s_player_upgrade_build = -1;
  1255.     player removeAction s_player_maint_build;
  1256.     s_player_maint_build = -1;
  1257.     player removeAction s_player_downgrade_build;
  1258.     s_player_downgrade_build = -1;
  1259.     player removeAction s_player_towing;
  1260.     s_player_towing = -1;
  1261.     player removeAction s_player_fuelauto;
  1262.     s_player_fuelauto = -1;
  1263.     player removeAction s_player_fuelauto2;
  1264.     s_player_fuelauto2 = -1;
  1265.     player removeAction s_givemoney_dialog;
  1266.     s_givemoney_dialog = -1;
  1267.     player removeAction s_bank_dialog;
  1268.     s_bank_dialog = -1;
  1269.     player removeAction s_bank_dialog2;
  1270.     s_bank_dialog2 = -1;
  1271. };
  1272.  
  1273.  
  1274.  
  1275. //Dog actions ON player SELF
  1276. _dogHandle = player getVariable ["dogID", 0];
  1277. IF (_dogHandle > 0) THEN {
  1278.     _dog = _dogHandle getFSMVariable "_dog";
  1279.     _ownerID = "0";
  1280.     IF (!isNull cursorTarget) THEN { _ownerID = cursorTarget getVariable ["CharacterID","0"]; };
  1281.     IF (_canDo && !_inVehicle && alive _dog && _ownerID != dayz_characterID) THEN {
  1282.         IF (s_player_movedog < 0) THEN {
  1283.             s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, FALSE, TRUE, "", ""];
  1284.         };
  1285.         IF (s_player_speeddog < 0) THEN {
  1286.             _text = (localize "str_epoch_player_249");
  1287.             _speed = 0;
  1288.             IF (_dog getVariable ["currentSpeed",1] == 0) THEN { _speed = 1; _text = (localize "str_epoch_player_250"); };
  1289.             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, "", ""];
  1290.         };
  1291.         IF (s_player_calldog < 0) THEN {
  1292.             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, "", ""];
  1293.         };
  1294.     };
  1295. } ELSE {
  1296.     player removeAction s_player_movedog;      
  1297.     s_player_movedog =      -1;
  1298.     player removeAction s_player_speeddog;
  1299.     s_player_speeddog =     -1;
  1300.     player removeAction s_player_calldog;
  1301.     s_player_calldog =      -1;
  1302. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement