Advertisement
Guest User

self actions

a guest
Oct 20th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 62.70 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 ["_canPickLight","_text","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names","_restrict",
  8. "_hasKey","_oldOwner","_hasAttached","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild",
  9. "_player_lockUnlock_crtl","_displayName","_hasIgnitors","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached",
  10. "_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget",
  11. "_isVehicle","_isBicycle","_isDestructable","_isGenerator","_ownerID","_isVehicletype","_hasBarrel","_hasFuel20","_hasFuel5","_hasEmptyFuelCan",
  12. "_itemsPlayer","_hasToolbox","_hasbottleitem","_isAlive","_isPlant","_istypeTent","_upgradeItems","_isDisallowRefuel","_isDog",
  13. "_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
  14. "_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
  15. "_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
  16. "_allowed","_hasAccess","_uid","_hasKeyKit","_isLocked"];
  17.  
  18. _vehicle = vehicle player;
  19. _inVehicle = (_vehicle != player);
  20. _cursorTarget = cursorTarget;
  21. _primaryWeapon = primaryWeapon player;
  22. _currentWeapon = currentWeapon player;
  23. _magazinesPlayer = magazines player;
  24. _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  25. _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
  26. //_canDrink = count nearestObjects [getPosATL player, ["Land_pumpa","Land_water_tank"], 2] > 0;
  27. _uid = getPlayerUID player;
  28. _nearLight = nearestObject [player,"LitObject"];
  29. _canPickLight = false;
  30. _vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
  31. _hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
  32. _isPZombie = player isKindOf "PZombie_VB";
  33. _dogHandle = player getVariable ["dogID",0];
  34.  
  35. if (!isNull _nearLight) then {
  36. if (_nearLight distance player < 4) then {
  37. _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
  38. };
  39. };
  40.  
  41. //Grab Flare
  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. if (s_player_equip_carry < 0) then {
  56. if (dayz_onBack != "" && { !_inVehicle && { !_onLadder && { !r_player_unconscious } } }) then {
  57. dz_plr_carryActionItem = dayz_onBack;
  58. _text = getText (configFile >> "CfgWeapons" >> dz_plr_carryActionItem >> "displayName");
  59. s_player_equip_carry = player addAction [
  60. format [localize "STR_ACTIONS_WEAPON", _text],
  61. "\z\addons\dayz_code\actions\player_switchWeapon_action.sqf",
  62. nil, 0.5, false, true];
  63. };
  64. } else {
  65. if (dayz_onBack != dz_plr_carryActionItem || { _inVehicle || { _onLadder || { r_player_unconscious } } } ) then {
  66. player removeAction s_player_equip_carry;
  67. s_player_equip_carry = -1;
  68. };
  69. };
  70.  
  71. /*if (dayz_onBack != "" /*&& !dayz_onBackActive && !_inVehicle && !_onLadder && !r_player_unconscious) then {
  72. if (s_player_equip_carry < 0) then {
  73. _text = getText (configFile >> "CfgWeapons" >> dayz_onBack >> "displayName");
  74. s_player_equip_carry = player addAction [format[localize "STR_ACTIONS_WEAPON", _text], "\z\addons\dayz_code\actions\player_switchWeapon_action.sqf", nil, 0.5, false, true];
  75. };
  76. } else {
  77. player removeAction s_player_equip_carry;
  78. s_player_equip_carry = -1;
  79. };*/
  80.  
  81. //fishing
  82. if ((_currentWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {!_inVehicle} && {!dayz_isSwimming}) then {
  83. if (s_player_fishing < 0) then {
  84. s_player_fishing = player addAction [localize "STR_ACTION_CAST", "\z\addons\dayz_code\actions\player_goFishing.sqf",player, 0.5, false, true];
  85. };
  86. } else {
  87. player removeAction s_player_fishing;
  88. s_player_fishing = -1;
  89. };
  90. if ((_primaryWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {_inVehicle && (driver _vehicle != player)}) then {
  91. if (s_player_fishing_veh < 0) then {
  92. s_player_fishing_veh = _vehicle addAction [localize "STR_ACTION_CAST", "\z\addons\dayz_code\actions\player_goFishing.sqf",_vehicle, 0.5, false, true];
  93. };
  94. } else {
  95. _vehicle removeAction s_player_fishing_veh;
  96. s_player_fishing_veh = -1;
  97. };
  98.  
  99. /* //Allows drinking from hands at ponds and ambient wells, but may negatively impact performance
  100. if (_canDo && !_inVehicle && !dayz_isSwimming && ((call fn_nearWaterHole) select 0)) then {
  101. if (s_player_Drinkfromhands < 0) then {
  102. s_player_Drinkfromhands = player addAction [localize "STR_ACTIONS_DRINK2", "\z\addons\dayz_code\actions\water_fill.sqf","hands", 0.5, false, true];
  103. };
  104. } else {
  105. if (s_player_Drinkfromhands >= 0) then {
  106. player removeAction s_player_Drinkfromhands;
  107. s_player_Drinkfromhands = -1;
  108. };
  109. };
  110. */
  111.  
  112. if (_inVehicle) then {
  113. DZE_myVehicle = _vehicle;
  114. if (_vehicleOwnerID != "0" && _canDo) then {
  115. if (s_player_lockUnlockInside_ctrl < 0) then {
  116. _totalKeys = call epoch_tempKeys;
  117. _temp_keys = _totalKeys select 0;
  118. _temp_keys_names = _totalKeys select 1;
  119. _hasKey = _vehicleOwnerID in _temp_keys;
  120. _oldOwner = (_vehicleOwnerID == _uid);
  121.  
  122. _text = getText (configFile >> "CfgVehicles" >> (typeOf DZE_myVehicle) >> "displayName");
  123. if (locked DZE_myVehicle) then {
  124. if (_hasKey || _oldOwner) then {
  125. _unlock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[DZE_myVehicle,(_temp_keys_names select (_temp_keys find _vehicleOwnerID))], 2, false, true];
  126. s_player_lockUnlockInside set [count s_player_lockUnlockInside,_unlock];
  127. s_player_lockUnlockInside_ctrl = 1;
  128. } else {
  129. if (_hasHotwireKit) then {
  130. _unlock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",DZE_myVehicle, 2, true, true];
  131. } else {
  132. _unlock = DZE_myVehicle addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",DZE_myVehicle, 2, true, true];
  133. };
  134. s_player_lockUnlockInside set [count s_player_lockUnlockInside,_unlock];
  135. s_player_lockUnlockInside_ctrl = 1;
  136. };
  137. } else {
  138. if (_hasKey || _oldOwner) then {
  139. _lock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",DZE_myVehicle, 1, false, true];
  140. s_player_lockUnlockInside set [count s_player_lockUnlockInside,_lock];
  141. s_player_lockUnlockInside_ctrl = 1;
  142. };
  143. };
  144. };
  145. } else {
  146. {DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
  147. s_player_lockUnlockInside_ctrl = -1;
  148. };
  149. } else {
  150. {DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
  151. s_player_lockUnlockInside_ctrl = -1;
  152. };
  153.  
  154. if (DZE_HeliLift) then {
  155. _hasAttached = _vehicle getVariable["hasAttached",false];
  156. if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) < 30} && {speed _vehicle < 5} && {typeName _hasAttached == "OBJECT"}) then {
  157. if (s_player_heli_detach < 0) then {
  158. dayz_myLiftVehicle = _vehicle;
  159. s_player_heli_detach = dayz_myLiftVehicle addAction [localize "STR_EPOCH_ACTIONS_DETACHVEHICLE","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true];
  160. };
  161. } else {
  162. dayz_myLiftVehicle removeAction s_player_heli_detach;
  163. s_player_heli_detach = -1;
  164. };
  165. };
  166.  
  167. if (DZE_HaloJump) then {
  168. if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) > 400}) then {
  169. if (s_halo_action < 0) then {
  170. DZE_myHaloVehicle = _vehicle;
  171. s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true];
  172. };
  173. } else {
  174. DZE_myHaloVehicle removeAction s_halo_action;
  175. s_halo_action = -1;
  176. };
  177. };
  178.  
  179. if (DZE_NameTags > 0) then {
  180. if (s_player_showname < 0 && !_isPZombie) then {
  181. if (DZE_NameTags < 2) then {
  182. s_player_showname = 1;
  183. player setVariable["DZE_display_name",true,true];
  184. } else {
  185. s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false];
  186. s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false];
  187. };
  188. };
  189. };
  190.  
  191. if (_isPZombie) then {
  192. if (s_player_attack < 0) then {
  193. s_player_attack = player addAction [localize "STR_EPOCH_ACTIONS_ATTACK", "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf", _cursorTarget, 6, false, true];
  194. };
  195. if (s_player_callzombies < 0) then {
  196. s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\pzombie\call_zombies.sqf",player, 5, true, false];
  197. };
  198. if (s_player_pzombiesvision < 0) then {
  199. 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"];
  200. };
  201. if (!isNull _cursorTarget && (player distance _cursorTarget < 3)) then {
  202. _isZombie = _cursorTarget isKindOf "zZombie_base";
  203. _isHarvested = _cursorTarget getVariable["meatHarvested",false];
  204. _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies
  205. if (!alive _cursorTarget && _isMan && !_isZombie && !_isHarvested) then {
  206. if (s_player_pzombiesfeed < 0) then {
  207. s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",_cursorTarget, 3, true, false];
  208. };
  209. } else {
  210. player removeAction s_player_pzombiesfeed;
  211. s_player_pzombiesfeed = -1;
  212. };
  213. } else {
  214. player removeAction s_player_pzombiesfeed;
  215. s_player_pzombiesfeed = -1;
  216. };
  217. };
  218.  
  219. // Increase distance only if AIR or SHIP
  220. _allowedDistance = if ((_cursorTarget isKindOf "Air") or (_cursorTarget isKindOf "Ship")) then {8} else {4};
  221.  
  222. if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cursorTarget < _allowedDistance) && _canDo) then {
  223. //Has some kind of target
  224. _typeOfCursorTarget = typeOf _cursorTarget;
  225. _isVehicle = _cursorTarget isKindOf "AllVehicles";
  226. _isBicycle = _cursorTarget isKindOf "Bicycle";
  227. _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies
  228. _isDestructable = _cursorTarget isKindOf "BuiltItems";
  229. _isGenerator = _typeOfCursorTarget == "Generator_DZ";
  230. _isLocked = locked _cursorTarget;
  231. //_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"]; //Checked in player_flipvehicle
  232. _isFuel = false;
  233. _hasBarrel = "ItemFuelBarrel" in _magazinesPlayer;
  234. _hasFuel20 = "ItemJerrycan" in _magazinesPlayer;
  235. _hasFuel5 = "ItemFuelcan" in _magazinesPlayer;
  236. _hasEmptyFuelCan = (("ItemJerrycanEmpty" in _magazinesPlayer) || ("ItemFuelcanEmpty" in _magazinesPlayer) || ("ItemFuelBarrelEmpty" in _magazinesPlayer));
  237. _itemsPlayer = items player;
  238. _weaponsPlayer = weapons player;
  239. _hasCrowbar = "ItemCrowbar" in _itemsPlayer or "MeleeCrowbar" in _weaponsPlayer or dayz_onBack == "MeleeCrowbar";
  240. _hasToolbox = "ItemToolbox" in _itemsPlayer;
  241. _hasKeyKit = "ItemKeyKit" in weapons player;
  242. _hasbottleitem = (("ItemWaterBottle" in _magazinesPlayer) || {"ItemWaterBottleInfected" in _magazinesPlayer} || {"ItemWaterBottleSafe" in _magazinesPlayer} || {"ItemWaterBottleBoiled" in _magazinesPlayer});
  243. _isAlive = alive _cursorTarget;
  244. _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  245. _isPlant = _typeOfCursorTarget in Dayz_plants;
  246. _istypeTent = (_cursorTarget isKindOf "TentStorage_base") or (_cursorTarget isKindOf "IC_Tent");
  247. _upgradeItems = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3"];
  248. _characterID = _cursorTarget getVariable ["CharacterID","0"];
  249.  
  250. if (DZE_permanentPlot) then {
  251. _id = _uid;
  252. _ownerID = _cursorTarget getVariable ["ownerPUID","0"];
  253. } else {
  254. _id = dayz_characterID;
  255. _ownerID = _characterID;
  256. };
  257.  
  258. _isDisallowRefuel = _typeOfCursorTarget in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"];
  259. _isDog = (_cursorTarget isKindOf "Pastor" || _cursorTarget isKindOf "Fin");
  260. _isModular = _cursorTarget isKindOf "ModularItems";
  261. _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
  262. _player_deleteBuild = false;
  263. _player_lockUnlock_crtl = false;
  264.  
  265. //fuel tanks
  266. if (_hasEmptyFuelCan) then {
  267. {
  268. if (_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
  269. } count dayz_fuelsources;
  270. };
  271.  
  272. //remove gathered plant if empty
  273. if (_isPlant) then {
  274. _cursorTarget call player_gather;
  275. };
  276.  
  277. //flip vehicle
  278. if (_isVehicle && {!_isMan} && {!(canMove _cursorTarget)} && {_isAlive} && {player distance _cursorTarget >= 2} && {(count (crew _cursorTarget))== 0} && {((vectorUp _cursorTarget) select 2) < 0.5}) then {
  279. if (s_player_flipveh < 0) then {
  280. s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true];
  281. };
  282. } else {
  283. player removeAction s_player_flipveh;
  284. s_player_flipveh = -1;
  285. };
  286.  
  287. //Allow player to fill Fuel can
  288. if (_hasEmptyFuelCan && {_isFuel} && {!a_player_jerryfilling} && {_isAlive}) then {
  289. if (s_player_fillfuel < 0) then {
  290. s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",_cursorTarget, 1, false, true];
  291. };
  292. } else {
  293. player removeAction s_player_fillfuel;
  294. s_player_fillfuel = -1;
  295. };
  296.  
  297. if (damage _cursorTarget < 1) then {
  298. //Allow player to fill vehicle 210L
  299. if (_hasBarrel && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
  300. if (s_player_fillfuel210 < 0) then {
  301. s_player_fillfuel210 = player addAction [format[localize "str_actions_medical_10",_text,"210"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelBarrel",_cursorTarget], 0, true, true];
  302. };
  303. } else {
  304. player removeAction s_player_fillfuel210;
  305. s_player_fillfuel210 = -1;
  306. };
  307.  
  308. //Allow player to fill vehicle 20L
  309. if (_hasFuel20 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
  310. if (s_player_fillfuel20 < 0) then {
  311. s_player_fillfuel20 = player addAction [format[localize "str_actions_medical_10",_text,"20"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemJerrycan",_cursorTarget], 0, true, true];
  312. };
  313. } else {
  314. player removeAction s_player_fillfuel20;
  315. s_player_fillfuel20 = -1;
  316. };
  317.  
  318. //Allow player to fill vehicle 5L
  319. if (_hasFuel5 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
  320. if (s_player_fillfuel5 < 0) then {
  321. s_player_fillfuel5 = player addAction [format[localize "str_actions_medical_10",_text,"5"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelcan",_cursorTarget], 0, true, true];
  322. };
  323. } else {
  324. player removeAction s_player_fillfuel5;
  325. s_player_fillfuel5 = -1;
  326. };
  327. /*
  328. Vanilla generator is currently not functional.
  329. Vanilla generator refuel actions removed for now.
  330. Epoch generator fill action is below.
  331. */
  332. //Allow player to siphon vehicles
  333. if (_hasEmptyFuelCan && {!_isMan} && {_isVehicle} && {!_isBicycle} && {!a_player_jerryfilling} && {fuel _cursorTarget > 0}) then {
  334. if (s_player_siphonfuel < 0) then {
  335. s_player_siphonfuel = player addAction [format[localize "str_siphon_start"], "\z\addons\dayz_code\actions\siphonFuel.sqf",_cursorTarget, 0, true, true];
  336. };
  337. } else {
  338. player removeAction s_player_siphonfuel;
  339. s_player_siphonfuel = -1;
  340. };
  341. } else {
  342. player removeAction s_player_fillfuel210;
  343. s_player_fillfuel210 = -1;
  344. player removeAction s_player_fillfuel20;
  345. s_player_fillfuel20 = -1;
  346. player removeAction s_player_fillfuel5;
  347. s_player_fillfuel5 = -1;
  348. player removeAction s_player_siphonfuel;
  349. s_player_siphonfuel = -1;
  350. };
  351.  
  352. //Fireplace Actions check
  353. if ((_cursorTarget call isInflamed) or (inflamed _cursorTarget)) then {
  354. _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
  355. //_hastinitem = {_x in boil_tin_cans} count _magazinesPlayer > 0;
  356. _hasunboiledwater = {_x in ["ItemWaterBottleInfected","ItemWaterBottle","ItemWaterBottleSafe","ItemWaterbottle1oz","ItemWaterbottle2oz","ItemWaterbottle3oz","ItemWaterbottle4oz","ItemWaterbottle5oz","ItemWaterbottle6oz","ItemWaterbottle7oz","ItemWaterbottle8oz","ItemWaterbottle9oz"]} count _magazinesPlayer > 0;
  357.  
  358.  
  359. //Cook Meat
  360. if (_hasRawMeat && !a_player_cooking) then {
  361. if (s_player_cook < 0) then {
  362. s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true];
  363. };
  364. };
  365. //Boil Water
  366. if (_hasunboiledwater && !a_player_boil) then {
  367. if (s_player_boil < 0) then {
  368. s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true];
  369. };
  370. };
  371. } else {
  372. if (a_player_cooking) then {
  373. player removeAction s_player_cook;
  374. s_player_cook = -1;
  375. };
  376. if (a_player_boil) then {
  377. player removeAction s_player_boil;
  378. s_player_boil = -1;
  379. };
  380. };
  381.  
  382. // Not needed.
  383. /*
  384. if(_cursorTarget == dayz_hasFire) then {
  385. if ((s_player_fireout < 0) && !(_cursorTarget call isInflamed) && (player distance _cursorTarget < 3)) then {
  386. s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true];
  387. };
  388. } else {
  389. player removeAction s_player_fireout;
  390. s_player_fireout = -1;
  391. };
  392. */
  393. if (_isAlive) then {
  394. _restrict = _typeOfCursorTarget in DZE_restrictRemoval;
  395.  
  396. //Allow player to remove objects with no ownership or access required
  397. if (!_restrict && (_isDestructable || _typeOfCursorTarget in DZE_isWreck || _typeOfCursorTarget in DZE_isWreckBuilding || _typeOfCursorTarget in DZE_isRemovable)) then {
  398. if (_hasToolbox && _hasCrowbar) then {
  399. _player_deleteBuild = true;
  400. };
  401. };
  402. //Allow player to remove objects only if they have proper ownership or access
  403. if (_restrict || _isModular || _isModularDoor || _isGenerator || _typeOfCursorTarget in DZE_isDestroyableStorage) then {
  404. if (_hasToolbox && _hasCrowbar) then {
  405. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  406. if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
  407. _player_deleteBuild = true;
  408. };
  409. };
  410. };
  411. if (_isVehicle) then {
  412. if ((_characterID != "0") && {!_isMan}) then {
  413. _player_lockUnlock_crtl = true;
  414. };
  415. };
  416. };
  417.  
  418. if (_player_deleteBuild) then {
  419. if (s_player_deleteBuild < 0) then {
  420. s_player_deleteBuild = player addAction [format[localize "STR_EPOCH_REMOVE",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, false, true];
  421. };
  422. } else {
  423. player removeAction s_player_deleteBuild;
  424. s_player_deleteBuild = -1;
  425. };
  426.  
  427. //remove Own objects
  428. if (_ownerID == _id) then {
  429. //upgrade items
  430. if (_typeOfCursorTarget in _upgradeItems) then {
  431. if (s_player_upgradestorage < 0) then {
  432. _displayName = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  433. s_player_upgradestorage = player addAction [format[localize "STR_EPOCH_UPGRADE",_displayName], "\z\addons\dayz_code\actions\object_upgradeStorage.sqf",_cursorTarget, 0, false, true];
  434. };
  435. } else {
  436. player removeAction s_player_upgradestorage;
  437. s_player_upgradestorage = -1
  438. };
  439. if (_istypeTent) then {
  440. //Packing my tent
  441. if (s_player_packtent < 0) then {
  442. s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true];
  443. };
  444. } else {
  445. player removeAction s_player_packtent;
  446. s_player_packtent = -1;
  447. };
  448. } else {
  449. player removeAction s_player_upgradestorage;
  450. s_player_upgradestorage = -1;
  451. player removeAction s_player_packtent;
  452. s_player_packtent = -1;
  453. };
  454. //other tents
  455. if (_istypeTent) then {
  456. _hasIgnitors = {_x in DayZ_Ignitors} count _itemsPlayer > 0;
  457. if ((_hasFuel20 or _hasFuel5 or _hasBarrel) && _hasIgnitors) then {
  458. if (s_player_destroytent < 0) then {
  459. s_player_destroytent = player addAction [localize "str_actions_self_destroytent", "\z\addons\dayz_code\actions\player_destroyTent.sqf",_cursorTarget, 0, false, true];
  460. };
  461. } else {
  462. player removeAction s_player_destroytent;
  463. s_player_destroytent = -1;
  464. };
  465. if (_typeOfCursorTarget in ["IC_DomeTent","IC_Tent"]) then {
  466. if (s_player_packtentinfected < 0) then {
  467. s_player_packtentinfected = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true];
  468. };
  469. } else {
  470. player removeAction s_player_packtentinfected;
  471. s_player_packtentinfected = -1;
  472. };
  473. //sleep
  474. if (s_player_sleep < 0) then {
  475. s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true];
  476. };
  477. } else {
  478. player removeAction s_player_sleep;
  479. s_player_sleep = -1;
  480. };
  481.  
  482. //Study Body
  483. if (_cursorTarget getVariable["bodyName",""] != "") then {
  484. if (s_player_studybody < 0) then {
  485. s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true];
  486. };
  487. } else {
  488. player removeAction s_player_studybody;
  489. s_player_studybody = -1;
  490. };
  491. /*
  492. //Carbomb
  493. _hasCarBomb = "ItemCarBomb" in _magazinesPlayer;
  494. if (((_cursorTarget isKindOf "Car") || (_cursorTarget isKindOf "Air") || (_cursorTarget isKindOf "Motorcycle")) && _hasCarBomb) then {
  495. if (s_player_attach_bomb < 0) then {
  496. s_player_attach_bomb = player addAction [localize "str_bombAttach", "\z\addons\dayz_code\actions\player_attach_bomb.sqf",_cursorTarget, 3, true, true];
  497. };
  498. } else {
  499. player removeAction s_player_attach_bomb;
  500. s_player_attach_bomb = -1;
  501. };
  502. */
  503.  
  504. // Donn Heli Convoy
  505. _donn_cursorTarget = cursorTarget;
  506. _objVar = _donn_cursorTarget getVariable ["dnishpq",0];
  507.  
  508. if ((player distance _donn_cursorTarget < ((sizeOf typeOf _donn_cursorTarget)/2 + 4)) && (!isNil "_objVar") && _objVar > 0) then {
  509. if (s_collect_heli < 0) then {
  510. _heliTxt = "Search wreckage for loot";
  511. if (alive _donn_cursorTarget) then {_heliTxt = "Search helicopter for loot";};
  512. s_collect_heli = player addaction[("<t color=""#0096ff"">" + _heliTxt + "</t>"),"scripts\andrepatrol\andre_heliConvoy_items.sqf",_donn_cursorTarget,5,false,true,"",""];
  513. };
  514. } else {
  515. player removeAction s_collect_heli;
  516. s_collect_heli = -1;
  517. };
  518.  
  519. //Repairing Vehicles
  520. if (_isVehicle && {!_isMan} && {dayz_myCursorTarget != _cursorTarget} && {_hasToolbox} && {damage _cursorTarget < 1} && {_typeOfCursorTarget != "M240Nest_DZ"}) then {
  521. if (s_player_repair_crtl < 0) then {
  522. dayz_myCursorTarget = _cursorTarget;
  523. _menu = dayz_myCursorTarget addAction [localize "str_actions_repairveh", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false];
  524. if (!_isBicycle) then { //Bike wheels should not give full size tires. Also model does not update to show removed wheels.
  525. if (!DZE_salvageLocked) then {
  526. if (!locked _cursorTarget) then {
  527. _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false];
  528. s_player_repairActions set [count s_player_repairActions,_menu1];
  529. };
  530. } else {
  531. _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false];
  532. s_player_repairActions set [count s_player_repairActions,_menu1];
  533. };
  534. };
  535. s_player_repairActions set [count s_player_repairActions,_menu];
  536. s_player_repair_crtl = 1;
  537. } else {
  538. {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;
  539. s_player_repairActions = [];
  540. s_player_repair_crtl = -1;
  541. };
  542. };
  543. /* //Vanilla base building currently not used in Epoch
  544. // House locking and unlocking
  545. _isHouse = _typeOfCursorTarget in ["SurvivorWorkshopAStage5", "SurvivorWorkshopBStage5", "SurvivorWorkshopCStage5"];
  546. _isGate = _typeOfCursorTarget in ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","MetalGate_1","MetalGate_2","MetalGate_3","MetalGate_4"];
  547. _isFence = _typeOfCursorTarget in ["WoodenFence_1","WoodenFence_2","WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenFence_6","MetalFence_1","MetalFence_2","MetalFence_3","MetalFence_4","MetalFence_5","MetalFence_6","MetalFence_7"];
  548.  
  549. //Only the owners can lock the gates
  550. _isLockableGate = _typeOfCursorTarget in ["WoodenGate_2","WoodenGate_3","WoodenGate_4","MetalGate_2","MetalGate_3","MetalGate_4"];
  551. _isUnlocked = _cursorTarget getVariable ["isOpen","0"] == "1";
  552.  
  553. //Allow the gates to be opened when not locked by anyone
  554. _isOpen = ((_cursorTarget animationPhase "DoorL") == 1) || ((_cursorTarget animationPhase "DoorR") == 1);
  555. _isClosed = ((_cursorTarget animationPhase "DoorL") == 0) || ((_cursorTarget animationPhase "DoorR") == 0);
  556.  
  557. //[["ownerArray",["PID"]]]
  558. _ownerArray = _cursorTarget getVariable ["ownerArray",["0"]];
  559. _ownerBuildLock = _cursorTarget getVariable ["BuildLock",false];
  560. _ownerPID = (_ownerArray select 0);
  561.  
  562. // open Gate
  563. if (_isGate && _isClosed && _isUnlocked) then {
  564. if (s_player_openGate < 0) then {
  565. s_player_openGate = player addAction [localize "STR_DN_OUT_O_GATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Open"], 1, true, true];
  566. };
  567. } else {
  568. player removeAction s_player_openGate;
  569. s_player_openGate = -1;
  570. };
  571. // Close Gate
  572. if (_isGate && _isOpen && _isUnlocked) then {
  573. if (s_player_CloseGate < 0) then {
  574. s_player_CloseGate = player addAction [localize "STR_DN_OUT_C_GATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Close"], 1, true, true];
  575. };
  576. } else {
  577. player removeAction s_player_CloseGate;
  578. s_player_CloseGate = -1;
  579. };
  580. // Set
  581. if ((_isHouse or _isLockableGate) && (_ownerPID == _uid) && !_isUnlocked && _isClosed) then {
  582. if (s_player_setCode < 0) then {
  583. s_player_setCode = player addAction [localize "STR_BLD_ACTIONS_SETLOCKCODE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Set"], 1, true, true];
  584. };
  585. } else {
  586. player removeAction s_player_setCode;
  587. s_player_setCode = -1;
  588. };
  589. //Lock Build point
  590. if ((_isFence or _isGate) && (_ownerPID == _uid) && !_ownerBuildLock) then {
  591. if (s_player_BuildLock < 0) then {
  592. s_player_BuildLock = player addAction [localize "STR_BLD_ACTIONS_LOCKBUILD", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"BuildLock"], 1, true, true];
  593. };
  594. } else {
  595. player removeAction s_player_BuildLock;
  596. s_player_BuildLock = -1;
  597. };
  598. //UnLock Build point
  599. if ((_isFence or _isGate) && (_ownerPID == _uid) && _ownerBuildLock) then {
  600. if (s_player_BuildUnLock < 0) then {
  601. s_player_BuildUnLock = player addAction [localize "STR_BLD_ACTIONS_UNLOCKBUILD", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"BuildUnLock"], 1, true, true];
  602. };
  603. } else {
  604. player removeAction s_player_BuildUnLock;
  605. s_player_BuildUnLock = -1;
  606. };
  607. // Unlock Gate/House
  608. if ((_isHouse or _isLockableGate) && !_isUnlocked && _isClosed) then {
  609. if (s_player_unlockhouse < 0) then {
  610. s_player_unlockhouse = player addAction [localize "STR_BLD_ACTIONS_UNLOCKGATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Unlock"], 1, true, true];
  611. };
  612. } else {
  613. player removeAction s_player_unlockhouse;
  614. s_player_unlockhouse = -1;
  615. };
  616. // Lock Gate/House
  617. if ((_isHouse or _isLockableGate) && _isUnlocked && _isClosed) then {
  618. if (s_player_lockhouse < 0) then {
  619. s_player_lockhouse = player addAction [localize "STR_BLD_ACTIONS_LOCKGATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Lock"], 1, true, true];
  620. };
  621. } else {
  622. player removeAction s_player_lockhouse;
  623. s_player_lockhouse = -1;
  624. };
  625. //Break In
  626. if ((_isHouse or _isLockableGate) && (_ownerPID != _uid) && !_isUnlocked) then {
  627. if (s_player_breakinhouse < 0) then {
  628. s_player_breakinhouse = player addAction [localize "STR_BLD_ACTIONS_BREAKIN", "\z\addons\dayz_code\actions\player_breakin.sqf",_cursorTarget, 1, true, true];
  629. };
  630. } else {
  631. player removeAction s_player_breakinhouse;
  632. s_player_breakinhouse = -1;
  633. };*/
  634. _isObjectWithComputer = _typeOfCursorTarget in ["ZU23_Gue","Igla_AA_pod_East","","",""];//put any kind of object class name that you want have the option to launch the mortar
  635.  
  636. if ((_isObjectWithComputer) && {speed player <= 1}) then {
  637. if (s_player_def < 0) then {
  638. s_player_def = player addaction[("<t color=""#F7D708"">" + ("Computer") +"</t>"),"mortar.sqf"];
  639. };
  640. } else {
  641. player removeAction s_player_def;
  642. s_player_def = -1;
  643. };
  644. if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {speed player <= 1}) then {
  645. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  646. _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
  647. if (DZE_permanentPlot) then {
  648. if (s_player_plotManagement < 0 && _allowed) then {
  649. s_player_plotManagement = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false];
  650. };
  651. } else {
  652. if (s_player_maintain_area < 0) then {
  653. 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];
  654. s_player_maintain_area_force = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_FORCE_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "force", 5, false];
  655. 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];
  656. };
  657. };
  658. if (s_player_plot_boundary < 0 && (_allowed or (_hasAccess select 1))) then {
  659. s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false];
  660. };
  661. } else {
  662. player removeAction s_player_plotManagement;
  663. s_player_plotManagement = -1;
  664. player removeAction s_player_maintain_area;
  665. s_player_maintain_area = -1;
  666. player removeAction s_player_maintain_area_force;
  667. s_player_maintain_area_force = -1;
  668. player removeAction s_player_maintain_area_preview;
  669. s_player_maintain_area_preview = -1;
  670. player removeAction s_player_plot_boundary;
  671. s_player_plot_boundary = -1;
  672. };
  673.  
  674. if (DZE_HeliLift) then {
  675. _liftHeli = objNull;
  676. _found = false;
  677. _allowTow = false;
  678. if ((count (crew _cursorTarget)) == 0) then {
  679. {
  680. if (!_allowTow) then {
  681. _allowTow = _cursorTarget isKindOf _x;
  682. };
  683. } count DZE_HeliAllowToTow;
  684. };
  685.  
  686. if (_allowTow) then {
  687. {
  688. if (!_found) then {
  689. _posL = [_x] call FNC_getPos;
  690. _posC = [_cursorTarget] call FNC_getPos;
  691. _height = (_posL select 2) - (_posC select 2);
  692. _hasAttached = _x getVariable["hasAttached",false];
  693. if ((_height < 15) && {_height > 5} && {typeName _hasAttached != "OBJECT"}) then {
  694. if (((abs((_posL select 0) - (_posC select 0))) < 10) && {(abs((_posL select 1) - (_posC select 1))) < 10}) then {
  695. _liftHeli = _x;
  696. _found = true;
  697. };
  698. };
  699. };
  700. } count (player nearEntities [DZE_HeliAllowTowFrom,15]);
  701. };
  702.  
  703. _attached = _cursorTarget getVariable["attached",false];
  704. if (_found && {_allowTow} && {!locked _cursorTarget} && {!_isPZombie} && {typeName _attached != "OBJECT"}) then {
  705. if (s_player_heli_lift < 0) then {
  706. s_player_heli_lift = player addAction [localize "STR_EPOCH_ACTIONS_ATTACHTOHELI", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true];
  707. };
  708. } else {
  709. player removeAction s_player_heli_lift;
  710. s_player_heli_lift = -1;
  711. };
  712. };
  713.  
  714. // Allow Owner to lock and unlock vehicle
  715. if (_player_lockUnlock_crtl) then {
  716. _totalKeys = call epoch_tempKeys;
  717. _temp_keys = _totalKeys select 0;
  718. _temp_keys_names = _totalKeys select 1;
  719. _hasKey = _characterID in _temp_keys;
  720.  
  721. if (s_player_lockUnlock_crtl < 0) then {
  722. _oldOwner = (_characterID == _uid);
  723. if (_isLocked) then {
  724. if (_hasKey || {_oldOwner}) then {
  725. _temp_key_name = (_temp_keys_names select (_temp_keys find _characterID));
  726. _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,_temp_key_name], 2, true, true];
  727. s_player_lockunlock set [count s_player_lockunlock,_unlock];
  728. s_player_lockUnlock_crtl = 1;
  729. } else {
  730. if (_hasHotwireKit) then {
  731. _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true];
  732. } else {
  733. _unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, false, true];
  734. };
  735. s_player_lockunlock set [count s_player_lockunlock,_unlock];
  736. s_player_lockUnlock_crtl = 1;
  737. };
  738. } else {
  739. if (_hasKey || _oldOwner) then {
  740. _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true];
  741. s_player_lockunlock set [count s_player_lockunlock,_lock];
  742. s_player_lockUnlock_crtl = 1;
  743. };
  744. };
  745. };
  746. if (s_player_copyToKey < 0) then {
  747. if (_hasKey && {_hasKeyKit} && {(count _temp_keys) > 1} && {!_isLocked}) then {
  748. s_player_copyToKey = player addAction ["<t color=""#0096FF"">Change vehicle key</t>","scripts\vkc\vehicleKeyChanger.sqf",[_cursorTarget,_characterID,"change"],5,false,true];
  749. };
  750. };
  751. } else {
  752. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  753. s_player_lockUnlock_crtl = -1;
  754. player removeAction s_player_copyToKey;
  755. s_player_copyToKey = -1;
  756. };
  757.  
  758. // gear access on surrendered player
  759. if (isPlayer _cursorTarget && {_isAlive} && {_cursorTarget getVariable ["DZE_Surrendered",false]}) then {
  760. if (s_player_SurrenderedGear < 0) then {
  761. s_player_SurrenderedGear = player addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true];
  762. };
  763. } else {
  764. player removeAction s_player_SurrenderedGear;
  765. s_player_SurrenderedGear = -1;
  766. };
  767.  
  768. // Allow manage door
  769. if (DZE_doorManagement && (_typeOfCursorTarget in DZE_DoorsLocked)) then {
  770. // Check player access
  771. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  772. if (s_player_manageDoor < 0 && ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4) or (_hasAccess select 5) or (_hasAccess select 6))) then {
  773. s_player_manageDoor = player addAction [format["<t color='#0059FF'>%1</t>", localize "STR_EPOCH_ACTIONS_MANAGEDOOR"], "\z\addons\dayz_code\actions\doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false];
  774. };
  775. } else {
  776. player removeAction s_player_manageDoor;
  777. s_player_manageDoor = -1;
  778. };
  779.  
  780. //Allow owner to unlock vault
  781. if ((_typeOfCursorTarget in DZE_LockableStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3} && {!keypadCancel}) then {
  782. if (s_player_unlockvault < 0) then {
  783. if (_typeOfCursorTarget in DZE_LockedStorage) then {
  784. if (_characterID == dayz_combination || _ownerID == _uid) then {
  785. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true];
  786. s_player_combi set [count s_player_combi,_combi];
  787. } else {
  788. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
  789. s_player_combi set [count s_player_combi,_combi];
  790. };
  791. s_player_unlockvault = 1;
  792. } else {
  793. if (_characterID != dayz_combination && _ownerID != _uid) then {
  794. _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
  795. s_player_combi set [count s_player_combi,_combi];
  796. s_player_unlockvault = 1;
  797. };
  798. };
  799. };
  800. } else {
  801. {player removeAction _x} count s_player_combi;s_player_combi = [];
  802. s_player_unlockvault = -1;
  803. };
  804.  
  805. //Allow owner to pack vault
  806. if ((_typeOfCursorTarget in DZE_UnLockedStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3} && {!keypadCancel}) then {
  807. if (s_player_lockvault < 0) then {
  808. if (_characterID == dayz_combination || _ownerID == _uid) then {
  809. s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true];
  810. };
  811. };
  812. if (s_player_packvault < 0 && (_characterID == dayz_combination || _ownerID == _uid)) then {
  813. 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];
  814. };
  815. } else {
  816. player removeAction s_player_packvault;
  817. s_player_packvault = -1;
  818. player removeAction s_player_lockvault;
  819. s_player_lockvault = -1;
  820. };
  821.  
  822. //Player Deaths
  823. if (_typeOfCursorTarget == "Info_Board_EP1") then {
  824. if (s_player_information < 0) then {
  825. s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true];
  826. };
  827. } else {
  828. player removeAction s_player_information;
  829. s_player_information = -1;
  830. };
  831.  
  832. //Fuel Pump
  833. if (_typeOfCursorTarget in dayz_fuelpumparray) then {
  834. if (s_player_fuelauto < 0) then {
  835. // check if Generator_DZ is running within 30 meters
  836. _findNearestGen = {((alive _x) && (_x getVariable ["GeneratorRunning",false]))} count (([player] call FNC_getPos) nearObjects ["Generator_DZ",30]);
  837.  
  838. // show that pump needs power if no generator nearby.
  839. if (_findNearestGen > 0) then {
  840. s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true];
  841. } else {
  842. s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
  843. };
  844. };
  845. } else {
  846. player removeAction s_player_fuelauto;
  847. s_player_fuelauto = -1;
  848. };
  849.  
  850. //Fuel Pump on truck
  851. if (_typeOfCursorTarget in DZE_fueltruckarray && _isAlive) then {
  852. if (s_player_fuelauto2 < 0) then {
  853. // show that fuel truck pump needs power.
  854. if (isEngineOn _cursorTarget) then {
  855. s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true];
  856. } else {
  857. s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
  858. };
  859. };
  860. } else {
  861. player removeAction s_player_fuelauto2;
  862. s_player_fuelauto2 = -1;
  863. };
  864.  
  865. // inplace upgrade tool
  866. if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
  867. if ((s_player_lastTarget select 0) != _cursorTarget) then {
  868. if (s_player_upgrade_build > 0) then {
  869. player removeAction s_player_upgrade_build;
  870. s_player_upgrade_build = -1;
  871. };
  872. };
  873. if (s_player_upgrade_build < 0) then {
  874. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  875. _upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding");
  876. if (((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) && (count _upgrade) > 0) then {
  877. s_player_lastTarget set [0,_cursorTarget];
  878. s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_UPGRADE",_text], "\z\addons\dayz_code\actions\player_upgrade.sqf",_cursorTarget, -1, false, true];
  879. };
  880. };
  881. } else {
  882. player removeAction s_player_upgrade_build;
  883. s_player_upgrade_build = -1;
  884. };
  885.  
  886. // downgrade system
  887. if ((DZE_Lock_Door == _characterID) && {!keypadCancel} && {_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base"}) then {
  888. if ((s_player_lastTarget select 1) != _cursorTarget) then {
  889. if (s_player_downgrade_build > 0) then {
  890. player removeAction s_player_downgrade_build;
  891. s_player_downgrade_build = -1;
  892. };
  893. };
  894. if (s_player_downgrade_build < 0) then {
  895. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  896. if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
  897. s_player_lastTarget set [1,_cursorTarget];
  898. s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "\z\addons\dayz_code\actions\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true];
  899. };
  900. };
  901. } else {
  902. player removeAction s_player_downgrade_build;
  903. s_player_downgrade_build = -1;
  904. };
  905.  
  906. // inplace maintenance tool
  907. if ((damage _cursorTarget >= DZE_DamageBeforeMaint) && {_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ"}) then {
  908. if ((s_player_lastTarget select 2) != _cursorTarget) then {
  909. if (s_player_maint_build > 0) then {
  910. player removeAction s_player_maint_build;
  911. s_player_maint_build = -1;
  912. };
  913. };
  914. if (s_player_maint_build < 0) then {
  915. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  916. if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
  917. _text2 = _text + " (" + str(round ((damage _cursorTarget) * 100)) + "% damaged)";
  918. s_player_lastTarget set [2,_cursorTarget];
  919. s_player_maint_build = player addAction [format["%1 %2",localize "STR_EPOCH_ACTIONS_MAINTAIN",_text2], "\z\addons\dayz_code\actions\player_buildingMaint.sqf",_cursorTarget, -2, false, true];
  920. };
  921. };
  922. } else {
  923. player removeAction s_player_maint_build;
  924. s_player_maint_build = -1;
  925. };
  926.  
  927. //Start Generator
  928. if (_isGenerator) then {
  929. if (s_player_fillgen < 0) then {
  930. // check if not running
  931. if (_cursorTarget getVariable ["GeneratorRunning", false]) then {
  932. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true];
  933. } else {
  934. // check if not filled and player has jerry.
  935. if (_cursorTarget getVariable ["GeneratorFilled", false]) then {
  936. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
  937. } else {
  938. if (_hasFuel20 or _hasFuel5 or _hasBarrel) then {
  939. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
  940. };
  941. };
  942. };
  943. };
  944. } else {
  945. player removeAction s_player_fillgen;
  946. s_player_fillgen = -1;
  947. };
  948.  
  949. _clothesTaken = _cursorTarget getVariable["clothesTaken",false];
  950. _isZombie = _cursorTarget isKindOf "zZombie_base"; // Add this here now since epoch 1.0.6 doesn't initialize this where this will go.
  951.  
  952. // Take clothes by Zabn
  953. if (_isMan and !_isAlive and !_isZombie and !_clothesTaken) then {
  954. if (s_player_clothes < 0) then {
  955. s_player_clothes = player addAction [format["<t color='#0096ff'>Take Clothes</t>"], "scripts\takeClothes.sqf",_cursorTarget,0, false,true];
  956. };
  957. } else {
  958. player removeAction s_player_clothes;
  959. s_player_clothes = -1;
  960. };
  961.  
  962.  
  963.  
  964. //Towing with tow truck
  965. /*
  966. if(_typeOfCursorTarget == "TOW_DZE") then {
  967. if (s_player_towing < 0) then {
  968. if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
  969. s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true];
  970. } else {
  971. s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true];
  972. };
  973. };
  974. } else {
  975. player removeAction s_player_towing;
  976. s_player_towing = -1;
  977. };
  978. */
  979.  
  980. // Custom below
  981.  
  982. if ((_typeOfCursorTarget in vg_List) && (player distance _cursorTarget < 5)) then {
  983. _hasAccess = [player,_cursorTarget] call FNC_check_access;
  984. if (s_garage_dialog < 0 && ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4) or (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in vg_list}))) then {
  985. s_garage_dialog = player addAction [localize "STR_VG_VIRTUAL_GARAGE","scripts\virtualGarage\virtualGarage.sqf",_cursorTarget,3,false,true];
  986. };
  987. } else {
  988. player removeAction s_garage_dialog;
  989. s_garage_dialog = -1;
  990. };
  991.  
  992. if (!_isAlive && {!(_cursorTarget isKindOf "zZombie_base")} && {!(_cursorTarget isKindOf "Animal")} && {_canDo} && {_isMan}) then {
  993. _isButchered = _cursorTarget getVariable ["bodyButchered",false];
  994. if (!_isButchered) then {
  995. if ("ItemEtool" in _itemsPlayer) then {
  996. if (s_player_bury_human < 0) then {
  997. s_player_bury_human = player addAction ["<t color='#0096ff'>Bury Human</t>","scripts\buryActions.sqf",[_cursorTarget,"bury"],0,false,true];
  998. }
  999. } else {
  1000. player removeAction s_player_bury_human;
  1001. s_player_bury_human = -1;
  1002. };
  1003. //if ({_x in ["ItemKnife","ItemKnife5","ItemKnife4","ItemKnife3","ItemKnife2","ItemKnifeBlunt"]} count _itemsPlayer > 0) then {
  1004. //if (s_player_butcher_human < 0) then {
  1005. //s_player_butcher_human = player addAction ["<t color='#0096ff'>Butcher Human</t>","scripts\buryActions.sqf",[_cursorTarget,"butcher"],0,false,true];
  1006. //};
  1007. //} else {
  1008. //player removeAction s_player_butcher_human;
  1009. //s_player_butcher_human = -1;
  1010. //};
  1011. };
  1012. };
  1013.  
  1014. if (_isVehicle && {_characterID == "0"} && {_hasKeyKit} && {!_isMan} && {_isAlive}) then {
  1015. if (s_player_claimVehicle < 0) then {
  1016. _totalKeys = call epoch_tempKeys;
  1017. if (count (_totalKeys select 0) > 0) then {
  1018. s_player_claimVehicle = player addAction [format ["<t color=""#0096FF"">Claim %1</t>",_text],"scripts\vkc\vehicleKeyChanger.sqf",[_cursorTarget,_characterID,"claim"],5,false,true];
  1019. };
  1020. };
  1021. } else {
  1022. player removeAction s_player_claimVehicle;
  1023. s_player_claimVehicle = -1;
  1024. };
  1025. if (_isMan && {!_isAlive} && {!(_cursorTarget isKindOf "Animal")} && {player distance _cursorTarget < 5}) then {
  1026. if (s_player_checkWallet < 0) then {
  1027. s_player_checkWallet = player addAction ["Check Wallet","scripts\zsc\checkWallet.sqf",_cursorTarget,0,false,true];
  1028. };
  1029. } else {
  1030. player removeAction s_player_checkWallet;
  1031. s_player_checkWallet = -1;
  1032. };
  1033.  
  1034. if (_typeOfCursorTarget in DZE_MoneyStorageClasses && {!locked _cursorTarget} && {!(_typeOfCursorTarget in DZE_LockedStorage)} && {player distance _cursorTarget < 5}) then {
  1035. if (s_bank_dialog < 0) then {
  1036. s_bank_dialog = player addAction ["Access bank","scripts\zsc\bankDialog.sqf",_cursorTarget,1,true,true];
  1037. };
  1038. } else {
  1039. player removeAction s_bank_dialog;
  1040. s_bank_dialog = -1;
  1041. };
  1042.  
  1043. if (_isAlive && {_typeOfCursorTarget in AllPlayers} && {isPlayer _cursorTarget}) then {
  1044. if (s_givemoney_dialog < 0) then {
  1045. s_givemoney_dialog = player addAction [format ["Trade %1 with %2",CurrencyName,name _cursorTarget],"scripts\zsc\givePlayer.sqf",_cursorTarget,3,true,true];
  1046. };
  1047. } else {
  1048. player removeAction s_givemoney_dialog;
  1049. s_givemoney_dialog = -1;
  1050. };
  1051.  
  1052. if (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in ZSC_bankTraders} && {!_isPZombie}) then {
  1053. if (s_bank_dialog1 < 0) then {
  1054. s_bank_dialog1 = player addAction ["Bank Teller","scripts\zsc\atmDialog.sqf",_cursorTarget,3,true,true];
  1055. };
  1056. } else {
  1057. player removeAction s_bank_dialog1;
  1058. s_bank_dialog1 = -1;
  1059. };
  1060.  
  1061. if (_typeOfCursorTarget in ZSC_bankObjects && {player distance _cursorTarget < 5}) then {
  1062. if (s_bank_dialog2 < 0) then {
  1063. s_bank_dialog2 = player addAction ["Bank ATM","scripts\zsc\atmDialog.sqf",_cursorTarget,3,true,true];
  1064. };
  1065. } else {
  1066. player removeAction s_bank_dialog2;
  1067. s_bank_dialog2 = -1;
  1068. };
  1069.  
  1070. // All Traders
  1071. if (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in serverTraders} && {!_isPZombie}) then {
  1072. if (s_player_parts_crtl < 0) then {
  1073. _humanity = player getVariable ["humanity",0];
  1074. _traderMenu = call compile format["menu_%1;",_typeOfCursorTarget];
  1075. _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_LOW";
  1076. _humanity_logic = false;
  1077. if ((_traderMenu select 2) == "hero") then {
  1078. _humanity_logic = (_humanity < 20000);
  1079. };
  1080. if ((_traderMenu select 2) == "superhero") then {
  1081. _humanity_logic = (_humanity < 40000);
  1082. };
  1083. if ((_traderMenu select 2) == "agenthero") then {
  1084. _humanity_logic = (_humanity < 60000);
  1085. };
  1086. if (_humanity_logic) then {
  1087. _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false];
  1088. s_player_parts set [count s_player_parts,_cancel];
  1089. } else {
  1090. // Static Menu
  1091. {
  1092. _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];
  1093. s_player_parts set [count s_player_parts,_buy];
  1094. } count (_traderMenu select 1);
  1095. if (DZE_ConfigTrader) then {
  1096. _buyV = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\AdvancedTrading\init.sqf",(_traderMenu select 0), 999, true, false];
  1097. s_player_parts set [count s_player_parts,_buyV];
  1098. } else {
  1099. // Database menu
  1100. _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false];
  1101. s_player_parts set [count s_player_parts,_buy];
  1102. };
  1103. };
  1104. s_player_parts_crtl = 1;
  1105. };
  1106. } else {
  1107. {player removeAction _x} count s_player_parts;s_player_parts = [];
  1108. s_player_parts_crtl = -1;
  1109. };
  1110.  
  1111. if (VR_useWardrobe) then {
  1112. private ["_isWardrobe","_isFemale"];
  1113. _isWardrobe = (typeOf (_cursorTarget) in VR_arrayWardrobes);
  1114. _isFemale = (typeOf (player) in VR_femaleSkins);
  1115.  
  1116. if ((_isWardrobe) && (player distance _cursorTarget < 5)) then {
  1117. if (s_changing_room < 0) then {
  1118. if (!_isFemale) then {
  1119. s_changing_room = player addAction ["Men's Room","dayz_code\external\chocskins\Male_Dialog.sqf",_cursorTarget, 0, true, true];
  1120. systemChat "Welcome to the Men's Room good sir!";
  1121. }else{
  1122. s_changing_room = player addAction ["Gal's Room","dayz_code\external\chocskins\Female_Dialog.sqf",_cursorTarget, 0, true, true];
  1123. systemChat "Welcome to the Lady's Room ma'am!";
  1124. };
  1125. };
  1126. } else {
  1127. player removeAction s_changing_room;
  1128. s_changing_room = -1;
  1129. };
  1130. };
  1131.  
  1132. if (VR_useWardrobe) then {
  1133. private ["_isWardrobe","_isFemale"];
  1134. _isWardrobe = (typeOf (_cursorTarget) in VR_arrayWardrobes);
  1135. _isFemale = (typeOf (player) in VR_femaleSkins);
  1136.  
  1137. if ((_isWardrobe) && (player distance _cursorTarget < 5)) then {
  1138. if (s_changing_room < 0) then {
  1139. if (!_isFemale) then {
  1140. s_changing_room = player addAction ["Men's Room","dayz_code\external\chocskins\Male_Dialog.sqf",_cursorTarget, 0, true, true];
  1141. systemChat "Welcome to the Men's Room good sir!";
  1142. }else{
  1143. s_changing_room = player addAction ["Gal's Room","dayz_code\external\chocskins\Female_Dialog.sqf",_cursorTarget, 0, true, true];
  1144. systemChat "Welcome to the Lady's Room ma'am!";
  1145. };
  1146. };
  1147. } else {
  1148. player removeAction s_changing_room;
  1149. s_changing_room = -1;
  1150. };
  1151. };
  1152.  
  1153. if (dayz_tameDogs) then {
  1154. //Dog
  1155. _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
  1156. if (_isDog && {_hasRawMeat} && {_isAlive} && {_ownerID == "0"} && {player getVariable ["dogID",0] == 0}) then {
  1157. if (s_player_tamedog < 0) then {
  1158. s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\dog\tame_dog.sqf", _cursorTarget, 1, false, true];
  1159. };
  1160. } else {
  1161. player removeAction s_player_tamedog;
  1162. s_player_tamedog = -1;
  1163. };
  1164. if (_isDog && {_ownerID == _id} && {_isAlive}) then {
  1165. if (s_player_feeddog < 0 && _hasRawMeat) then {
  1166. s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true];
  1167. };
  1168. if (s_player_waterdog < 0 && _hasbottleitem) then {
  1169. s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true];
  1170. };
  1171. if (s_player_staydog < 0) then {
  1172. if (_dogHandle getFSMVariable "_actionLieDown") then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  1173. s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true];
  1174. };
  1175. if (s_player_trackdog < 0) then {
  1176. s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true];
  1177. };
  1178. if (s_player_barkdog < 0) then {
  1179. s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true];
  1180. };
  1181. if (s_player_warndog < 0) then {
  1182. _warn = _dogHandle getFSMVariable "_watchDog";
  1183. if (_warn) then { _text = localize "str_epoch_player_247"; _warn = false; } else { _text = localize "str_epoch_player_248"; _warn = true; };
  1184. s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true];
  1185. };
  1186. if (s_player_followdog < 0) then {
  1187. s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true];
  1188. };
  1189. } else {
  1190. player removeAction s_player_feeddog;
  1191. s_player_feeddog = -1;
  1192. player removeAction s_player_waterdog;
  1193. s_player_waterdog = -1;
  1194. player removeAction s_player_staydog;
  1195. s_player_staydog = -1;
  1196. player removeAction s_player_trackdog;
  1197. s_player_trackdog = -1;
  1198. player removeAction s_player_barkdog;
  1199. s_player_barkdog = -1;
  1200. player removeAction s_player_warndog;
  1201. s_player_warndog = -1;
  1202. player removeAction s_player_followdog;
  1203. s_player_followdog = -1;
  1204. };
  1205. };
  1206. } else {
  1207. //Engineering
  1208. player removeAction s_player_plot_boundary;
  1209. s_player_plot_boundary = -1;
  1210. player removeAction s_player_plotManagement;
  1211. s_player_plotManagement = -1;
  1212. {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  1213. player removeAction s_player_repair_crtl;
  1214. s_player_repair_crtl = -1;
  1215. dayz_myCursorTarget = objNull;
  1216. player removeAction s_player_flipveh;
  1217. s_player_flipveh = -1;
  1218. player removeAction s_player_sleep;
  1219. s_player_sleep = -1;
  1220. player removeAction s_player_deleteBuild;
  1221. s_player_deleteBuild = -1;
  1222. player removeAction s_player_cook;
  1223. s_player_cook = -1;
  1224. player removeAction s_player_boil;
  1225. s_player_boil = -1;
  1226. player removeAction s_player_fireout;
  1227. s_player_fireout = -1;
  1228. player removeAction s_player_packtent;
  1229. s_player_packtent = -1;
  1230. player removeAction s_player_packtentinfected;
  1231. s_player_packtentinfected = -1;
  1232. player removeAction s_player_fillfuel;
  1233. s_player_fillfuel = -1;
  1234. player removeAction s_player_studybody;
  1235. s_player_studybody = -1;
  1236. //fuel
  1237. player removeAction s_player_fillfuel210;
  1238. s_player_fillfuel210 = -1;
  1239. player removeAction s_player_fillfuel20;
  1240. s_player_fillfuel20 = -1;
  1241. player removeAction s_player_fillfuel5;
  1242. s_player_fillfuel5 = -1;
  1243. //Allow player to siphon vehicle fuel
  1244. player removeAction s_player_siphonfuel;
  1245. s_player_siphonfuel = -1;
  1246. //Allow player to gather
  1247. player removeAction s_player_gather;
  1248. s_player_gather = -1;
  1249. player removeAction s_player_destroytent;
  1250. s_player_destroytent = -1;
  1251. // player removeAction s_player_attach_bomb;
  1252. // s_player_attach_bomb = -1;
  1253. //debug
  1254. //player removeAction s_player_debugCheck;
  1255. //s_player_debugCheck = -1;
  1256. player removeAction s_player_upgradestorage;
  1257. s_player_upgradestorage = -1;
  1258. /* //Unlock,Lock // Vanilla base building currently not used in Epoch
  1259. player removeAction s_player_setCode;
  1260. s_player_setCode = -1;
  1261. player removeAction s_player_lockhouse;
  1262. s_player_lockhouse = -1;
  1263. player removeAction s_player_unlockhouse;
  1264. s_player_unlockhouse = -1;
  1265. player removeAction s_player_openGate;
  1266. s_player_openGate = -1;
  1267. player removeAction s_player_CloseGate;
  1268. s_player_CloseGate = -1;
  1269. player removeAction s_player_breakinhouse;
  1270. s_player_breakinhouse = -1;
  1271. player removeAction s_player_BuildUnLock;
  1272. s_player_BuildUnLock = -1;
  1273. player removeAction s_player_BuildLock;
  1274. s_player_BuildLock = -1;*/
  1275. {player removeAction _x} count s_player_combi;s_player_combi = [];
  1276. s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  1277. {player removeAction _x} count s_player_parts;s_player_parts = [];
  1278. s_player_parts_crtl = -1;
  1279. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  1280. s_player_lockUnlock_crtl = -1;
  1281. player removeAction s_player_SurrenderedGear;
  1282. s_player_SurrenderedGear = -1;
  1283. player removeAction s_player_maintain_area;
  1284. s_player_maintain_area = -1;
  1285. player removeAction s_player_maintain_area_force;
  1286. s_player_maintain_area_force = -1;
  1287. player removeAction s_player_maintain_area_preview;
  1288. s_player_maintain_area_preview = -1;
  1289. player removeAction s_player_tamedog;
  1290. s_player_tamedog = -1;
  1291. player removeAction s_player_feeddog;
  1292. s_player_feeddog = -1;
  1293. player removeAction s_player_waterdog;
  1294. s_player_waterdog = -1;
  1295. player removeAction s_player_staydog;
  1296. s_player_staydog = -1;
  1297. player removeAction s_player_trackdog;
  1298. s_player_trackdog = -1;
  1299. player removeAction s_player_barkdog;
  1300. s_player_barkdog = -1;
  1301. player removeAction s_player_warndog;
  1302. s_player_warndog = -1;
  1303. player removeAction s_player_followdog;
  1304. s_player_followdog = -1;
  1305. player removeAction s_player_unlockvault;
  1306. s_player_unlockvault = -1;
  1307. player removeAction s_player_packvault;
  1308. s_player_packvault = -1;
  1309. player removeAction s_player_lockvault;
  1310. s_player_lockvault = -1;
  1311. player removeAction s_player_information;
  1312. s_player_information = -1;
  1313. player removeAction s_player_fillgen;
  1314. s_player_fillgen = -1;
  1315. player removeAction s_player_upgrade_build;
  1316. s_player_upgrade_build = -1;
  1317. player removeAction s_player_maint_build;
  1318. s_player_maint_build = -1;
  1319. player removeAction s_player_downgrade_build;
  1320. s_player_downgrade_build = -1;
  1321. player removeAction s_player_towing;
  1322. s_player_towing = -1;
  1323. player removeAction s_player_fuelauto;
  1324. s_player_fuelauto = -1;
  1325. player removeAction s_player_fuelauto2;
  1326. s_player_fuelauto2 = -1;
  1327. player removeAction s_player_manageDoor;
  1328. s_player_manageDoor = -1;
  1329. player removeAction s_player_def;
  1330. s_player_def = -1;
  1331. // Take Clothes by Zabn
  1332. player removeAction s_player_clothes;
  1333. s_player_clothes = -1;
  1334.  
  1335. // Custom below
  1336. player removeAction s_givemoney_dialog;
  1337. s_givemoney_dialog = -1;
  1338. player removeAction s_bank_dialog;
  1339. s_bank_dialog = -1;
  1340. player removeAction s_bank_dialog1;
  1341. s_bank_dialog1 = -1;
  1342. player removeAction s_bank_dialog2;
  1343. s_bank_dialog2 = -1;
  1344. player removeAction s_player_checkWallet;
  1345. s_player_checkWallet = -1;
  1346. player removeAction s_player_copyToKey;
  1347. s_player_copyToKey = -1;
  1348. player removeAction s_player_claimVehicle;
  1349. s_player_claimVehicle = -1;
  1350. player removeAction s_collect_heli;
  1351. s_collect_heli = -1;
  1352. player removeAction s_player_bury_human;
  1353. s_player_bury_human = -1;
  1354. player removeAction s_player_butcher_human;
  1355. s_player_butcher_human = -1;
  1356. player removeAction s_changing_room;
  1357. s_changing_room = -1;
  1358. player removeAction s_garage_dialog;
  1359. s_garage_dialog = -1;
  1360. s_player_def = -1;
  1361. };
  1362.  
  1363. //Dog actions on player self
  1364. if (_dogHandle > 0) then {
  1365. _dog = _dogHandle getFSMVariable "_dog";
  1366. if (isNil "_dog") exitWith {};
  1367. if (isNil "_ownerID") then {_ownerID = "0"};
  1368. if (_canDo && !_inVehicle && alive _dog && !(_ownerID in [dayz_characterID,_uid])) then {
  1369. if (s_player_movedog < 0) then {
  1370. s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID",0], 1, false, true];
  1371. };
  1372. if (s_player_speeddog < 0) then {
  1373. _text = localize "str_epoch_player_249";
  1374. _speed = 0;
  1375. if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = localize "str_epoch_player_250"; };
  1376. 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];
  1377. };
  1378. if (s_player_calldog < 0) then {
  1379. 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];
  1380. };
  1381. };
  1382. } else {
  1383. player removeAction s_player_movedog;
  1384. s_player_movedog = -1;
  1385. player removeAction s_player_speeddog;
  1386. s_player_speeddog = -1;
  1387. player removeAction s_player_calldog;
  1388. s_player_calldog = -1;
  1389. };
  1390.  
  1391. //Monitor
  1392. player setVariable ["selfActions", diag_ticktime, false];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement