Advertisement
TBsThug

fn_selfActions.sqf

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