Advertisement
Guest User

Untitled

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