Advertisement
Guest User

Untitled

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