Advertisement
Guest User

Untitled

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