Advertisement
Guest User

fn_selfactions.sqf

a guest
Oct 20th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 70.38 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.  
  635. _isObjectWithComputer = _typeOfCursorTarget in ["TOW_TriPod_US_EP1","MLRS_DES_EP1"];
  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.  
  645.  
  646.  
  647. if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {speed player <= 1}) then {
  648. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  649. _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
  650. if (DZE_permanentPlot) then {
  651. if (s_player_plotManagement < 0 && _allowed) then {
  652. 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];
  653. };
  654. } else {
  655. if (s_player_maintain_area < 0) then {
  656. 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];
  657. 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];
  658. 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];
  659. };
  660. };
  661. if (s_player_plot_boundary < 0 && (_allowed or (_hasAccess select 1))) then {
  662. s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false];
  663. };
  664. } else {
  665. player removeAction s_player_plotManagement;
  666. s_player_plotManagement = -1;
  667. player removeAction s_player_maintain_area;
  668. s_player_maintain_area = -1;
  669. player removeAction s_player_maintain_area_force;
  670. s_player_maintain_area_force = -1;
  671. player removeAction s_player_maintain_area_preview;
  672. s_player_maintain_area_preview = -1;
  673. player removeAction s_player_plot_boundary;
  674. s_player_plot_boundary = -1;
  675. };
  676.  
  677. if (DZE_HeliLift) then {
  678. _liftHeli = objNull;
  679. _found = false;
  680. _allowTow = false;
  681. if ((count (crew _cursorTarget)) == 0) then {
  682. {
  683. if (!_allowTow) then {
  684. _allowTow = _cursorTarget isKindOf _x;
  685. };
  686. } count DZE_HeliAllowToTow;
  687. };
  688.  
  689. if (_allowTow) then {
  690. {
  691. if (!_found) then {
  692. _posL = [_x] call FNC_getPos;
  693. _posC = [_cursorTarget] call FNC_getPos;
  694. _height = (_posL select 2) - (_posC select 2);
  695. _hasAttached = _x getVariable["hasAttached",false];
  696. if ((_height < 15) && {_height > 5} && {typeName _hasAttached != "OBJECT"}) then {
  697. if (((abs((_posL select 0) - (_posC select 0))) < 10) && {(abs((_posL select 1) - (_posC select 1))) < 10}) then {
  698. _liftHeli = _x;
  699. _found = true;
  700. };
  701. };
  702. };
  703. } count (player nearEntities [DZE_HeliAllowTowFrom,15]);
  704. };
  705.  
  706. _attached = _cursorTarget getVariable["attached",false];
  707. if (_found && {_allowTow} && {!locked _cursorTarget} && {!_isPZombie} && {typeName _attached != "OBJECT"}) then {
  708. if (s_player_heli_lift < 0) then {
  709. s_player_heli_lift = player addAction [localize "STR_EPOCH_ACTIONS_ATTACHTOHELI", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true];
  710. };
  711. } else {
  712. player removeAction s_player_heli_lift;
  713. s_player_heli_lift = -1;
  714. };
  715. };
  716.  
  717. // Allow Owner to lock and unlock vehicle
  718. if (_player_lockUnlock_crtl) then {
  719. _totalKeys = call epoch_tempKeys;
  720. _temp_keys = _totalKeys select 0;
  721. _temp_keys_names = _totalKeys select 1;
  722. _hasKey = _characterID in _temp_keys;
  723.  
  724. if (s_player_lockUnlock_crtl < 0) then {
  725. _oldOwner = (_characterID == _uid);
  726. if (_isLocked) then {
  727. if (_hasKey || {_oldOwner}) then {
  728. _temp_key_name = (_temp_keys_names select (_temp_keys find _characterID));
  729. _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];
  730. s_player_lockunlock set [count s_player_lockunlock,_unlock];
  731. s_player_lockUnlock_crtl = 1;
  732. } else {
  733. if (_hasHotwireKit) then {
  734. _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true];
  735. } else {
  736. _unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, false, true];
  737. };
  738. s_player_lockunlock set [count s_player_lockunlock,_unlock];
  739. s_player_lockUnlock_crtl = 1;
  740. };
  741. } else {
  742. if (_hasKey || _oldOwner) then {
  743. _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true];
  744. s_player_lockunlock set [count s_player_lockunlock,_lock];
  745. s_player_lockUnlock_crtl = 1;
  746. };
  747. };
  748. };
  749. if (s_player_copyToKey < 0) then {
  750. if (_hasKey && {_hasKeyKit} && {(count _temp_keys) > 1} && {!_isLocked}) then {
  751. s_player_copyToKey = player addAction ["<t color=""#0096FF"">Change vehicle key</t>","scripts\vkc\vehicleKeyChanger.sqf",[_cursorTarget,_characterID,"change"],5,false,true];
  752. };
  753. };
  754. } else {
  755. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  756. s_player_lockUnlock_crtl = -1;
  757. player removeAction s_player_copyToKey;
  758. s_player_copyToKey = -1;
  759. };
  760.  
  761. // gear access on surrendered player
  762. if (isPlayer _cursorTarget && {_isAlive} && {_cursorTarget getVariable ["DZE_Surrendered",false]}) then {
  763. if (s_player_SurrenderedGear < 0) then {
  764. s_player_SurrenderedGear = player addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true];
  765. };
  766. } else {
  767. player removeAction s_player_SurrenderedGear;
  768. s_player_SurrenderedGear = -1;
  769. };
  770.  
  771. // Allow manage door
  772. if (DZE_doorManagement && (_typeOfCursorTarget in DZE_DoorsLocked)) then {
  773. // Check player access
  774. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  775. 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 {
  776. 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];
  777. };
  778. } else {
  779. player removeAction s_player_manageDoor;
  780. s_player_manageDoor = -1;
  781. };
  782.  
  783. //Allow owner to unlock vault
  784. if ((_typeOfCursorTarget in DZE_LockableStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3} && {!keypadCancel}) then {
  785. if (s_player_unlockvault < 0) then {
  786. if (_typeOfCursorTarget in DZE_LockedStorage) then {
  787. if (_characterID == dayz_combination || _ownerID == _uid) then {
  788. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true];
  789. s_player_combi set [count s_player_combi,_combi];
  790. } else {
  791. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
  792. s_player_combi set [count s_player_combi,_combi];
  793. };
  794. s_player_unlockvault = 1;
  795. } else {
  796. if (_characterID != dayz_combination && _ownerID != _uid) then {
  797. _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
  798. s_player_combi set [count s_player_combi,_combi];
  799. s_player_unlockvault = 1;
  800. };
  801. };
  802. };
  803. } else {
  804. {player removeAction _x} count s_player_combi;s_player_combi = [];
  805. s_player_unlockvault = -1;
  806. };
  807.  
  808. //Allow owner to pack vault
  809. if ((_typeOfCursorTarget in DZE_UnLockedStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3} && {!keypadCancel}) then {
  810. if (s_player_lockvault < 0) then {
  811. if (_characterID == dayz_combination || _ownerID == _uid) then {
  812. s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true];
  813. };
  814. };
  815. if (s_player_packvault < 0 && (_characterID == dayz_combination || _ownerID == _uid)) then {
  816. 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];
  817. };
  818. } else {
  819. player removeAction s_player_packvault;
  820. s_player_packvault = -1;
  821. player removeAction s_player_lockvault;
  822. s_player_lockvault = -1;
  823. };
  824.  
  825. //Player Deaths
  826. if (_typeOfCursorTarget == "Info_Board_EP1") then {
  827. if (s_player_information < 0) then {
  828. s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true];
  829. };
  830. } else {
  831. player removeAction s_player_information;
  832. s_player_information = -1;
  833. };
  834.  
  835. //Fuel Pump
  836. if (_typeOfCursorTarget in dayz_fuelpumparray) then {
  837. if (s_player_fuelauto < 0) then {
  838. // check if Generator_DZ is running within 30 meters
  839. _findNearestGen = {((alive _x) && (_x getVariable ["GeneratorRunning",false]))} count (([player] call FNC_getPos) nearObjects ["Generator_DZ",30]);
  840.  
  841. // show that pump needs power if no generator nearby.
  842. if (_findNearestGen > 0) then {
  843. s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true];
  844. } else {
  845. s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
  846. };
  847. };
  848. } else {
  849. player removeAction s_player_fuelauto;
  850. s_player_fuelauto = -1;
  851. };
  852.  
  853. //Fuel Pump on truck
  854. if (_typeOfCursorTarget in DZE_fueltruckarray && _isAlive) then {
  855. if (s_player_fuelauto2 < 0) then {
  856. // show that fuel truck pump needs power.
  857. if (isEngineOn _cursorTarget) then {
  858. s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true];
  859. } else {
  860. s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
  861. };
  862. };
  863. } else {
  864. player removeAction s_player_fuelauto2;
  865. s_player_fuelauto2 = -1;
  866. };
  867.  
  868. // inplace upgrade tool
  869. if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
  870. if ((s_player_lastTarget select 0) != _cursorTarget) then {
  871. if (s_player_upgrade_build > 0) then {
  872. player removeAction s_player_upgrade_build;
  873. s_player_upgrade_build = -1;
  874. };
  875. };
  876. if (s_player_upgrade_build < 0) then {
  877. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  878. _upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding");
  879. if (((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) && (count _upgrade) > 0) then {
  880. s_player_lastTarget set [0,_cursorTarget];
  881. s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_UPGRADE",_text], "\z\addons\dayz_code\actions\player_upgrade.sqf",_cursorTarget, -1, false, true];
  882. };
  883. };
  884. } else {
  885. player removeAction s_player_upgrade_build;
  886. s_player_upgrade_build = -1;
  887. };
  888.  
  889. // downgrade system
  890. if ((DZE_Lock_Door == _characterID) && {!keypadCancel} && {_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base"}) then {
  891. if ((s_player_lastTarget select 1) != _cursorTarget) then {
  892. if (s_player_downgrade_build > 0) then {
  893. player removeAction s_player_downgrade_build;
  894. s_player_downgrade_build = -1;
  895. };
  896. };
  897. if (s_player_downgrade_build < 0) then {
  898. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  899. if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
  900. s_player_lastTarget set [1,_cursorTarget];
  901. 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];
  902. };
  903. };
  904. } else {
  905. player removeAction s_player_downgrade_build;
  906. s_player_downgrade_build = -1;
  907. };
  908.  
  909. // inplace maintenance tool
  910. if ((damage _cursorTarget >= DZE_DamageBeforeMaint) && {_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ"}) then {
  911. if ((s_player_lastTarget select 2) != _cursorTarget) then {
  912. if (s_player_maint_build > 0) then {
  913. player removeAction s_player_maint_build;
  914. s_player_maint_build = -1;
  915. };
  916. };
  917. if (s_player_maint_build < 0) then {
  918. _hasAccess = [player, _cursorTarget] call FNC_check_access;
  919. if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
  920. _text2 = _text + " (" + str(round ((damage _cursorTarget) * 100)) + "% damaged)";
  921. s_player_lastTarget set [2,_cursorTarget];
  922. 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];
  923. };
  924. };
  925. } else {
  926. player removeAction s_player_maint_build;
  927. s_player_maint_build = -1;
  928. };
  929.  
  930. //Start Generator
  931. if (_isGenerator) then {
  932. if (s_player_fillgen < 0) then {
  933. // check if not running
  934. if (_cursorTarget getVariable ["GeneratorRunning", false]) then {
  935. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true];
  936. } else {
  937. // check if not filled and player has jerry.
  938. if (_cursorTarget getVariable ["GeneratorFilled", false]) then {
  939. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
  940. } else {
  941. if (_hasFuel20 or _hasFuel5 or _hasBarrel) then {
  942. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
  943. };
  944. };
  945. };
  946. };
  947. } else {
  948. player removeAction s_player_fillgen;
  949. s_player_fillgen = -1;
  950. };
  951.  
  952. _clothesTaken = _cursorTarget getVariable["clothesTaken",false];
  953. _isZombie = _cursorTarget isKindOf "zZombie_base"; // Add this here now since epoch 1.0.6 doesn't initialize this where this will go.
  954.  
  955. // Take clothes by Zabn
  956. if (_isMan and !_isAlive and !_isZombie and !_clothesTaken) then {
  957. if (s_player_clothes < 0) then {
  958. s_player_clothes = player addAction [format["<t color='#0096ff'>Take Clothes</t>"], "scripts\takeClothes.sqf",_cursorTarget,0, false,true];
  959. };
  960. } else {
  961. player removeAction s_player_clothes;
  962. s_player_clothes = -1;
  963. };
  964.  
  965.  
  966.  
  967. //Towing with tow truck
  968. /*
  969. if(_typeOfCursorTarget == "TOW_DZE") then {
  970. if (s_player_towing < 0) then {
  971. if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
  972. s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true];
  973. } else {
  974. s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true];
  975. };
  976. };
  977. } else {
  978. player removeAction s_player_towing;
  979. s_player_towing = -1;
  980. };
  981. */
  982.  
  983. // Custom below
  984.  
  985. if ((_typeOfCursorTarget in vg_List) && (player distance _cursorTarget < 5)) then {
  986. _hasAccess = [player,_cursorTarget] call FNC_check_access;
  987. 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 {
  988. s_garage_dialog = player addAction [localize "STR_VG_VIRTUAL_GARAGE","scripts\virtualGarage\virtualGarage.sqf",_cursorTarget,3,false,true];
  989. };
  990. } else {
  991. player removeAction s_garage_dialog;
  992. s_garage_dialog = -1;
  993. };
  994.  
  995. if (!_isAlive && {!(_cursorTarget isKindOf "zZombie_base")} && {!(_cursorTarget isKindOf "Animal")} && {_canDo} && {_isMan}) then {
  996. _isButchered = _cursorTarget getVariable ["bodyButchered",false];
  997. if (!_isButchered) then {
  998. if ("ItemEtool" in _itemsPlayer) then {
  999. if (s_player_bury_human < 0) then {
  1000. s_player_bury_human = player addAction ["<t color='#0096ff'>Bury Human</t>","scripts\buryActions.sqf",[_cursorTarget,"bury"],0,false,true];
  1001. }
  1002. } else {
  1003. player removeAction s_player_bury_human;
  1004. s_player_bury_human = -1;
  1005. };
  1006. //if ({_x in ["ItemKnife","ItemKnife5","ItemKnife4","ItemKnife3","ItemKnife2","ItemKnifeBlunt"]} count _itemsPlayer > 0) then {
  1007. //if (s_player_butcher_human < 0) then {
  1008. //s_player_butcher_human = player addAction ["<t color='#0096ff'>Butcher Human</t>","scripts\buryActions.sqf",[_cursorTarget,"butcher"],0,false,true];
  1009. //};
  1010. //} else {
  1011. //player removeAction s_player_butcher_human;
  1012. //s_player_butcher_human = -1;
  1013. //};
  1014. };
  1015. };
  1016.  
  1017. if (_isVehicle && {_characterID == "0"} && {_hasKeyKit} && {!_isMan} && {_isAlive}) then {
  1018. if (s_player_claimVehicle < 0) then {
  1019. _totalKeys = call epoch_tempKeys;
  1020. if (count (_totalKeys select 0) > 0) then {
  1021. s_player_claimVehicle = player addAction [format ["<t color=""#0096FF"">Claim %1</t>",_text],"scripts\vkc\vehicleKeyChanger.sqf",[_cursorTarget,_characterID,"claim"],5,false,true];
  1022. };
  1023. };
  1024. } else {
  1025. player removeAction s_player_claimVehicle;
  1026. s_player_claimVehicle = -1;
  1027. };
  1028. if (_isMan && {!_isAlive} && {!(_cursorTarget isKindOf "Animal")} && {player distance _cursorTarget < 5}) then {
  1029. if (s_player_checkWallet < 0) then {
  1030. s_player_checkWallet = player addAction ["Check Wallet","scripts\zsc\checkWallet.sqf",_cursorTarget,0,false,true];
  1031. };
  1032. } else {
  1033. player removeAction s_player_checkWallet;
  1034. s_player_checkWallet = -1;
  1035. };
  1036.  
  1037. if (_typeOfCursorTarget in DZE_MoneyStorageClasses && {!locked _cursorTarget} && {!(_typeOfCursorTarget in DZE_LockedStorage)} && {player distance _cursorTarget < 5}) then {
  1038. if (s_bank_dialog < 0) then {
  1039. s_bank_dialog = player addAction ["Access bank","scripts\zsc\bankDialog.sqf",_cursorTarget,1,true,true];
  1040. };
  1041. } else {
  1042. player removeAction s_bank_dialog;
  1043. s_bank_dialog = -1;
  1044. };
  1045.  
  1046. if (_isAlive && {_typeOfCursorTarget in AllPlayers} && {isPlayer _cursorTarget}) then {
  1047. if (s_givemoney_dialog < 0) then {
  1048. s_givemoney_dialog = player addAction [format ["Trade %1 with %2",CurrencyName,name _cursorTarget],"scripts\zsc\givePlayer.sqf",_cursorTarget,3,true,true];
  1049. };
  1050. } else {
  1051. player removeAction s_givemoney_dialog;
  1052. s_givemoney_dialog = -1;
  1053. };
  1054.  
  1055. if (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in ZSC_bankTraders} && {!_isPZombie}) then {
  1056. if (s_bank_dialog1 < 0) then {
  1057. s_bank_dialog1 = player addAction ["Bank Teller","scripts\zsc\atmDialog.sqf",_cursorTarget,3,true,true];
  1058. };
  1059. } else {
  1060. player removeAction s_bank_dialog1;
  1061. s_bank_dialog1 = -1;
  1062. };
  1063.  
  1064. if (_typeOfCursorTarget in ZSC_bankObjects && {player distance _cursorTarget < 5}) then {
  1065. if (s_bank_dialog2 < 0) then {
  1066. s_bank_dialog2 = player addAction ["Bank ATM","scripts\zsc\atmDialog.sqf",_cursorTarget,3,true,true];
  1067. };
  1068. } else {
  1069. player removeAction s_bank_dialog2;
  1070. s_bank_dialog2 = -1;
  1071. };
  1072.  
  1073. // All Traders
  1074. if (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in serverTraders} && {!_isPZombie}) then {
  1075. if (s_player_parts_crtl < 0) then {
  1076. _humanity = player getVariable ["humanity",0];
  1077. _traderMenu = call compile format["menu_%1;",_typeOfCursorTarget];
  1078. _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_LOW";
  1079. _humanity_logic = false;
  1080. if ((_traderMenu select 2) == "hero") then {
  1081. _humanity_logic = (_humanity < 20000);
  1082. };
  1083. if ((_traderMenu select 2) == "superhero") then {
  1084. _humanity_logic = (_humanity < 40000);
  1085. };
  1086. if ((_traderMenu select 2) == "agenthero") then {
  1087. _humanity_logic = (_humanity < 60000);
  1088. };
  1089. if (_humanity_logic) then {
  1090. _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false];
  1091. s_player_parts set [count s_player_parts,_cancel];
  1092. } else {
  1093. // Static Menu
  1094. {
  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. } count (_traderMenu select 1);
  1098. if (DZE_ConfigTrader) then {
  1099. _buyV = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\AdvancedTrading\init.sqf",(_traderMenu select 0), 999, true, false];
  1100. s_player_parts set [count s_player_parts,_buyV];
  1101. } else {
  1102. // Database menu
  1103. _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false];
  1104. s_player_parts set [count s_player_parts,_buy];
  1105. };
  1106. };
  1107. s_player_parts_crtl = 1;
  1108. };
  1109. } else {
  1110. {player removeAction _x} count s_player_parts;s_player_parts = [];
  1111. s_player_parts_crtl = -1;
  1112. };
  1113.  
  1114. if (VR_useWardrobe) then {
  1115. private ["_isWardrobe","_isFemale"];
  1116. _isWardrobe = (typeOf (_cursorTarget) in VR_arrayWardrobes);
  1117. _isFemale = (typeOf (player) in VR_femaleSkins);
  1118.  
  1119. if ((_isWardrobe) && (player distance _cursorTarget < 5)) then {
  1120. if (s_changing_room < 0) then {
  1121. if (!_isFemale) then {
  1122. s_changing_room = player addAction ["Men's Room","dayz_code\external\chocskins\Male_Dialog.sqf",_cursorTarget, 0, true, true];
  1123. systemChat "Welcome to the Men's Room good sir!";
  1124. }else{
  1125. s_changing_room = player addAction ["Gal's Room","dayz_code\external\chocskins\Female_Dialog.sqf",_cursorTarget, 0, true, true];
  1126. systemChat "Welcome to the Lady's Room ma'am!";
  1127. };
  1128. };
  1129. } else {
  1130. player removeAction s_changing_room;
  1131. s_changing_room = -1;
  1132. };
  1133. };
  1134.  
  1135. if (VR_useWardrobe) then {
  1136. private ["_isWardrobe","_isFemale"];
  1137. _isWardrobe = (typeOf (_cursorTarget) in VR_arrayWardrobes);
  1138. _isFemale = (typeOf (player) in VR_femaleSkins);
  1139.  
  1140. if ((_isWardrobe) && (player distance _cursorTarget < 5)) then {
  1141. if (s_changing_room < 0) then {
  1142. if (!_isFemale) then {
  1143. s_changing_room = player addAction ["Men's Room","dayz_code\external\chocskins\Male_Dialog.sqf",_cursorTarget, 0, true, true];
  1144. systemChat "Welcome to the Men's Room good sir!";
  1145. }else{
  1146. s_changing_room = player addAction ["Gal's Room","dayz_code\external\chocskins\Female_Dialog.sqf",_cursorTarget, 0, true, true];
  1147. systemChat "Welcome to the Lady's Room ma'am!";
  1148. };
  1149. };
  1150. } else {
  1151. player removeAction s_changing_room;
  1152. s_changing_room = -1;
  1153. };
  1154. };
  1155.  
  1156. if (dayz_tameDogs) then {
  1157. //Dog
  1158. _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
  1159. if (_isDog && {_hasRawMeat} && {_isAlive} && {_ownerID == "0"} && {player getVariable ["dogID",0] == 0}) then {
  1160. if (s_player_tamedog < 0) then {
  1161. s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\dog\tame_dog.sqf", _cursorTarget, 1, false, true];
  1162. };
  1163. } else {
  1164. player removeAction s_player_tamedog;
  1165. s_player_tamedog = -1;
  1166. };
  1167. if (_isDog && {_ownerID == _id} && {_isAlive}) then {
  1168. if (s_player_feeddog < 0 && _hasRawMeat) then {
  1169. s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true];
  1170. };
  1171. if (s_player_waterdog < 0 && _hasbottleitem) then {
  1172. s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true];
  1173. };
  1174. if (s_player_staydog < 0) then {
  1175. if (_dogHandle getFSMVariable "_actionLieDown") then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  1176. s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true];
  1177. };
  1178. if (s_player_trackdog < 0) then {
  1179. s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true];
  1180. };
  1181. if (s_player_barkdog < 0) then {
  1182. s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true];
  1183. };
  1184. if (s_player_warndog < 0) then {
  1185. _warn = _dogHandle getFSMVariable "_watchDog";
  1186. if (_warn) then { _text = localize "str_epoch_player_247"; _warn = false; } else { _text = localize "str_epoch_player_248"; _warn = true; };
  1187. s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true];
  1188. };
  1189. if (s_player_followdog < 0) then {
  1190. s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true];
  1191. };
  1192. } else {
  1193. player removeAction s_player_feeddog;
  1194. s_player_feeddog = -1;
  1195. player removeAction s_player_waterdog;
  1196. s_player_waterdog = -1;
  1197. player removeAction s_player_staydog;
  1198. s_player_staydog = -1;
  1199. player removeAction s_player_trackdog;
  1200. s_player_trackdog = -1;
  1201. player removeAction s_player_barkdog;
  1202. s_player_barkdog = -1;
  1203. player removeAction s_player_warndog;
  1204. s_player_warndog = -1;
  1205. player removeAction s_player_followdog;
  1206. s_player_followdog = -1;
  1207. };
  1208. };
  1209. } else {
  1210. //Engineering
  1211. player removeAction s_player_plot_boundary;
  1212. s_player_plot_boundary = -1;
  1213. player removeAction s_player_plotManagement;
  1214. s_player_plotManagement = -1;
  1215. {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  1216. player removeAction s_player_repair_crtl;
  1217. s_player_repair_crtl = -1;
  1218. dayz_myCursorTarget = objNull;
  1219. player removeAction s_player_flipveh;
  1220. s_player_flipveh = -1;
  1221. player removeAction s_player_sleep;
  1222. s_player_sleep = -1;
  1223. player removeAction s_player_deleteBuild;
  1224. s_player_deleteBuild = -1;
  1225. player removeAction s_player_cook;
  1226. s_player_cook = -1;
  1227. player removeAction s_player_boil;
  1228. s_player_boil = -1;
  1229. player removeAction s_player_fireout;
  1230. s_player_fireout = -1;
  1231. player removeAction s_player_packtent;
  1232. s_player_packtent = -1;
  1233. player removeAction s_player_packtentinfected;
  1234. s_player_packtentinfected = -1;
  1235. player removeAction s_player_fillfuel;
  1236. s_player_fillfuel = -1;
  1237. player removeAction s_player_studybody;
  1238. s_player_studybody = -1;
  1239. //fuel
  1240. player removeAction s_player_fillfuel210;
  1241. s_player_fillfuel210 = -1;
  1242. player removeAction s_player_fillfuel20;
  1243. s_player_fillfuel20 = -1;
  1244. player removeAction s_player_fillfuel5;
  1245. s_player_fillfuel5 = -1;
  1246. //Allow player to siphon vehicle fuel
  1247. player removeAction s_player_siphonfuel;
  1248. s_player_siphonfuel = -1;
  1249. //Allow player to gather
  1250. player removeAction s_player_gather;
  1251. s_player_gather = -1;
  1252. player removeAction s_player_destroytent;
  1253. s_player_destroytent = -1;
  1254. // player removeAction s_player_attach_bomb;
  1255. // s_player_attach_bomb = -1;
  1256. //debug
  1257. //player removeAction s_player_debugCheck;
  1258. //s_player_debugCheck = -1;
  1259. player removeAction s_player_upgradestorage;
  1260. s_player_upgradestorage = -1;
  1261. /* //Unlock,Lock // Vanilla base building currently not used in Epoch
  1262. player removeAction s_player_setCode;
  1263. s_player_setCode = -1;
  1264. player removeAction s_player_lockhouse;
  1265. s_player_lockhouse = -1;
  1266. player removeAction s_player_unlockhouse;
  1267. s_player_unlockhouse = -1;
  1268. player removeAction s_player_openGate;
  1269. s_player_openGate = -1;
  1270. player removeAction s_player_CloseGate;
  1271. s_player_CloseGate = -1;
  1272. player removeAction s_player_breakinhouse;
  1273. s_player_breakinhouse = -1;
  1274. player removeAction s_player_BuildUnLock;
  1275. s_player_BuildUnLock = -1;
  1276. player removeAction s_player_BuildLock;
  1277. s_player_BuildLock = -1;*/
  1278. {player removeAction _x} count s_player_combi;s_player_combi = [];
  1279. s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  1280. {player removeAction _x} count s_player_parts;s_player_parts = [];
  1281. s_player_parts_crtl = -1;
  1282. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  1283. s_player_lockUnlock_crtl = -1;
  1284. player removeAction s_player_SurrenderedGear;
  1285. s_player_SurrenderedGear = -1;
  1286. player removeAction s_player_maintain_area;
  1287. s_player_maintain_area = -1;
  1288. player removeAction s_player_maintain_area_force;
  1289. s_player_maintain_area_force = -1;
  1290. player removeAction s_player_maintain_area_preview;
  1291. s_player_maintain_area_preview = -1;
  1292. player removeAction s_player_tamedog;
  1293. s_player_tamedog = -1;
  1294. player removeAction s_player_feeddog;
  1295. s_player_feeddog = -1;
  1296. player removeAction s_player_waterdog;
  1297. s_player_waterdog = -1;
  1298. player removeAction s_player_staydog;
  1299. s_player_staydog = -1;
  1300. player removeAction s_player_trackdog;
  1301. s_player_trackdog = -1;
  1302. player removeAction s_player_barkdog;
  1303. s_player_barkdog = -1;
  1304. player removeAction s_player_warndog;
  1305. s_player_warndog = -1;
  1306. player removeAction s_player_followdog;
  1307. s_player_followdog = -1;
  1308. player removeAction s_player_unlockvault;
  1309. s_player_unlockvault = -1;
  1310. player removeAction s_player_packvault;
  1311. s_player_packvault = -1;
  1312. player removeAction s_player_lockvault;
  1313. s_player_lockvault = -1;
  1314. player removeAction s_player_information;
  1315. s_player_information = -1;
  1316. player removeAction s_player_fillgen;
  1317. s_player_fillgen = -1;
  1318. player removeAction s_player_upgrade_build;
  1319. s_player_upgrade_build = -1;
  1320. player removeAction s_player_maint_build;
  1321. s_player_maint_build = -1;
  1322. player removeAction s_player_downgrade_build;
  1323. s_player_downgrade_build = -1;
  1324. player removeAction s_player_towing;
  1325. s_player_towing = -1;
  1326. player removeAction s_player_fuelauto;
  1327. s_player_fuelauto = -1;
  1328. player removeAction s_player_fuelauto2;
  1329. s_player_fuelauto2 = -1;
  1330. player removeAction s_player_manageDoor;
  1331. s_player_manageDoor = -1;
  1332. // Take Clothes by Zabn
  1333. player removeAction s_player_clothes;
  1334. s_player_clothes = -1;
  1335.  
  1336. // Custom below
  1337. player removeAction s_givemoney_dialog;
  1338. s_givemoney_dialog = -1;
  1339. player removeAction s_bank_dialog;
  1340. s_bank_dialog = -1;
  1341. player removeAction s_bank_dialog1;
  1342. s_bank_dialog1 = -1;
  1343. player removeAction s_bank_dialog2;
  1344. s_bank_dialog2 = -1;
  1345. player removeAction s_player_checkWallet;
  1346. s_player_checkWallet = -1;
  1347. player removeAction s_player_copyToKey;
  1348. s_player_copyToKey = -1;
  1349. player removeAction s_player_claimVehicle;
  1350. s_player_claimVehicle = -1;
  1351. player removeAction s_collect_heli;
  1352. s_collect_heli = -1;
  1353. player removeAction s_player_bury_human;
  1354. s_player_bury_human = -1;
  1355. player removeAction s_player_butcher_human;
  1356. s_player_butcher_human = -1;
  1357. player removeAction s_changing_room;
  1358. s_changing_room = -1;
  1359. player removeAction s_garage_dialog;
  1360. s_garage_dialog = -1;
  1361. player removeAction s_player_def;
  1362. s_player_def = -1;
  1363.  
  1364. };
  1365.  
  1366. //Dog actions on player self
  1367. if (_dogHandle > 0) then {
  1368. _dog = _dogHandle getFSMVariable "_dog";
  1369. if (isNil "_dog") exitWith {};
  1370. if (isNil "_ownerID") then {_ownerID = "0"};
  1371. if (_canDo && !_inVehicle && alive _dog && !(_ownerID in [dayz_characterID,_uid])) then {
  1372. if (s_player_movedog < 0) then {
  1373. s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID",0], 1, false, true];
  1374. };
  1375. if (s_player_speeddog < 0) then {
  1376. _text = localize "str_epoch_player_249";
  1377. _speed = 0;
  1378. if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = localize "str_epoch_player_250"; };
  1379. 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];
  1380. };
  1381. if (s_player_calldog < 0) then {
  1382. 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];
  1383. };
  1384. };
  1385. } else {
  1386. player removeAction s_player_movedog;
  1387. s_player_movedog = -1;
  1388. player removeAction s_player_speeddog;
  1389. s_player_speeddog = -1;
  1390. player removeAction s_player_calldog;
  1391. s_player_calldog = -1;
  1392. };
  1393.  
  1394. //Monitor
  1395. player setVariable ["selfActions", diag_ticktime, false];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement