Advertisement
Guest User

Untitled

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