deejay1979

Untitled

Jun 4th, 2014
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.62 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","_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 and !r_player_unconscious and !_onLadder);
  17.  
  18. ///////////////////////////////////////////////////////////////////////////
  19. //Self Bloodbag by Krixes and Co
  20. _mags = magazines player;
  21.  
  22. // Krixes Self Bloodbag
  23. if ("ItemBloodbag" in _mags) then {
  24. hasBagItem = true;
  25. } else { hasBagItem = false;};
  26.  
  27. if((speed player <= 1) && hasBagItem && _canDo) then {
  28. if (s_player_selfBloodbag < 0) then {
  29. s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"custom\player_selfbloodbag.sqf","",5,false,true,"", ""];
  30. };
  31. } else {
  32. player removeAction s_player_selfBloodbag;
  33. s_player_selfBloodbag = -1;
  34. };
  35.  
  36. _nearLight = nearestObject [player,"LitObject"];
  37. _canPickLight = false;
  38. if (!isNull _nearLight) then {
  39. if (_nearLight distance player < 4) then {
  40. _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
  41. };
  42. };
  43.  
  44. //Grab Flare
  45. if (_canPickLight and !dayz_hasLight and !_isPZombie) then {
  46. if (s_player_grabflare < 0) then {
  47. _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
  48. s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
  49. s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
  50. };
  51. } else {
  52. player removeAction s_player_grabflare;
  53. player removeAction s_player_removeflare;
  54. s_player_grabflare = -1;
  55. s_player_removeflare = -1;
  56. };
  57.  
  58. if (DZE_HeliLift) then {
  59. _hasAttached = _vehicle getVariable["hasAttached",false];
  60. if(_inVehicle and (_vehicle isKindOf "Air") and ((getPos _vehicle select 2) < 30) and (speed _vehicle < 5) and (typeName _hasAttached == "OBJECT")) then {
  61. if (s_player_heli_detach < 0) then {
  62. dayz_myLiftVehicle = _vehicle;
  63. s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""];
  64. };
  65. } else {
  66. dayz_myLiftVehicle removeAction s_player_heli_detach;
  67. s_player_heli_detach = -1;
  68. };
  69. };
  70.  
  71. if(DZE_HaloJump) then {
  72. if(_inVehicle and (_vehicle isKindOf "Air") and ((getPos _vehicle select 2) > 400)) then {
  73. if (s_halo_action < 0) then {
  74. DZE_myHaloVehicle = _vehicle;
  75. s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""];
  76. };
  77. } else {
  78. DZE_myHaloVehicle removeAction s_halo_action;
  79. s_halo_action = -1;
  80. };
  81. };
  82.  
  83. if (!DZE_ForceNameTagsOff) then {
  84. if (s_player_showname < 0 and !_isPZombie) then {
  85. if (DZE_ForceNameTags) then {
  86. s_player_showname = 1;
  87. player setVariable["DZE_display_name",true,true];
  88. } else {
  89. s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false, "",""];
  90. s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false, "",""];
  91. };
  92. };
  93. };
  94.  
  95. if(_isPZombie) then {
  96. if (s_player_callzombies < 0) then {
  97. s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
  98. };
  99. if (DZE_PZATTACK) then {
  100. call pz_attack;
  101. DZE_PZATTACK = false;
  102. };
  103. if (s_player_pzombiesvision < 0) then {
  104. 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"];
  105. };
  106. if (!isNull cursorTarget and (player distance cursorTarget < 3)) then { //Has some kind of target
  107. _isAnimal = cursorTarget isKindOf "Animal";
  108. _isZombie = cursorTarget isKindOf "zZombie_base";
  109. _isHarvested = cursorTarget getVariable["meatHarvested",false];
  110. _isMan = cursorTarget isKindOf "Man";
  111. // Pzombie Gut human corpse or animal
  112. if (!alive cursorTarget and (_isAnimal or _isMan) and !_isZombie and !_isHarvested) then {
  113. if (s_player_pzombiesfeed < 0) then {
  114. s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""];
  115. };
  116. } else {
  117. player removeAction s_player_pzombiesfeed;
  118. s_player_pzombiesfeed = -1;
  119. };
  120. } else {
  121. player removeAction s_player_pzombiesfeed;
  122. s_player_pzombiesfeed = -1;
  123. };
  124. };
  125.  
  126. // Increase distance only if AIR OR SHIP
  127. _allowedDistance = 4;
  128. _isAir = cursorTarget isKindOf "Air";
  129. _isShip = cursorTarget isKindOf "Ship";
  130. if(_isAir or _isShip) then {
  131. _allowedDistance = 8;
  132. };
  133.  
  134. if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cursorTarget < _allowedDistance) and _canDo) then { //Has some kind of target
  135.  
  136. // set cursortarget to variable
  137. _cursorTarget = cursorTarget;
  138.  
  139. // get typeof cursortarget once
  140. _typeOfCursorTarget = typeOf _cursorTarget;
  141.  
  142. // hintsilent _typeOfCursorTarget;
  143.  
  144. _isVehicle = _cursorTarget isKindOf "AllVehicles";
  145. _isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
  146. _isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
  147.  
  148. // get items and magazines only once
  149. _magazinesPlayer = magazines player;
  150.  
  151. //boiled Water
  152. _hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
  153. _hastinitem = false;
  154. {
  155. if (_x in _magazinesPlayer) then {
  156. _hastinitem = true;
  157. };
  158. } forEach boil_tin_cans;
  159. _hasFuelE = "ItemJerrycanEmpty" in _magazinesPlayer;
  160. _hasFuelBarrelE = "ItemFuelBarrelEmpty" in _magazinesPlayer;
  161. _hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
  162. _hasETool = "ItemEtool" in items player;
  163. _itemsPlayer = items player;
  164.  
  165. _temp_keys = [];
  166. _temp_keys_names = [];
  167. // find available keys
  168. _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
  169. {
  170. if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
  171. _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
  172. _ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
  173. _temp_keys_names set [_ownerKeyId,_ownerKeyName];
  174. _temp_keys set [count _temp_keys,str(_ownerKeyId)];
  175. };
  176. } forEach _itemsPlayer;
  177.  
  178. _hasKnife = "ItemKnife" in _itemsPlayer;
  179. _hasToolbox = "ItemToolbox" in _itemsPlayer;
  180.  
  181. _isMan = _cursorTarget isKindOf "Man";
  182. _traderType = _typeOfCursorTarget;
  183. _ownerID = _cursorTarget getVariable ["CharacterID","0"];
  184. _isAnimal = _cursorTarget isKindOf "Animal";
  185. _isDog = (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
  186. _isZombie = _cursorTarget isKindOf "zZombie_base";
  187. _isDestructable = _cursorTarget isKindOf "BuiltItems";
  188. _isWreck = _typeOfCursorTarget in DZE_isWreck;
  189. _isWreckBuilding = _typeOfCursorTarget in DZE_isWreckBuilding;
  190. _isModular = _cursorTarget isKindOf "ModularItems";
  191.  
  192. _isRemovable = _typeOfCursorTarget in DZE_isRemovable;
  193. _isDisallowRepair = _typeOfCursorTarget in ["M240Nest_DZ"];
  194.  
  195. _isTent = _cursorTarget isKindOf "TentStorage";
  196.  
  197. _isAlive = alive _cursorTarget;
  198.  
  199. _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  200.  
  201. _rawmeat = meatraw;
  202. _hasRawMeat = false;
  203. {
  204. if (_x in _magazinesPlayer) then {
  205. _hasRawMeat = true;
  206. };
  207. } forEach _rawmeat;
  208.  
  209. _isFuel = false;
  210. if (_hasFuelE or _hasFuelBarrelE) then {
  211. {
  212. if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
  213. } forEach dayz_fuelsources;
  214. };
  215.  
  216. // diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID));
  217.  
  218. // logic vars
  219. _player_flipveh = false;
  220. _player_deleteBuild = false;
  221. _player_lockUnlock_crtl = false;
  222.  
  223. if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
  224. if (s_player_maintain_area < 0) then {
  225. 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];
  226. 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];
  227. };
  228. } else {
  229. player removeAction s_player_maintain_area;
  230. s_player_maintain_area = -1;
  231. player removeAction s_player_maintain_area_preview;
  232. s_player_maintain_area_preview = -1;
  233. };
  234.  
  235. // CURSOR TARGET ALIVE
  236. if(_isAlive) then {
  237.  
  238. //Allow player to delete objects
  239. if(_isDestructable or _isWreck or _isRemovable or _isWreckBuilding) then {
  240. if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
  241. _player_deleteBuild = true;
  242. };
  243. };
  244.  
  245. //Allow owners to delete modulars
  246. if(_isModular and (dayz_characterID == _ownerID)) then {
  247. if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
  248. _player_deleteBuild = true;
  249. };
  250. };
  251.  
  252. // CURSOR TARGET VEHICLE
  253. if(_isVehicle) then {
  254.  
  255. //flip vehicle small vehicles by your self and all other vehicles with help nearby
  256. if (!(canmove _cursorTarget) and (player distance _cursorTarget >= 2) and (count (crew _cursorTarget))== 0 and ((vectorUp _cursorTarget) select 2) < 0.5) then {
  257. _playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
  258. if(_isVehicletype or (_playersNear >= 2)) then {
  259. _player_flipveh = true;
  260. };
  261. };
  262.  
  263.  
  264. if(!_isMan and _ownerID != "0" and !(_cursorTarget isKindOf "Bicycle")) then {
  265. _player_lockUnlock_crtl = true;
  266. };
  267.  
  268. };
  269.  
  270. };
  271.  
  272. if(_player_deleteBuild) then {
  273. if (s_player_deleteBuild < 0) then {
  274. s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  275. };
  276. } else {
  277. player removeAction s_player_deleteBuild;
  278. s_player_deleteBuild = -1;
  279. };
  280.  
  281. if (DZE_HeliLift) then {
  282. _liftHeli = objNull;
  283. _found = false;
  284.  
  285. _allowTow = false;
  286. if ((count (crew _cursorTarget)) == 0) then {
  287. {
  288. if(!_allowTow) then {
  289. _allowTow = _cursorTarget isKindOf _x;
  290. };
  291. } forEach DZE_HeliAllowToTow;
  292. };
  293.  
  294. //diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow];
  295.  
  296. if (_allowTow) then {
  297. _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
  298. {
  299. if(!_found) then {
  300. _posL = getPos _x;
  301. _posC = getPos _cursorTarget;
  302. _height = (_posL select 2) - (_posC select 2);
  303. _hasAttached = _x getVariable["hasAttached",false];
  304. if(_height < 15 and _height > 5 and (typeName _hasAttached != "OBJECT")) then {
  305. if(((abs((_posL select 0) - (_posC select 0))) < 10) and ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
  306. _liftHeli = _x;
  307. _found = true;
  308. };
  309. };
  310. };
  311. } forEach _liftHelis;
  312. };
  313.  
  314. //diag_log format["HELI: %1 TARGET: %2",_found,_cursorTarget];
  315.  
  316. _attached = _cursorTarget getVariable["attached",false];
  317. if(_found and _allowTow and _canDo and !locked _cursorTarget and !_isPZombie and (typeName _attached != "OBJECT")) then {
  318. if (s_player_heli_lift < 0) then {
  319. s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true, "",""];
  320. };
  321. } else {
  322. player removeAction s_player_heli_lift;
  323. s_player_heli_lift = -1;
  324. };
  325. };
  326.  
  327. // Allow Owner to lock and unlock vehicle
  328. if(_player_lockUnlock_crtl) then {
  329. if (s_player_lockUnlock_crtl < 0) then {
  330. _hasKey = _ownerID in _temp_keys;
  331. _oldOwner = (_ownerID == dayz_playerUID);
  332. if(locked _cursorTarget) then {
  333. if(_hasKey or _oldOwner) then {
  334. _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, "", ""];
  335. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  336. s_player_lockUnlock_crtl = 1;
  337. } else {
  338. if(_hasHotwireKit) then {
  339. _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
  340. } else {
  341. _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, true, true, "", ""];
  342. };
  343. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  344. s_player_lockUnlock_crtl = 1;
  345. };
  346. } else {
  347. if(_hasKey or _oldOwner) then {
  348. _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
  349. s_player_lockunlock set [count s_player_lockunlock,_lock];
  350. s_player_lockUnlock_crtl = 1;
  351. };
  352. };
  353. };
  354.  
  355. } else {
  356. {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
  357. s_player_lockUnlock_crtl = -1;
  358. };
  359.  
  360. if(DZE_AllowForceSave) then {
  361. //Allow player to force save
  362. if((_isVehicle or _isTent) and !_isMan) then {
  363. if (s_player_forceSave < 0) then {
  364. s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
  365. };
  366. } else {
  367. player removeAction s_player_forceSave;
  368. s_player_forceSave = -1;
  369. };
  370. };
  371.  
  372.  
  373.  
  374. If(DZE_AllowCargoCheck) then {
  375. if((_isVehicle or _isTent or _isnewstorage) and _isAlive and !_isMan and !locked _cursorTarget) then {
  376. if (s_player_checkGear < 0) then {
  377. s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""];
  378. };
  379. } else {
  380. player removeAction s_player_checkGear;
  381. s_player_checkGear = -1;
  382. };
  383. };
  384.  
  385.  
  386. //flip vehicle small vehicles by your self and all other vehicles with help nearby
  387. if(_player_flipveh) then {
  388. if (s_player_flipveh < 0) then {
  389. s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];
  390. };
  391. } else {
  392. player removeAction s_player_flipveh;
  393. s_player_flipveh = -1;
  394. };
  395.  
  396. //Allow player to fill jerrycan
  397. if((_hasFuelE or _hasFuelBarrelE) and _isFuel) then {
  398. if (s_player_fillfuel < 0) then {
  399. s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
  400. };
  401. } else {
  402. player removeAction s_player_fillfuel;
  403. s_player_fillfuel = -1;
  404. };
  405.  
  406. // logic vars for addactions
  407. _player_butcher = false;
  408. _player_studybody = false;
  409. _player_SurrenderedGear = false;
  410.  
  411. // CURSOR TARGET NOT ALIVE
  412. if (!_isAlive) then {
  413.  
  414. // Gut animal/zed
  415. if((_isAnimal or _isZombie) and _hasKnife) then {
  416. _isHarvested = _cursorTarget getVariable["meatHarvested",false];
  417. if (!_isHarvested) then {
  418. _player_butcher = true;
  419. };
  420. };
  421.  
  422. //beerdigen
  423. if (!_isAlive and !_isZombie and !_isAnimal and _hasETool and _isMan and _canDo) then {
  424. if (s_player_bury_human < 0) then {
  425. s_player_bury_human = player addAction [format["Bury Body"], "fixes\bury_human.sqf",cursorTarget, 3, true, true, "", ""];
  426. }
  427. } else {
  428. player removeAction s_player_bury_human;
  429. s_player_bury_human = -1;
  430. };
  431. ///////////////////////////////////
  432.  
  433. // Study body
  434. if (_isMan and !_isZombie and !_isAnimal) then {
  435. _player_studybody = true;
  436. }
  437. } else {
  438. // unit alive
  439.  
  440. // gear access on surrendered player
  441. if(_isMan and !_isZombie and !_isAnimal) then {
  442. _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",false];
  443. if (_isSurrendered) then {
  444. _player_SurrenderedGear = true;
  445. };
  446. };
  447. };
  448.  
  449.  
  450. // Human Gut animal or zombie
  451. if (_player_butcher) then {
  452. if (s_player_butcher < 0) then {
  453. if(_isZombie) then {
  454. s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, true, true, "", ""];
  455. } else {
  456. s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
  457. };
  458. };
  459. } else {
  460. player removeAction s_player_butcher;
  461. s_player_butcher = -1;
  462. };
  463.  
  464.  
  465.  
  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 and _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_ACTION_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) and !(inflamed _cursorTarget) and (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 and (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) and ("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) and _ownerID != "0" and (player distance _cursorTarget < 3)) then {
  554. if (s_player_unlockvault < 0) then {
  555. if(_typeOfCursorTarget in DZE_LockedStorage) then {
  556. if(_ownerID == dayz_combination or _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 and _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} forEach 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 and _ownerID != "0" and (player distance _cursorTarget < 3)) then {
  579.  
  580. if (s_player_lockvault < 0) then {
  581. if(_ownerID == dayz_combination or _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 and (_ownerID == dayz_combination or _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 and (_x getVariable ["GeneratorRunning", false])) then {
  616. _findNearestGen set [(count _findNearestGen),_x];
  617. };
  618. } foreach _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 and 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") or (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") or (_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 or _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" or _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") and (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" or _cursorTarget isKindOf "DZE_Housebase" or _typeOfCursorTarget == "LightPole_DZ") and (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 and 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. // MF-Tow Script by Matt Fairbrass (matt_d_rat)
  743. call compile preprocessFileLineNumbers 'addons\mf-tow\init.sqf';
  744.  
  745. //Sleep
  746. if(_isTent and _ownerID == dayz_characterID) then {
  747. if ((s_player_sleep < 0) and (player distance _cursorTarget < 3)) then {
  748. s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
  749. };
  750. } else {
  751. player removeAction s_player_sleep;
  752. s_player_sleep = -1;
  753. };
  754.  
  755. //Repairing Vehicles
  756. if ((dayz_myCursorTarget != _cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage _cursorTarget < 1) and !_isDisallowRepair) then {
  757. _hasKey = _ownerID in _temp_keys;
  758. _oldOwner = (_ownerID == dayz_playerUID);
  759. if (s_player_repair_crtl < 0) then {
  760. dayz_myCursorTarget = _cursorTarget;
  761. _menu = dayz_myCursorTarget addAction ["Repair Vehicle", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  762. s_player_repairActions set [count s_player_repairActions,_menu];
  763. if(!locked _cursorTarget) then {
  764. _menu1 = dayz_myCursorTarget addAction ["Salvage Vehicle", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  765. s_player_repairActions set [count s_player_repairActions,_menu1];};
  766. s_player_repair_crtl = 1;
  767. } else {
  768. {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
  769. s_player_repair_crtl = -1;
  770. };
  771. };
  772.  
  773. // All Traders
  774. if (_isMan and !_isPZombie and _traderType in serverTraders) then {
  775.  
  776. if (s_player_parts_crtl < 0) then {
  777.  
  778. // get humanity
  779. _humanity = player getVariable ["humanity",0];
  780. _traderMenu = call compile format["menu_%1;",_traderType];
  781.  
  782. // diag_log ("TRADER = " + str(_traderMenu));
  783.  
  784. _low_high = "low";
  785. _humanity_logic = false;
  786. if((_traderMenu select 2) == "friendly") then {
  787. _humanity_logic = (_humanity < -5000);
  788. };
  789. if((_traderMenu select 2) == "hostile") then {
  790. _low_high = "high";
  791. _humanity_logic = (_humanity > -5000);
  792. };
  793. if((_traderMenu select 2) == "hero") then {
  794. _humanity_logic = (_humanity < 5000);
  795. };
  796. if(_humanity_logic) then {
  797. _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
  798. s_player_parts set [count s_player_parts,_cancel];
  799. } else {
  800.  
  801. // Static Menu
  802. {
  803. //diag_log format["DEBUG TRADER: %1", _x];
  804. _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, "",""];
  805. s_player_parts set [count s_player_parts,_buy];
  806.  
  807. } forEach (_traderMenu select 1);
  808. // Database menu
  809. _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  810. s_player_parts set [count s_player_parts,_buy];
  811.  
  812. };
  813. s_player_parts_crtl = 1;
  814.  
  815. };
  816. } else {
  817. {player removeAction _x} forEach s_player_parts;s_player_parts = [];
  818. s_player_parts_crtl = -1;
  819. };
  820.  
  821.  
  822. if(dayz_tameDogs) then {
  823.  
  824. //Dog
  825. if (_isDog and _isAlive and (_hasRawMeat) and _ownerID == "0" and player getVariable ["dogID", 0] == 0) then {
  826. if (s_player_tamedog < 0) then {
  827. s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""];
  828. };
  829. } else {
  830. player removeAction s_player_tamedog;
  831. s_player_tamedog = -1;
  832. };
  833. if (_isDog and _ownerID == dayz_characterID and _isAlive) then {
  834. _dogHandle = player getVariable ["dogID", 0];
  835. if (s_player_feeddog < 0 and _hasRawMeat) then {
  836. s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""];
  837. };
  838. if (s_player_waterdog < 0 and "ItemWaterbottle" in _magazinesPlayer) then {
  839. s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""];
  840. };
  841. if (s_player_staydog < 0) then {
  842. _lieDown = _dogHandle getFSMVariable "_actionLieDown";
  843. if (_lieDown) then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  844. s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true,"",""];
  845. };
  846. if (s_player_trackdog < 0) then {
  847. s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true,"",""];
  848. };
  849. if (s_player_barkdog < 0) then {
  850. s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true,"",""];
  851. };
  852. if (s_player_warndog < 0) then {
  853. _warn = _dogHandle getFSMVariable "_watchDog";
  854. if (_warn) then { _text = (localize "str_epoch_player_247"); _warn = false; } else { _text = (localize "str_epoch_player_248"); _warn = true; };
  855. s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true,"",""];
  856. };
  857. if (s_player_followdog < 0) then {
  858. s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true,"",""];
  859. };
  860. } else {
  861. player removeAction s_player_feeddog;
  862. s_player_feeddog = -1;
  863. player removeAction s_player_waterdog;
  864. s_player_waterdog = -1;
  865. player removeAction s_player_staydog;
  866. s_player_staydog = -1;
  867. player removeAction s_player_trackdog;
  868. s_player_trackdog = -1;
  869. player removeAction s_player_barkdog;
  870. s_player_barkdog = -1;
  871. player removeAction s_player_warndog;
  872. s_player_warndog = -1;
  873. player removeAction s_player_followdog;
  874. s_player_followdog = -1;
  875. };
  876. };
  877.  
  878. } else {
  879. //Engineering
  880. {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
  881. s_player_repair_crtl = -1;
  882.  
  883. {player removeAction _x} forEach s_player_combi;s_player_combi = [];
  884.  
  885. dayz_myCursorTarget = objNull;
  886. s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  887.  
  888. {player removeAction _x} forEach s_player_parts;s_player_parts = [];
  889. s_player_parts_crtl = -1;
  890.  
  891. {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
  892. s_player_lockUnlock_crtl = -1;
  893.  
  894. player removeAction s_player_checkGear;
  895. s_player_checkGear = -1;
  896.  
  897. player removeAction s_player_SurrenderedGear;
  898. s_player_SurrenderedGear = -1;
  899.  
  900. //Others
  901. player removeAction s_player_forceSave;
  902. s_player_forceSave = -1;
  903. player removeAction s_player_flipveh;
  904. s_player_flipveh = -1;
  905. player removeAction s_player_sleep;
  906. s_player_sleep = -1;
  907. player removeAction s_player_deleteBuild;
  908. s_player_deleteBuild = -1;
  909. player removeAction s_player_butcher;
  910. s_player_butcher = -1;
  911. player removeAction s_player_cook;
  912. s_player_cook = -1;
  913. player removeAction s_player_boil;
  914. s_player_boil = -1;
  915. player removeAction s_player_fireout;
  916. s_player_fireout = -1;
  917. player removeAction s_player_packtent;
  918. s_player_packtent = -1;
  919. player removeAction s_player_fillfuel;
  920. s_player_fillfuel = -1;
  921. player removeAction s_player_studybody;
  922. s_player_studybody = -1;
  923. //Custom Addons
  924. //beerdigen
  925. player removeAction s_player_bury_human;
  926. s_player_bury_human = -1;
  927. //Dog
  928. player removeAction s_player_tamedog;
  929. s_player_tamedog = -1;
  930. player removeAction s_player_feeddog;
  931. s_player_feeddog = -1;
  932. player removeAction s_player_waterdog;
  933. s_player_waterdog = -1;
  934. player removeAction s_player_staydog;
  935. s_player_staydog = -1;
  936. player removeAction s_player_trackdog;
  937. s_player_trackdog = -1;
  938. player removeAction s_player_barkdog;
  939. s_player_barkdog = -1;
  940. player removeAction s_player_warndog;
  941. s_player_warndog = -1;
  942. player removeAction s_player_followdog;
  943. s_player_followdog = -1;
  944.  
  945. // vault
  946. player removeAction s_player_unlockvault;
  947. s_player_unlockvault = -1;
  948. player removeAction s_player_packvault;
  949. s_player_packvault = -1;
  950. player removeAction s_player_lockvault;
  951. s_player_lockvault = -1;
  952.  
  953. player removeAction s_player_information;
  954. s_player_information = -1;
  955. player removeAction s_player_fillgen;
  956. s_player_fillgen = -1;
  957. player removeAction s_player_upgrade_build;
  958. s_player_upgrade_build = -1;
  959. player removeAction s_player_maint_build;
  960. s_player_maint_build = -1;
  961. player removeAction s_player_downgrade_build;
  962. s_player_downgrade_build = -1;
  963. player removeAction s_player_towing;
  964. s_player_towing = -1;
  965. player removeAction s_player_fuelauto;
  966. s_player_fuelauto = -1;
  967. player removeAction s_player_fuelauto2;
  968. s_player_fuelauto2 = -1;
  969. };
  970.  
  971.  
  972.  
  973. //Dog actions on player self
  974. _dogHandle = player getVariable ["dogID", 0];
  975. if (_dogHandle > 0) then {
  976. _dog = _dogHandle getFSMVariable "_dog";
  977. _ownerID = "0";
  978. if (!isNull cursorTarget) then { _ownerID = cursorTarget getVariable ["CharacterID","0"]; };
  979. if (_canDo and !_inVehicle and alive _dog and _ownerID != dayz_characterID) then {
  980. if (s_player_movedog < 0) then {
  981. s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, false, true, "", ""];
  982. };
  983. if (s_player_speeddog < 0) then {
  984. _text = (localize "str_epoch_player_249");
  985. _speed = 0;
  986. if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = (localize "str_epoch_player_250"); };
  987. 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, "", ""];
  988. };
  989. if (s_player_calldog < 0) then {
  990. 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, "", ""];
  991. };
  992. };
  993. } else {
  994. player removeAction s_player_movedog;
  995. s_player_movedog = -1;
  996. player removeAction s_player_speeddog;
  997. s_player_speeddog = -1;
  998. player removeAction s_player_calldog;
  999. s_player_calldog = -1;
  1000. };
  1001. //delete interior
  1002. 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"];
  1003. _isEmeraldItem = (typeOf cursorTarget) in isEmerald;
  1004. _emeraldTarget = typeOf cursorTarget;
  1005.  
  1006. if((_isEmeraldItem and (player distance cursorTarget <= 2)) and _canDo) then {
  1007. if (s_player_removeEmerald < 0) then {
  1008. s_player_removeEmerald = player addaction [format[("<t color=""#ff0000"">" + ("Remove %1") +"</t>"),_emeraldTarget],"interior\remove.sqf",_emeraldTarget];
  1009. };
  1010. } else {
  1011. player removeAction s_player_removeEmerald;
  1012. s_player_removeEmerald = -1;
  1013. };
Advertisement
Add Comment
Please, Sign In to add comment