Advertisement
Guest User

Untitled

a guest
Feb 4th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.75 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 ["_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_isModularDoor","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached"];
  8.  
  9. if (DZE_ActionInProgress) exitWith {};
  10.  
  11. _vehicle = vehicle player;
  12. _isPZombie = player isKindOf "PZombie_VB";
  13. _inVehicle = (_vehicle != player);
  14. _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  15. _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
  16. _nearLight = nearestObject [player,"LitObject"];
  17. _canPickLight = false;
  18.  
  19. if (!isNull _nearLight) then {
  20. if (_nearLight distance player < 4) then {
  21. _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
  22. };
  23. };
  24.  
  25. //Grab Flare
  26. if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
  27. if (s_player_grabflare < 0) then {
  28. _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
  29. s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
  30. s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
  31. };
  32. } else {
  33. player removeAction s_player_grabflare;
  34. player removeAction s_player_removeflare;
  35. s_player_grabflare = -1;
  36. s_player_removeflare = -1;
  37. };
  38.  
  39. if (DZE_HeliLift) then {
  40. _hasAttached = _vehicle getVariable["hasAttached",false];
  41. if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) < 30) && (speed _vehicle < 5) && (typeName _hasAttached == "OBJECT")) then {
  42. if (s_player_heli_detach < 0) then {
  43. dayz_myLiftVehicle = _vehicle;
  44. s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""];
  45. };
  46. } else {
  47. dayz_myLiftVehicle removeAction s_player_heli_detach;
  48. s_player_heli_detach = -1;
  49. };
  50. };
  51.  
  52. if(DZE_HaloJump) then {
  53. if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) > 400)) then {
  54. if (s_halo_action < 0) then {
  55. DZE_myHaloVehicle = _vehicle;
  56. s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""];
  57. };
  58. } else {
  59. DZE_myHaloVehicle removeAction s_halo_action;
  60. s_halo_action = -1;
  61. };
  62. };
  63.  
  64. if (!DZE_ForceNameTagsOff) then {
  65. if (s_player_showname < 0 && !_isPZombie) then {
  66. if (DZE_ForceNameTags) then {
  67. s_player_showname = 1;
  68. player setVariable["DZE_display_name",true,true];
  69. } else {
  70. s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false, "",""];
  71. s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false, "",""];
  72. };
  73. };
  74. };
  75.  
  76. if(DZE_Origins_Building_System) then {
  77. if(isnil "s_player_build_origins_house") then {s_player_build_origins_house = -1;};
  78. if(isnil "s_player_build_origins_garage") then {s_player_build_origins_garage = -1;};
  79. if(isnil "s_player_build_origins_stronghold") then {s_player_build_origins_stronghold = -1;};
  80. if(isnil "s_player_origins_unlock") then {s_player_origins_unlock = -1;};
  81. if(isnil "s_player_origins_stronghold_doors") then {s_player_origins_stronghold_doors = -1;};
  82. _cursorTarget = cursorTarget;
  83. if (!isNull _cursorTarget) then {
  84. _typeOfCursorTarget = (typeOf _cursorTarget);
  85. if(_typeOfCursorTarget == DZE_Origins_Container ) then {
  86. if((player distance _cursorTarget) < DZE_Origins_Build_Distance) then {
  87. private["_humanity","_playerUID","_hasLevel1","_hasLevel2","_hasLevel3","_hasSG","_hasLG","_hasKING","_hasSH","_canBuildHouse","_houselevel","_humanityNeed","_actionText","_classname","_neededMaterials","_canBuildSH","_canBuildGarage"];
  88. _humanity = player getVariable["humanity",0];
  89. _playerUID = dayz_playerUID;
  90. _hasLevel1 = (_playerUID in owner_H1 || _playerUID in owner_B1);
  91. _hasLevel2 = (_playerUID in owner_H2 || _playerUID in owner_B2);
  92. _hasLevel3 = (_playerUID in owner_H3 || _playerUID in owner_B3);
  93. _hasSG = (_playerUID in owner_SG);
  94. _hasLG = (_playerUID in owner_LG);
  95. _hasKING = (_playerUID in owner_KING);
  96. _hasSH = (_playerUID in owner_SH);
  97.  
  98. {
  99. _houselevel = _x select 0;
  100. _humanityNeed = _x select 1;
  101. _actionText = _x select 2;
  102. _classname = _x select 3;
  103. _neededMaterials = _x select 4;
  104. _canBuildHouse = false;
  105. _canBuildGarage = false;
  106. _canBuildSH = false;
  107.  
  108. if((_humanityNeed > 0 && _humanity >= _humanityNeed) || (_humanityNeed < 0 && _humanity <= _humanityNeed)) then {
  109. if(_houselevel in ["H1","B1"] && !_hasLevel1) then {
  110. _canBuildHouse = true;
  111. };
  112. if(_houselevel in ["H2","B2"] && !_hasLevel2) then {
  113. _canBuildHouse = true;
  114. };
  115. if(_houselevel in ["H3","B3"] && !_hasLevel3) then {
  116. _canBuildHouse = true;
  117. };
  118. if(_houselevel in ["SGH","SGB"] && _hasLevel1 && !_hasSG) then {
  119. _canBuildGarage = true;
  120. };
  121. if(_houselevel in ["LGH","LGB"] && _hasLevel3 && !_hasLG) then {
  122. _canBuildGarage = true;
  123. };
  124. if(_houselevel in ["KINGH","KINGB"] && _hasLevel3 && _hasLG && !_hasKING) then {
  125. _canBuildGarage = true;
  126. };
  127. if(_houselevel in ["SHH","SHB"] && _hasLevel1 && _hasLevel2 && _hasLevel3 && !_hasSH) then {
  128. _canBuildSH = true;
  129. };
  130. };
  131.  
  132. if(_canBuildHouse) then {
  133. if(s_player_build_origins_house < 0) then {
  134. s_player_build_origins_house = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  135. };
  136. };
  137. if(_canBuildGarage) then {
  138. if(s_player_build_origins_garage < 0) then {
  139. s_player_build_origins_garage = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  140. };
  141. };
  142. if(_canBuildSH) then {
  143. if(s_player_build_origins_stronghold < 0) then {
  144. s_player_build_origins_stronghold = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  145. };
  146. };
  147.  
  148. } forEach DZE_Origins_Build_HousesGarages;
  149. } else {
  150. [1] call origins_removeActions;
  151. };
  152. };
  153.  
  154. if(_typeOfCursorTarget in DZE_Origins_Buildings && (player distance _cursorTarget) < DZE_Origins_LockUnlock_Distance) then {
  155. private["_ownerUID","_ownerName","_playerUID","_state","_openClose"];
  156. _playerUID = dayz_playerUID;
  157. _ownerUID = _cursorTarget getVariable ["OwnerUID","0"];
  158. _ownerName = _cursorTarget getVariable ["OwnerName","0"];
  159.  
  160. if(_playerUID != _ownerUID && !(_typeOfCursorTarget in DZE_Origins_Stronghold)) exitWith {
  161. cutText [format["This house was built by %1", _ownerName], "PLAIN DOWN",5];
  162. sleep 5;
  163. };
  164. _state = (_cursorTarget getVariable ["CanBeUpdated",false]);
  165. if(_typeOfCursorTarget in DZE_Origins_Stronghold && _state) then {
  166. private["_strongholdDoorsOpen"];
  167. _strongholdDoorsOpen = (_cursorTarget getVariable ["DoorsOpen",false]);
  168. if(_strongholdDoorsOpen) then {
  169. if(s_player_origins_stronghold_doors < 0) then {
  170. s_player_origins_stronghold_doors = player addAction [ "Close Doors","origins\origins_strongholdDoors.sqf",[_cursorTarget,0]];
  171. };
  172. } else {
  173. if(s_player_origins_stronghold_doors < 0)then {
  174. s_player_origins_stronghold_doors = player addAction [ "Open Doors","origins\origins_strongholdDoors.sqf",[_cursorTarget,1]];
  175. };
  176. };
  177. } else {
  178. [3] call origins_removeActions;
  179. };
  180.  
  181. if(s_player_origins_unlock < 0) then {
  182. _matched = false;
  183. {
  184. if(_typeOfCursorTarget == (_x select 0)) then {
  185. if(_state) then {
  186. _openClose = format["Lock %1", _X select 1];
  187. } else {
  188. _openClose = format["Unlock %1", _X select 1];
  189. };
  190. _matched = true;
  191. };
  192. if (_matched) exitWith {
  193. s_player_origins_unlock = player addAction [_openClose, "origins\player_lockUnlock.sqf", [_cursorTarget,_typeOfCursorTarget,_state]];
  194. };
  195. } count DZE_Origins_NameLookup;
  196. };
  197. } else {
  198. [2] call origins_removeActions;
  199. };
  200. } else {
  201. [0] call origins_removeActions;
  202. };
  203. };
  204.  
  205. if (_inVehicle and (_vehicle isKindOf "ori_submarine")) then {
  206. if (sub_up < 0) then {
  207. thesub = _vehicle;
  208. sub_down = thesub addAction ["Rise","origins\sub_down.sqf","",5,false,true];
  209. sub_up = thesub addAction ["Submerge","origins\sub_up.sqf","",5,false,true];
  210. };
  211. } else {
  212. thesub removeAction sub_up;
  213. sub_up = -1;
  214. thesub removeAction sub_down;
  215. sub_down = -1;
  216. };
  217.  
  218. if(_isPZombie) then {
  219. if (s_player_callzombies < 0) then {
  220. s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
  221. };
  222. if (DZE_PZATTACK) then {
  223. call pz_attack;
  224. DZE_PZATTACK = false;
  225. };
  226. if (s_player_pzombiesvision < 0) then {
  227. 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"];
  228. };
  229. if (!isNull cursorTarget && (player distance cursorTarget < 3)) then {
  230. _isAnimal = cursorTarget isKindOf "Animal";
  231. _isZombie = cursorTarget isKindOf "zZombie_base";
  232. _isHarvested = cursorTarget getVariable["meatHarvested",false];
  233. _isMan = cursorTarget isKindOf "Man";
  234. if (!alive cursorTarget && (_isAnimal || _isMan) && !_isZombie && !_isHarvested) then {
  235. if (s_player_pzombiesfeed < 0) then {
  236. s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""];
  237. };
  238. } else {
  239. player removeAction s_player_pzombiesfeed;
  240. s_player_pzombiesfeed = -1;
  241. };
  242. } else {
  243. player removeAction s_player_pzombiesfeed;
  244. s_player_pzombiesfeed = -1;
  245. };
  246. };
  247.  
  248. _allowedDistance = 4;
  249. _isAir = cursorTarget isKindOf "Air";
  250. _isShip = cursorTarget isKindOf "Ship";
  251.  
  252. if(_isAir || _isShip) then {
  253. _allowedDistance = 8;
  254. };
  255.  
  256. if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then { //Has some kind of target
  257.  
  258. _cursorTarget = cursorTarget;
  259. _typeOfCursorTarget = typeOf _cursorTarget;
  260. _isVehicle = _cursorTarget isKindOf "AllVehicles";
  261. _isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
  262. _isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
  263. _magazinesPlayer = magazines player;
  264. _hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
  265. _hastinitem = false;
  266.  
  267. {
  268. if (_x in _magazinesPlayer) then {
  269. _hastinitem = true;
  270. };
  271. } count boil_tin_cans;
  272.  
  273. _hasFuelE = "ItemJerrycanEmpty" in _magazinesPlayer;
  274. _hasFuelBarrelE = "ItemFuelBarrelEmpty" in _magazinesPlayer;
  275. _hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
  276. _itemsPlayer = items player;
  277. _temp_keys = [];
  278. _temp_keys_names = [];
  279. _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
  280.  
  281. {
  282. if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
  283. _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
  284. _ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
  285. _temp_keys_names set [_ownerKeyId,_ownerKeyName];
  286. _temp_keys set [count _temp_keys,str(_ownerKeyId)];
  287. };
  288. } count _itemsPlayer;
  289.  
  290. _hasKnife = "ItemKnife" in _itemsPlayer;
  291. _hasToolbox = "ItemToolbox" in _itemsPlayer;
  292. _isMan = _cursorTarget isKindOf "Man";
  293. _traderType = _typeOfCursorTarget;
  294. _ownerID = _cursorTarget getVariable ["CharacterID","0"];
  295. _isAnimal = _cursorTarget isKindOf "Animal";
  296. _isDog = (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
  297. _isZombie = _cursorTarget isKindOf "zZombie_base";
  298. _isDestructable = _cursorTarget isKindOf "BuiltItems";
  299. _isWreck = _typeOfCursorTarget in DZE_isWreck;
  300. _isWreckBuilding = _typeOfCursorTarget in DZE_isWreckBuilding;
  301. _isModular = _cursorTarget isKindOf "ModularItems";
  302. _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
  303. _isRemovable = _typeOfCursorTarget in DZE_isRemovable;
  304. _isDisallowRepair = _typeOfCursorTarget in ["M240Nest_DZ"];
  305. _isTent = _cursorTarget isKindOf "TentStorage";
  306. _isAlive = alive _cursorTarget;
  307. _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  308. _rawmeat = meatraw;
  309. _hasRawMeat = false;
  310.  
  311. {
  312. if (_x in _magazinesPlayer) then {
  313. _hasRawMeat = true;
  314. };
  315. } count _rawmeat;
  316.  
  317. _isFuel = false;
  318.  
  319. if (_hasFuelE || _hasFuelBarrelE) then {
  320. {
  321. if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
  322. } count dayz_fuelsources;
  323. };
  324.  
  325. _player_flipveh = false;
  326. _player_deleteBuild = false;
  327. _player_lockUnlock_crtl = false;
  328.  
  329. if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
  330. if (s_player_maintain_area < 0) then {
  331. s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "EpochMods\Compiles\maintain_area.sqf", "maintain", 5, false];
  332. s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "EpochMods\Compiles\maintain_area.sqf", "preview", 5, false];
  333. };
  334. } else {
  335. player removeAction s_player_maintain_area;
  336. s_player_maintain_area = -1;
  337. player removeAction s_player_maintain_area_preview;
  338. s_player_maintain_area_preview = -1;
  339. };
  340.  
  341. if(_isAlive) then {
  342.  
  343. if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
  344. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  345. _player_deleteBuild = true;
  346. };
  347. };
  348.  
  349. if(_isModular && (dayz_characterID == _ownerID)) then {
  350. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  351. _player_deleteBuild = true;
  352. };
  353. };
  354.  
  355. if(_isModularDoor && (dayz_characterID == _ownerID)) then {
  356. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  357. _player_deleteBuild = true;
  358. };
  359. };
  360.  
  361. if(_isVehicle) then {
  362.  
  363. if (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (count (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) select 2) < 0.5) then {
  364. _playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
  365. if(_isVehicletype || (_playersNear >= 2)) then {
  366. _player_flipveh = true;
  367. };
  368. };
  369.  
  370. if(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) then {
  371. _player_lockUnlock_crtl = true;
  372. };
  373. };
  374. };
  375.  
  376. if(_player_deleteBuild) then {
  377. if (s_player_deleteBuild < 0) then {
  378. s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  379. };
  380. } else {
  381. player removeAction s_player_deleteBuild;
  382. s_player_deleteBuild = -1;
  383. };
  384.  
  385. if (DZE_HeliLift) then {
  386.  
  387. _liftHeli = objNull;
  388. _found = false;
  389. _allowTow = false;
  390.  
  391. if ((count (crew _cursorTarget)) == 0) then {
  392. {
  393. if(!_allowTow) then {
  394. _allowTow = _cursorTarget isKindOf _x;
  395. };
  396. } count DZE_HeliAllowToTow;
  397. };
  398.  
  399. if (_allowTow) then {
  400. _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
  401. {
  402. if(!_found) then {
  403. _posL = [_x] call FNC_getPos;
  404. _posC = [_cursorTarget] call FNC_getPos;
  405. _height = (_posL select 2) - (_posC select 2);
  406. _hasAttached = _x getVariable["hasAttached",false];
  407. if(_height < 15 && _height > 5 && (typeName _hasAttached != "OBJECT")) then {
  408. if(((abs((_posL select 0) - (_posC select 0))) < 10) && ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
  409. _liftHeli = _x;
  410. _found = true;
  411. };
  412. };
  413. };
  414. } count _liftHelis;
  415. };
  416.  
  417. _attached = _cursorTarget getVariable["attached",false];
  418.  
  419.  
  420. if(_found && _allowTow && _canDo && !locked _cursorTarget && !_isPZombie && (typeName _attached != "OBJECT")) then {
  421. if (s_player_heli_lift < 0) then {
  422. s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true, "",""];
  423. };
  424. } else {
  425. player removeAction s_player_heli_lift;
  426. s_player_heli_lift = -1;
  427. };
  428. };
  429.  
  430. if(_player_lockUnlock_crtl) then {
  431. if (s_player_lockUnlock_crtl < 0) then {
  432. _hasKey = _ownerID in _temp_keys;
  433. _oldOwner = (_ownerID == dayz_playerUID);
  434. if(locked _cursorTarget) then {
  435. if(_hasKey || _oldOwner) then {
  436. _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (parseNumber _ownerID))], 2, true, true, "", ""];
  437. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  438. s_player_lockUnlock_crtl = 1;
  439. } else {
  440. if(_hasHotwireKit) then {
  441. _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
  442. } else {
  443. _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, true, true, "", ""];
  444. };
  445. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  446. s_player_lockUnlock_crtl = 1;
  447. };
  448. } else {
  449. if(_hasKey || _oldOwner) then {
  450. _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
  451. s_player_lockunlock set [count s_player_lockunlock,_lock];
  452. s_player_lockUnlock_crtl = 1;
  453. };
  454. };
  455. };
  456. } else {
  457. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  458. s_player_lockUnlock_crtl = -1;
  459. };
  460.  
  461. if(DZE_AllowForceSave) then {
  462.  
  463. if((_isVehicle || _isTent) && !_isMan) then {
  464. if (s_player_forceSave < 0) then {
  465. s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
  466. };
  467. } else {
  468. player removeAction s_player_forceSave;
  469. s_player_forceSave = -1;
  470. };
  471. };
  472.  
  473.  
  474.  
  475. if(DZE_AllowCargoCheck) then {
  476. if((_isVehicle || _isTent || _isnewstorage || _typeOfCursorTarget in DZE_Origins_Buildings) && _isAlive && !_isMan && !locked _cursorTarget) then {
  477. if (s_player_checkGear < 0) then {
  478. s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""];
  479. };
  480. } else {
  481. player removeAction s_player_checkGear;
  482. s_player_checkGear = -1;
  483. };
  484. };
  485.  
  486. if(_player_flipveh) then {
  487. if (s_player_flipveh < 0) then {
  488. s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];
  489. };
  490. } else {
  491. player removeAction s_player_flipveh;
  492. s_player_flipveh = -1;
  493. };
  494.  
  495. if((_hasFuelE || _hasFuelBarrelE) && _isFuel) then {
  496. if (s_player_fillfuel < 0) then {
  497. s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
  498. };
  499. } else {
  500. player removeAction s_player_fillfuel;
  501. s_player_fillfuel = -1;
  502. };
  503.  
  504. _player_butcher = false;
  505. _player_studybody = false;
  506. _player_SurrenderedGear = false;
  507.  
  508. if (!_isAlive) then {
  509.  
  510. if((_isAnimal || _isZombie) && _hasKnife) then {
  511. _isHarvested = _cursorTarget getVariable["meatHarvested",false];
  512. if (!_isHarvested) then {
  513. _player_butcher = true;
  514. };
  515. };
  516.  
  517. if (_isMan && !_isZombie && !_isAnimal) then {
  518. _player_studybody = true;
  519. }
  520. } else {
  521.  
  522.  
  523. if(_isMan && !_isZombie && !_isAnimal) then {
  524. _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",false];
  525. if (_isSurrendered) then {
  526. _player_SurrenderedGear = true;
  527. };
  528. };
  529. };
  530.  
  531. if (_player_butcher) then {
  532. if (s_player_butcher < 0) then {
  533. if(_isZombie) then {
  534. s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, true, true, "", ""];
  535. } else {
  536. s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
  537. };
  538. };
  539. } else {
  540. player removeAction s_player_butcher;
  541. s_player_butcher = -1;
  542. };
  543.  
  544. if (_player_studybody) then {
  545. if (s_player_studybody < 0) then {
  546. s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "EpochMods\Actions\check_wallet.sqf",_cursorTarget, 0, false, true, "",""];
  547. };
  548. } else {
  549. player removeAction s_player_studybody;
  550. s_player_studybody = -1;
  551. };
  552.  
  553. _player_cook = false;
  554. _player_boil = false;
  555.  
  556. if (inflamed _cursorTarget) then {
  557.  
  558. if (_hasRawMeat) then {
  559. _player_cook = true;
  560. };
  561.  
  562. if (_hasbottleitem && _hastinitem) then {
  563. _player_boil = true;
  564. };
  565. };
  566.  
  567. if (_player_SurrenderedGear) then {
  568. if (s_player_SurrenderedGear < 0) then {
  569. s_player_SurrenderedGear = player addAction [localize "STR_EPOCH_ACTIONS_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true, "", ""];
  570. };
  571. } else {
  572. player removeAction s_player_SurrenderedGear;
  573. s_player_SurrenderedGear = -1;
  574. };
  575.  
  576. if (_player_cook) then {
  577. if (s_player_cook < 0) then {
  578. s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""];
  579. };
  580. } else {
  581. player removeAction s_player_cook;
  582. s_player_cook = -1;
  583. };
  584.  
  585. if (_player_boil) then {
  586. if (s_player_boil < 0) then {
  587. s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""];
  588. };
  589. } else {
  590. player removeAction s_player_boil;
  591. s_player_boil = -1;
  592. };
  593.  
  594. if(_cursorTarget == dayz_hasFire) then {
  595. if ((s_player_fireout < 0) && !(inflamed _cursorTarget) && (player distance _cursorTarget < 3)) then {
  596. s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true, "",""];
  597. };
  598. } else {
  599. player removeAction s_player_fireout;
  600. s_player_fireout = -1;
  601. };
  602.  
  603. if(_isTent && (player distance _cursorTarget < 3)) then {
  604. if (_ownerID == dayz_characterID) then {
  605. if (s_player_packtent < 0) then {
  606. s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""];
  607. };
  608. } else {
  609. if(("ItemJerrycan" in _magazinesPlayer) && ("ItemMatchbox_DZE" in weapons player)) then {
  610. if (s_player_packtent < 0) then {
  611. s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  612. };
  613. };
  614. };
  615. } else {
  616. player removeAction s_player_packtent;
  617. s_player_packtent = -1;
  618. };
  619.  
  620. if((_typeOfCursorTarget in DZE_LockableStorage) && _ownerID != "0" && (player distance _cursorTarget < 3)) then {
  621. if (s_player_unlockvault < 0) then {
  622. if(_typeOfCursorTarget in DZE_LockedStorage) then {
  623. if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then {
  624. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
  625. s_player_combi set [count s_player_combi,_combi];
  626. } else {
  627. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  628. s_player_combi set [count s_player_combi,_combi];
  629. };
  630. s_player_unlockvault = 1;
  631. } else {
  632. if(_ownerID != dayz_combination && _ownerID != dayz_playerUID) then {
  633. _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  634. s_player_combi set [count s_player_combi,_combi];
  635. s_player_unlockvault = 1;
  636. };
  637. };
  638. };
  639. } else {
  640. {player removeAction _x} count s_player_combi;s_player_combi = [];
  641. s_player_unlockvault = -1;
  642. };
  643.  
  644. if(_typeOfCursorTarget in ZSC_MoneyStorage && (player distance _cursorTarget < 5)) then {
  645. if (s_bank_dialog < 0) then {
  646. s_bank_dialog = player addAction ["Money Storage", "EpochMods\Actions\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  647. };
  648. } else {
  649. player removeAction s_bank_dialog;
  650. s_bank_dialog = -1;
  651. };
  652.  
  653. // cars
  654. if( _isVehicle && !_isMan &&_isAlive && !_isMan && !locked _cursorTarget && !(_cursorTarget isKindOf "Bicycle") && (player distance _cursorTarget < 5)) then {
  655. if (s_bank_dialog2 < 0) then {
  656. s_bank_dialog2 = player addAction ["Money Storage", "EpochMods\Actions\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  657. };
  658. } else {
  659. player removeAction s_bank_dialog2;
  660. s_bank_dialog2 = -1;
  661. };
  662.  
  663. if(_typeOfCursorTarget in Fast_Med and (player distance _cursorTarget < 3)) then {
  664. if (s_fast_med_dialog1 < 0) then {
  665. s_fast_med_dialog1 = player addAction ["<t color='#0059FF'>Pay for treatment</t>", "EpochMods\Money\Medical\FastMed.sqf",_cursorTarget, 3, true, true, "", ""];
  666. };
  667. } else {
  668. player removeAction s_fast_med_dialog1;
  669. s_fast_med_dialog1 = -1;
  670. };
  671.  
  672.  
  673. if(_typeOfCursorTarget in DZE_UnLockedStorage && _ownerID != "0" && (player distance _cursorTarget < 3)) then {
  674.  
  675. if (s_player_lockvault < 0) then {
  676. if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then {
  677. s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true, "",""];
  678. };
  679. };
  680. if (s_player_packvault < 0 && (_ownerID == dayz_combination || _ownerID == dayz_playerUID)) then {
  681. 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, "",""];
  682. };
  683.  
  684. } else {
  685. player removeAction s_player_packvault;
  686. s_player_packvault = -1;
  687. player removeAction s_player_lockvault;
  688. s_player_lockvault = -1;
  689. };
  690.  
  691. if(_typeOfCursorTarget == "Info_Board_EP1") then {
  692. if (s_player_information < 0) then {
  693. s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true, "",""];
  694. };
  695. } else {
  696. player removeAction s_player_information;
  697. s_player_information = -1;
  698. };
  699.  
  700. if (_isMan and _isAlive and !_isZombie and !_isAnimal and !(_traderType in serverTraders)) then {
  701. if (s_givemoney_dialog < 0) then {
  702. s_givemoney_dialog = player addAction [format["Give Money to %1", (name _cursorTarget)], "EpochMods\Actions\give_player_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  703. };
  704. } else {
  705. player removeAction s_givemoney_dialog;
  706. s_givemoney_dialog = -1;
  707. };
  708.  
  709. if(_typeOfCursorTarget in dayz_fuelpumparray) then {
  710. if (s_player_fuelauto < 0) then {
  711.  
  712. _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
  713. _findNearestGen = [];
  714. {
  715. if (alive _x && (_x getVariable ["GeneratorRunning", false])) then {
  716. _findNearestGen set [(count _findNearestGen),_x];
  717. };
  718. } count _findNearestGens;
  719. _IsNearRunningGen = count (_findNearestGen);
  720.  
  721. if(_IsNearRunningGen > 0) then {
  722. s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true, "",""];
  723. } else {
  724. s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  725. };
  726. };
  727. } else {
  728. player removeAction s_player_fuelauto;
  729. s_player_fuelauto = -1;
  730. };
  731.  
  732. if(_typeOfCursorTarget in DZE_fueltruckarray && alive _cursorTarget) then {
  733. if (s_player_fuelauto2 < 0) then {
  734. if(isEngineOn _cursorTarget) then {
  735. s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true, "",""];
  736. } else {
  737. s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  738. };
  739. };
  740. } else {
  741. player removeAction s_player_fuelauto2;
  742. s_player_fuelauto2 = -1;
  743. };
  744.  
  745. if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
  746. if ((s_player_lastTarget select 0) != _cursorTarget) then {
  747. if (s_player_upgrade_build > 0) then {
  748. player removeAction s_player_upgrade_build;
  749. s_player_upgrade_build = -1;
  750. };
  751. };
  752. if (s_player_upgrade_build < 0) then {
  753. s_player_lastTarget set [0,_cursorTarget];
  754. s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "EpochMods\BuildVectors\action\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true, "",""];
  755. };
  756. } else {
  757. player removeAction s_player_upgrade_build;
  758. s_player_upgrade_build = -1;
  759. };
  760.  
  761. if((_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") && (DZE_Lock_Door == _ownerID)) then {
  762. if ((s_player_lastTarget select 1) != _cursorTarget) then {
  763. if (s_player_downgrade_build > 0) then {
  764. player removeAction s_player_downgrade_build;
  765. s_player_downgrade_build = -1;
  766. };
  767. };
  768. if (s_player_downgrade_build < 0) then {
  769. s_player_lastTarget set [1,_cursorTarget];
  770. s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "EpochMods\BuildVectors\action\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true, "",""];
  771. };
  772. } else {
  773. player removeAction s_player_downgrade_build;
  774. s_player_downgrade_build = -1;
  775. };
  776.  
  777. if((_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ") && (damage _cursorTarget >= DZE_DamageBeforeMaint)) then {
  778. if ((s_player_lastTarget select 2) != _cursorTarget) then {
  779. if (s_player_maint_build > 0) then {
  780. player removeAction s_player_maint_build;
  781. s_player_maint_build = -1;
  782. };
  783. };
  784. if (s_player_maint_build < 0) then {
  785. s_player_lastTarget set [2,_cursorTarget];
  786. s_player_maint_build = player addAction [format[localize "STR_EPOCH_ACTIONS_MAINTAIN",_text], "\z\addons\dayz_code\actions\player_buildingMaint.sqf",_cursorTarget, -2, false, true, "",""];
  787. };
  788. } else {
  789. player removeAction s_player_maint_build;
  790. s_player_maint_build = -1;
  791. };
  792.  
  793. if(_cursorTarget isKindOf "Generator_DZ") then {
  794. if (s_player_fillgen < 0) then {
  795.  
  796. if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
  797. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  798. } else {
  799. if((_cursorTarget getVariable ["GeneratorFilled", false])) then {
  800. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  801. } else {
  802. if("ItemJerrycan" in _magazinesPlayer) then {
  803. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  804. };
  805. };
  806. };
  807. };
  808. } else {
  809. player removeAction s_player_fillgen;
  810. s_player_fillgen = -1;
  811. };
  812.  
  813. if(_isTent && _ownerID == dayz_characterID) then {
  814. if ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) then {
  815. s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
  816. };
  817. } else {
  818. player removeAction s_player_sleep;
  819. s_player_sleep = -1;
  820. };
  821.  
  822. if ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) then {
  823. if (s_player_repair_crtl < 0) then {
  824. dayz_myCursorTarget = _cursorTarget;
  825. _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  826. _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "EpochMods\Actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  827. s_player_repairActions set [count s_player_repairActions,_menu];
  828. s_player_repairActions set [count s_player_repairActions,_menu1];
  829. s_player_repair_crtl = 1;
  830. } else {
  831. {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  832. s_player_repair_crtl = -1;
  833. };
  834. };
  835.  
  836. if (_isMan && !_isPZombie && _traderType in serverTraders) then {
  837.  
  838. if (s_player_parts_crtl < 0) then {
  839.  
  840. _humanity = player getVariable ["humanity",0];
  841. _traderMenu = call compile format["menu_%1;",_traderType];
  842. _low_high = "low";
  843. _humanity_logic = false;
  844.  
  845. if((_traderMenu select 2) == "friendly") then {
  846. _humanity_logic = (_humanity < -5000);
  847. };
  848. if((_traderMenu select 2) == "hostile") then {
  849. _low_high = "high";
  850. _humanity_logic = (_humanity > -5000);
  851. };
  852. if((_traderMenu select 2) == "hero") then {
  853. _humanity_logic = (_humanity < 5000);
  854. };
  855. if(_humanity_logic) then {
  856. _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
  857. s_player_parts set [count s_player_parts,_cancel];
  858. } else {
  859.  
  860. {
  861. //Advanced Trading
  862. _buyV = player addAction ["<t color='#0059FF'>Advanced Trading</t>", "EpochMods\Money\AdvancedTrading\ATinit.sqf",(_traderMenu select 0), 999, true, false, "",""];
  863. s_player_parts set [count s_player_parts,_buyV];
  864.  
  865. //Old Trading
  866. _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, "",""];
  867. s_player_parts set [count s_player_parts,_buy];
  868.  
  869. } count (_traderMenu select 1);
  870.  
  871. // Database menu
  872. _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  873. s_player_parts set [count s_player_parts,_buy];
  874.  
  875. };
  876. s_player_parts_crtl = 1;
  877. };
  878. } else {
  879. {player removeAction _x} count s_player_parts;s_player_parts = [];
  880. s_player_parts_crtl = -1;
  881. };
  882.  
  883. if(dayz_tameDogs) then {
  884.  
  885. if (_isDog && _isAlive && (_hasRawMeat) && _ownerID == "0" && player getVariable ["dogID", 0] == 0) then {
  886. if (s_player_tamedog < 0) then {
  887. s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""];
  888. };
  889. } else {
  890. player removeAction s_player_tamedog;
  891. s_player_tamedog = -1;
  892. };
  893.  
  894. if (_isDog && _ownerID == dayz_characterID && _isAlive) then {
  895. _dogHandle = player getVariable ["dogID", 0];
  896. if (s_player_feeddog < 0 && _hasRawMeat) then {
  897. s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""];
  898. };
  899. if (s_player_waterdog < 0 && "ItemWaterbottle" in _magazinesPlayer) then {
  900. s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""];
  901. };
  902. if (s_player_staydog < 0) then {
  903. _lieDown = _dogHandle getFSMVariable "_actionLieDown";
  904. if (_lieDown) then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  905. s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true,"",""];
  906. };
  907. if (s_player_trackdog < 0) then {
  908. s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true,"",""];
  909. };
  910. if (s_player_barkdog < 0) then {
  911. s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true,"",""];
  912. };
  913. if (s_player_warndog < 0) then {
  914. _warn = _dogHandle getFSMVariable "_watchDog";
  915. if (_warn) then { _text = (localize "str_epoch_player_247"); _warn = false; } else { _text = (localize "str_epoch_player_248"); _warn = true; };
  916. s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true,"",""];
  917. };
  918. if (s_player_followdog < 0) then {
  919. s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true,"",""];
  920. };
  921. } else {
  922. player removeAction s_player_feeddog;
  923. s_player_feeddog = -1;
  924. player removeAction s_player_waterdog;
  925. s_player_waterdog = -1;
  926. player removeAction s_player_staydog;
  927. s_player_staydog = -1;
  928. player removeAction s_player_trackdog;
  929. s_player_trackdog = -1;
  930. player removeAction s_player_barkdog;
  931. s_player_barkdog = -1;
  932. player removeAction s_player_warndog;
  933. s_player_warndog = -1;
  934. player removeAction s_player_followdog;
  935. s_player_followdog = -1;
  936. };
  937. };
  938.  
  939. } else {
  940.  
  941. {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  942. s_player_repair_crtl = -1;
  943. {player removeAction _x} count s_player_combi;s_player_combi = [];
  944. dayz_myCursorTarget = objNull;
  945. s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  946. {player removeAction _x} count s_player_parts;s_player_parts = [];
  947. s_player_parts_crtl = -1;
  948. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  949. s_player_lockUnlock_crtl = -1;
  950. player removeAction s_player_checkGear;
  951. s_player_checkGear = -1;
  952. player removeAction s_player_SurrenderedGear;
  953. s_player_SurrenderedGear = -1;
  954. player removeAction s_player_forceSave;
  955. s_player_forceSave = -1;
  956. player removeAction s_player_flipveh;
  957. s_player_flipveh = -1;
  958. player removeAction s_player_sleep;
  959. s_player_sleep = -1;
  960. player removeAction s_player_deleteBuild;
  961. s_player_deleteBuild = -1;
  962. player removeAction s_player_butcher;
  963. s_player_butcher = -1;
  964. player removeAction s_player_cook;
  965. s_player_cook = -1;
  966. player removeAction s_player_boil;
  967. s_player_boil = -1;
  968. player removeAction s_player_fireout;
  969. s_player_fireout = -1;
  970. player removeAction s_player_packtent;
  971. s_player_packtent = -1;
  972. player removeAction s_player_fillfuel;
  973. s_player_fillfuel = -1;
  974. player removeAction s_player_studybody;
  975. s_player_studybody = -1;
  976. player removeAction s_player_tamedog;
  977. s_player_tamedog = -1;
  978. player removeAction s_player_feeddog;
  979. s_player_feeddog = -1;
  980. player removeAction s_player_waterdog;
  981. s_player_waterdog = -1;
  982. player removeAction s_player_staydog;
  983. s_player_staydog = -1;
  984. player removeAction s_player_trackdog;
  985. s_player_trackdog = -1;
  986. player removeAction s_player_barkdog;
  987. s_player_barkdog = -1;
  988. player removeAction s_player_warndog;
  989. s_player_warndog = -1;
  990. player removeAction s_player_followdog;
  991. s_player_followdog = -1;
  992. player removeAction s_player_unlockvault;
  993. s_player_unlockvault = -1;
  994. player removeAction s_player_packvault;
  995. s_player_packvault = -1;
  996. player removeAction s_player_lockvault;
  997. s_player_lockvault = -1;
  998. player removeAction s_player_information;
  999. s_player_information = -1;
  1000. player removeAction s_player_fillgen;
  1001. s_player_fillgen = -1;
  1002. player removeAction s_player_upgrade_build;
  1003. s_player_upgrade_build = -1;
  1004. player removeAction s_player_maint_build;
  1005. s_player_maint_build = -1;
  1006. player removeAction s_player_downgrade_build;
  1007. s_player_downgrade_build = -1;
  1008. player removeAction s_player_towing;
  1009. s_player_towing = -1;
  1010. player removeAction s_player_fuelauto;
  1011. s_player_fuelauto = -1;
  1012. player removeAction s_player_fuelauto2;
  1013. s_player_fuelauto2 = -1;
  1014. player removeAction s_givemoney_dialog;
  1015. s_givemoney_dialog = -1;
  1016. player removeAction s_bank_dialog;
  1017. s_bank_dialog = -1;
  1018. player removeAction s_bank_dialog2;
  1019. s_bank_dialog2 = -1;
  1020. player removeAction s_player_packOBJ;
  1021. s_player_packOBJ = -1;
  1022.  
  1023. player removeAction s_fast_med_dialog1;
  1024. s_fast_med_dialog1 = -1;
  1025. };
  1026.  
  1027.  
  1028. // MF-Tow Script by Matt Fairbrass (matt_d_rat)
  1029. call compile preprocessFileLineNumbers 'mods\mf-tow\init.sqf';
  1030.  
  1031. _dogHandle = player getVariable ["dogID", 0];
  1032.  
  1033.  
  1034. if (_dogHandle > 0) then {
  1035. _dog = _dogHandle getFSMVariable "_dog";
  1036. _ownerID = "0";
  1037. if (!isNull cursorTarget) then { _ownerID = cursorTarget getVariable ["CharacterID","0"]; };
  1038. if (_canDo && !_inVehicle && alive _dog && _ownerID != dayz_characterID) then {
  1039. if (s_player_movedog < 0) then {
  1040. s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, false, true, "", ""];
  1041. };
  1042. if (s_player_speeddog < 0) then {
  1043. _text = (localize "str_epoch_player_249");
  1044. _speed = 0;
  1045. if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = (localize "str_epoch_player_250"); };
  1046. 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, "", ""];
  1047. };
  1048. if (s_player_calldog < 0) then {
  1049. 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, "", ""];
  1050. };
  1051. };
  1052. } else {
  1053. player removeAction s_player_movedog;
  1054. s_player_movedog = -1;
  1055. player removeAction s_player_speeddog;
  1056. s_player_speeddog = -1;
  1057. player removeAction s_player_calldog;
  1058. s_player_calldog = -1;
  1059. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement