Advertisement
Guest User

fn_selfActions.sqf

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