Advertisement
Guest User

Untitled

a guest
Apr 14th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.58 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","_playerUID","_found"];
  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=""#FFFF00"">" + ("Self Bloodbag") +"</t>"),"custom\bloodbag\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. _playerUID = getPlayerUID player;_found=[_playerUID,"AX"] call KRON_StrInStr;if (_found) then { _playerUID=[_playerUID] call KRON_convertPlayerUID;};
  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(_isModular and (_playerUID == _ownerID)) then {
  248. if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
  249. _player_deleteBuild = true;
  250. };
  251. };
  252.  
  253. // CURSOR TARGET VEHICLE
  254. if(_isVehicle) then {
  255.  
  256. //flip vehicle small vehicles by your self and all other vehicles with help nearby
  257. if (!(canmove _cursorTarget) and (player distance _cursorTarget >= 2) and (count (crew _cursorTarget))== 0 and ((vectorUp _cursorTarget) select 2) < 0.5) then {
  258. _playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
  259. if(_isVehicletype or (_playersNear >= 2)) then {
  260. _player_flipveh = true;
  261. };
  262. };
  263.  
  264.  
  265. if(!_isMan and _ownerID != "0" and !(_cursorTarget isKindOf "Bicycle")) then {
  266. _player_lockUnlock_crtl = true;
  267. };
  268.  
  269. };
  270.  
  271. };
  272.  
  273. if(_player_deleteBuild) then {
  274. if (s_player_deleteBuild < 0) then {
  275. //s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  276. s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "custom\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  277. };
  278. } else {
  279. player removeAction s_player_deleteBuild;
  280. s_player_deleteBuild = -1;
  281. };
  282.  
  283. if (DZE_HeliLift) then {
  284. _liftHeli = objNull;
  285. _found = false;
  286.  
  287. _allowTow = false;
  288. if ((count (crew _cursorTarget)) == 0) then {
  289. {
  290. if(!_allowTow) then {
  291. _allowTow = _cursorTarget isKindOf _x;
  292. };
  293. } forEach DZE_HeliAllowToTow;
  294. };
  295.  
  296. //diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow];
  297.  
  298. if (_allowTow) then {
  299. _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
  300. {
  301. if(!_found) then {
  302. _posL = getPos _x;
  303. _posC = getPos _cursorTarget;
  304. _height = (_posL select 2) - (_posC select 2);
  305. _hasAttached = _x getVariable["hasAttached",false];
  306. if(_height < 15 and _height > 5 and (typeName _hasAttached != "OBJECT")) then {
  307. if(((abs((_posL select 0) - (_posC select 0))) < 10) and ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
  308. _liftHeli = _x;
  309. _found = true;
  310. };
  311. };
  312. };
  313. } forEach _liftHelis;
  314. };
  315.  
  316. //diag_log format["HELI: %1 TARGET: %2",_found,_cursorTarget];
  317.  
  318. _attached = _cursorTarget getVariable["attached",false];
  319. if(_found and _allowTow and _canDo and !locked _cursorTarget and !_isPZombie and (typeName _attached != "OBJECT")) then {
  320. if (s_player_heli_lift < 0) then {
  321. s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true, "",""];
  322. };
  323. } else {
  324. player removeAction s_player_heli_lift;
  325. s_player_heli_lift = -1;
  326. };
  327. };
  328.  
  329. // Allow Owner to lock and unlock vehicle
  330. if(_player_lockUnlock_crtl) then {
  331. if (s_player_lockUnlock_crtl < 0) then {
  332. _hasKey = _ownerID in _temp_keys;
  333. _oldOwner = (_ownerID == dayz_playerUID);
  334. if(locked _cursorTarget) then {
  335. if(_hasKey or _oldOwner) then {
  336. _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, "", ""];
  337. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  338. s_player_lockUnlock_crtl = 1;
  339. } else {
  340. if(_hasHotwireKit) then {
  341. _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
  342. } else {
  343. _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, true, true, "", ""];
  344. };
  345. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  346. s_player_lockUnlock_crtl = 1;
  347. };
  348. } else {
  349. if(_hasKey or _oldOwner) then {
  350. _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
  351. s_player_lockunlock set [count s_player_lockunlock,_lock];
  352. s_player_lockUnlock_crtl = 1;
  353. };
  354. };
  355. };
  356.  
  357. } else {
  358. {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
  359. s_player_lockUnlock_crtl = -1;
  360. };
  361.  
  362. if(DZE_AllowForceSave) then {
  363. //Allow player to force save
  364. if((_isVehicle or _isTent) and !_isMan) then {
  365. if (s_player_forceSave < 0) then {
  366. s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
  367. };
  368. } else {
  369. player removeAction s_player_forceSave;
  370. s_player_forceSave = -1;
  371. };
  372. };
  373.  
  374.  
  375.  
  376. If(DZE_AllowCargoCheck) then {
  377. if((_isVehicle or _isTent or _isnewstorage) and _isAlive and !_isMan and !locked _cursorTarget) then {
  378. if (s_player_checkGear < 0) then {
  379. s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""];
  380. };
  381. } else {
  382. player removeAction s_player_checkGear;
  383. s_player_checkGear = -1;
  384. };
  385. };
  386.  
  387.  
  388. //flip vehicle small vehicles by your self and all other vehicles with help nearby
  389. if(_player_flipveh) then {
  390. if (s_player_flipveh < 0) then {
  391. s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];
  392. };
  393. } else {
  394. player removeAction s_player_flipveh;
  395. s_player_flipveh = -1;
  396. };
  397.  
  398. //Allow player to fill jerrycan
  399. if((_hasFuelE or _hasFuelBarrelE) and _isFuel) then {
  400. if (s_player_fillfuel < 0) then {
  401. s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
  402. };
  403. } else {
  404. player removeAction s_player_fillfuel;
  405. s_player_fillfuel = -1;
  406. };
  407.  
  408. // logic vars for addactions
  409. _player_butcher = false;
  410. _player_studybody = false;
  411. _player_SurrenderedGear = false;
  412.  
  413. // CURSOR TARGET NOT ALIVE
  414. if (!_isAlive) then {
  415.  
  416. // Gut animal/zed
  417. if((_isAnimal or _isZombie) and _hasKnife) then {
  418. _isHarvested = _cursorTarget getVariable["meatHarvested",false];
  419. if (!_isHarvested) then {
  420. _player_butcher = true;
  421. };
  422. };
  423.  
  424. // Study body
  425. if (_isMan and !_isZombie and !_isAnimal) then {
  426. _player_studybody = true;
  427. }
  428. } else {
  429. // unit alive
  430.  
  431. // gear access on surrendered player
  432. if(_isMan and !_isZombie and !_isAnimal) then {
  433. _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",false];
  434. if (_isSurrendered) then {
  435. _player_SurrenderedGear = true;
  436. };
  437. };
  438. };
  439.  
  440.  
  441. // Human Gut animal or zombie
  442. if (_player_butcher) then {
  443. if (s_player_butcher < 0) then {
  444. if(_isZombie) then {
  445. s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, true, true, "", ""];
  446. } else {
  447. s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
  448. };
  449. };
  450. } else {
  451. player removeAction s_player_butcher;
  452. s_player_butcher = -1;
  453. };
  454.  
  455. // Study Body
  456. if (_player_studybody) then {
  457. if (s_player_studybody < 0) then {
  458. s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true, "",""];
  459. };
  460. } else {
  461. player removeAction s_player_studybody;
  462. s_player_studybody = -1;
  463. };
  464.  
  465. //CLOTHES
  466. if (_isMan and !_isAlive and !_isZombie and !_isAnimal) then {
  467. if (s_clothes < 0) then {
  468. s_clothes = player addAction [("<t color=""#FFFF00"">" + ("Take Clothes") + "</t>"), "custom\clothes\player_takeClothes.sqf",cursorTarget, 1, false, true, "",""];
  469. };
  470. } else {
  471. player removeAction s_clothes;
  472. s_clothes = -1;
  473. };
  474.  
  475. // logic vars
  476. _player_cook = false;
  477. _player_boil = false;
  478.  
  479. // CURSOR TARGET IS FIRE
  480. if (inflamed _cursorTarget) then {
  481.  
  482. //Fireplace Actions check
  483. if (_hasRawMeat) then {
  484. _player_cook = true;
  485. };
  486.  
  487. // Boil water
  488. if (_hasbottleitem and _hastinitem) then {
  489. _player_boil = true;
  490. };
  491. };
  492.  
  493. if (_player_SurrenderedGear) then {
  494. if (s_player_SurrenderedGear < 0) then {
  495. s_player_SurrenderedGear = player addAction [localize "STR_EPOCH_ACTION_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true, "", ""];
  496. };
  497. } else {
  498. player removeAction s_player_SurrenderedGear;
  499. s_player_SurrenderedGear = -1;
  500. };
  501.  
  502. //Fireplace Actions check
  503. if (_player_cook) then {
  504. if (s_player_cook < 0) then {
  505. s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""];
  506. };
  507. } else {
  508. player removeAction s_player_cook;
  509. s_player_cook = -1;
  510. };
  511.  
  512. // Boil water
  513. if (_player_boil) then {
  514. if (s_player_boil < 0) then {
  515. s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""];
  516. };
  517. } else {
  518. player removeAction s_player_boil;
  519. s_player_boil = -1;
  520. };
  521.  
  522. if(_cursorTarget == dayz_hasFire) then {
  523. if ((s_player_fireout < 0) and !(inflamed _cursorTarget) and (player distance _cursorTarget < 3)) then {
  524. s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true, "",""];
  525. };
  526. } else {
  527. player removeAction s_player_fireout;
  528. s_player_fireout = -1;
  529. };
  530.  
  531. //Packing my tent
  532. //if(_isTent and (player distance _cursorTarget < 3)) then {
  533. if(_isTent and (player distance _cursorTarget < 3)) then { if (_ownerID == _playerUID) then {
  534. if (_ownerID == dayz_characterID) then {
  535. if (s_player_packtent < 0) then {
  536. s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""];
  537. };
  538. } else {
  539. if(("ItemJerrycan" in _magazinesPlayer) and ("ItemMatchbox_DZE" in weapons player)) then {
  540. if (s_player_packtent < 0) then {
  541. //s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  542. s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "custom\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  543. };
  544. };
  545. };
  546. } else {
  547. player removeAction s_player_packtent;
  548. s_player_packtent = -1;
  549. };
  550.  
  551. //Allow owner to unlock vault
  552. if((_typeOfCursorTarget in DZE_LockableStorage) and _ownerID != "0" and (player distance _cursorTarget < 3)) then {
  553. if (s_player_unlockvault < 0) then {
  554. if(_typeOfCursorTarget in DZE_LockedStorage) then {
  555. if(_ownerID == dayz_combination or _ownerID == dayz_playerUID) then {
  556. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
  557. s_player_combi set [count s_player_combi,_combi];
  558. } else {
  559. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  560. s_player_combi set [count s_player_combi,_combi];
  561. };
  562. s_player_unlockvault = 1;
  563. } else {
  564. if(_ownerID != dayz_combination and _ownerID != dayz_playerUID) then {
  565. _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  566. s_player_combi set [count s_player_combi,_combi];
  567. s_player_unlockvault = 1;
  568. };
  569. };
  570. };
  571. } else {
  572. {player removeAction _x} forEach s_player_combi;s_player_combi = [];
  573. s_player_unlockvault = -1;
  574. };
  575.  
  576. //Allow owner to pack vault
  577. if(_typeOfCursorTarget in DZE_UnLockedStorage and _ownerID != "0" and (player distance _cursorTarget < 3)) then {
  578.  
  579. if (s_player_lockvault < 0) then {
  580. if(_ownerID == dayz_combination or _ownerID == dayz_playerUID) then {
  581. s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true, "",""];
  582. };
  583. };
  584. if (s_player_packvault < 0 and (_ownerID == dayz_combination or _ownerID == dayz_playerUID)) then {
  585. 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, "",""];
  586. };
  587. } else {
  588. player removeAction s_player_packvault;
  589. s_player_packvault = -1;
  590. player removeAction s_player_lockvault;
  591. s_player_lockvault = -1;
  592. };
  593.  
  594.  
  595.  
  596. //Player Deaths
  597. if(_typeOfCursorTarget == "Info_Board_EP1") then {
  598. if (s_player_information < 0) then {
  599. s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true, "",""];
  600. };
  601. } else {
  602. player removeAction s_player_information;
  603. s_player_information = -1;
  604. };
  605.  
  606. //Fuel Pump
  607. if(_typeOfCursorTarget in dayz_fuelpumparray) then {
  608. if (s_player_fuelauto < 0) then {
  609.  
  610. // check if Generator_DZ is running within 30 meters
  611. _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
  612. _findNearestGen = [];
  613. {
  614. if (alive _x and (_x getVariable ["GeneratorRunning", false])) then {
  615. _findNearestGen set [(count _findNearestGen),_x];
  616. };
  617. } foreach _findNearestGens;
  618. _IsNearRunningGen = count (_findNearestGen);
  619.  
  620. // show that pump needs power if no generator nearby.
  621. if(_IsNearRunningGen > 0) then {
  622. s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true, "",""];
  623. } else {
  624. s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  625. };
  626. };
  627. } else {
  628. player removeAction s_player_fuelauto;
  629. s_player_fuelauto = -1;
  630. };
  631.  
  632. //Fuel Pump on truck
  633. if(_typeOfCursorTarget in DZE_fueltruckarray and alive _cursorTarget) then {
  634. if (s_player_fuelauto2 < 0) then {
  635. // show that fuel truck pump needs power.
  636. if(isEngineOn _cursorTarget) then {
  637. s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true, "",""];
  638. } else {
  639. s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  640. };
  641. };
  642. } else {
  643. player removeAction s_player_fuelauto2;
  644. s_player_fuelauto2 = -1;
  645. };
  646.  
  647. // inplace upgrade tool
  648. if ((_cursorTarget isKindOf "ModularItems") or (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") or (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
  649. if ((s_player_lastTarget select 0) != _cursorTarget) then {
  650. if (s_player_upgrade_build > 0) then {
  651. player removeAction s_player_upgrade_build;
  652. s_player_upgrade_build = -1;
  653. };
  654. };
  655. if (s_player_upgrade_build < 0) then {
  656. // s_player_lastTarget = _cursorTarget;
  657. s_player_lastTarget set [0,_cursorTarget];
  658. //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, "",""];
  659. s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "custom\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.  
  743. //Sleep
  744. //if(_isTent and _ownerID == dayz_characterID) then {
  745. if(_isTent and _ownerID == _playerUID) then {
  746. if ((s_player_sleep < 0) and (player distance _cursorTarget < 3)) then {
  747. s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
  748. };
  749. } else {
  750. player removeAction s_player_sleep;
  751. s_player_sleep = -1;
  752. };
  753.  
  754. //Repairing Vehicles
  755. if ((dayz_myCursorTarget != _cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage _cursorTarget < 1) and !_isDisallowRepair) then {
  756. if (s_player_repair_crtl < 0) then {
  757. dayz_myCursorTarget = _cursorTarget;
  758. _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  759. _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  760. s_player_repairActions set [count s_player_repairActions,_menu];
  761. s_player_repairActions set [count s_player_repairActions,_menu1];
  762. s_player_repair_crtl = 1;
  763. } else {
  764. {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
  765. s_player_repair_crtl = -1;
  766. };
  767. };
  768.  
  769. // All Traders
  770. if (_isMan and !_isPZombie and _traderType in serverTraders) then {
  771.  
  772. if (s_player_parts_crtl < 0) then {
  773.  
  774. // get humanity
  775. _humanity = player getVariable ["humanity",0];
  776. _traderMenu = call compile format["menu_%1;",_traderType];
  777.  
  778. // diag_log ("TRADER = " + str(_traderMenu));
  779.  
  780. _low_high = "low";
  781. _humanity_logic = false;
  782. if((_traderMenu select 2) == "friendly") then {
  783. _humanity_logic = (_humanity < -5000);
  784. };
  785. if((_traderMenu select 2) == "hostile") then {
  786. _low_high = "high";
  787. _humanity_logic = (_humanity > -5000);
  788. };
  789. if((_traderMenu select 2) == "hero") then {
  790. _humanity_logic = (_humanity < 5000);
  791. };
  792. if(_humanity_logic) then {
  793. _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
  794. s_player_parts set [count s_player_parts,_cancel];
  795. } else {
  796.  
  797. // Static Menu
  798. {
  799. //diag_log format["DEBUG TRADER: %1", _x];
  800. _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, "",""];
  801. s_player_parts set [count s_player_parts,_buy];
  802.  
  803. } forEach (_traderMenu select 1);
  804. // Database menu
  805. _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  806. s_player_parts set [count s_player_parts,_buy];
  807.  
  808. };
  809. s_player_parts_crtl = 1;
  810.  
  811. };
  812. } else {
  813. {player removeAction _x} forEach s_player_parts;s_player_parts = [];
  814. s_player_parts_crtl = -1;
  815. };
  816.  
  817.  
  818. if(dayz_tameDogs) then {
  819.  
  820. //Dog
  821. if (_isDog and _isAlive and (_hasRawMeat) and _ownerID == "0" and player getVariable ["dogID", 0] == 0) then {
  822. if (s_player_tamedog < 0) then {
  823. s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""];
  824. };
  825. } else {
  826. player removeAction s_player_tamedog;
  827. s_player_tamedog = -1;
  828. };
  829. if (_isDog and _ownerID == dayz_characterID and _isAlive) then {
  830. _dogHandle = player getVariable ["dogID", 0];
  831. if (s_player_feeddog < 0 and _hasRawMeat) then {
  832. s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""];
  833. };
  834. if (s_player_waterdog < 0 and "ItemWaterbottle" in _magazinesPlayer) then {
  835. s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""];
  836. };
  837. if (s_player_staydog < 0) then {
  838. _lieDown = _dogHandle getFSMVariable "_actionLieDown";
  839. if (_lieDown) then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  840. s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true,"",""];
  841. };
  842. if (s_player_trackdog < 0) then {
  843. s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true,"",""];
  844. };
  845. if (s_player_barkdog < 0) then {
  846. s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true,"",""];
  847. };
  848. if (s_player_warndog < 0) then {
  849. _warn = _dogHandle getFSMVariable "_watchDog";
  850. if (_warn) then { _text = (localize "str_epoch_player_247"); _warn = false; } else { _text = (localize "str_epoch_player_248"); _warn = true; };
  851. s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true,"",""];
  852. };
  853. if (s_player_followdog < 0) then {
  854. s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true,"",""];
  855. };
  856. } else {
  857. player removeAction s_player_feeddog;
  858. s_player_feeddog = -1;
  859. player removeAction s_player_waterdog;
  860. s_player_waterdog = -1;
  861. player removeAction s_player_staydog;
  862. s_player_staydog = -1;
  863. player removeAction s_player_trackdog;
  864. s_player_trackdog = -1;
  865. player removeAction s_player_barkdog;
  866. s_player_barkdog = -1;
  867. player removeAction s_player_warndog;
  868. s_player_warndog = -1;
  869. player removeAction s_player_followdog;
  870. s_player_followdog = -1;
  871. };
  872. };
  873.  
  874. } else {
  875. //Engineering
  876. {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
  877. s_player_repair_crtl = -1;
  878.  
  879. {player removeAction _x} forEach s_player_combi;s_player_combi = [];
  880.  
  881. dayz_myCursorTarget = objNull;
  882. s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  883.  
  884. {player removeAction _x} forEach s_player_parts;s_player_parts = [];
  885. s_player_parts_crtl = -1;
  886.  
  887. {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
  888. s_player_lockUnlock_crtl = -1;
  889.  
  890. player removeAction s_player_checkGear;
  891. s_player_checkGear = -1;
  892.  
  893. player removeAction s_player_SurrenderedGear;
  894. s_player_SurrenderedGear = -1;
  895.  
  896. //Others
  897. player removeAction s_player_forceSave;
  898. s_player_forceSave = -1;
  899. player removeAction s_player_flipveh;
  900. s_player_flipveh = -1;
  901. player removeAction s_player_sleep;
  902. s_player_sleep = -1;
  903. player removeAction s_player_deleteBuild;
  904. s_player_deleteBuild = -1;
  905. player removeAction s_player_butcher;
  906. s_player_butcher = -1;
  907. player removeAction s_player_cook;
  908. s_player_cook = -1;
  909. player removeAction s_player_boil;
  910. s_player_boil = -1;
  911. player removeAction s_player_fireout;
  912. s_player_fireout = -1;
  913. player removeAction s_player_packtent;
  914. s_player_packtent = -1;
  915. player removeAction s_player_fillfuel;
  916. s_player_fillfuel = -1;
  917. player removeAction s_player_studybody;
  918. s_player_studybody = -1;
  919. player removeAction s_clothes;
  920. s_clothes = -1;
  921. //Dog
  922. player removeAction s_player_tamedog;
  923. s_player_tamedog = -1;
  924. player removeAction s_player_feeddog;
  925. s_player_feeddog = -1;
  926. player removeAction s_player_waterdog;
  927. s_player_waterdog = -1;
  928. player removeAction s_player_staydog;
  929. s_player_staydog = -1;
  930. player removeAction s_player_trackdog;
  931. s_player_trackdog = -1;
  932. player removeAction s_player_barkdog;
  933. s_player_barkdog = -1;
  934. player removeAction s_player_warndog;
  935. s_player_warndog = -1;
  936. player removeAction s_player_followdog;
  937. s_player_followdog = -1;
  938. player removeAction s_player_dance;
  939. s_player_dance = -1;
  940.  
  941. // vault
  942. player removeAction s_player_unlockvault;
  943. s_player_unlockvault = -1;
  944. player removeAction s_player_packvault;
  945. s_player_packvault = -1;
  946. player removeAction s_player_lockvault;
  947. s_player_lockvault = -1;
  948.  
  949. player removeAction s_player_information;
  950. s_player_information = -1;
  951. player removeAction s_player_fillgen;
  952. s_player_fillgen = -1;
  953. player removeAction s_player_upgrade_build;
  954. s_player_upgrade_build = -1;
  955. player removeAction s_player_maint_build;
  956. s_player_maint_build = -1;
  957. player removeAction s_player_downgrade_build;
  958. s_player_downgrade_build = -1;
  959. player removeAction s_player_towing;
  960. s_player_towing = -1;
  961. player removeAction s_player_fuelauto;
  962. s_player_fuelauto = -1;
  963. player removeAction s_player_fuelauto2;
  964. s_player_fuelauto2 = -1;
  965. };
  966.  
  967.  
  968.  
  969. //Dog actions on player self
  970. _dogHandle = player getVariable ["dogID", 0];
  971. if (_dogHandle > 0) then {
  972. _dog = _dogHandle getFSMVariable "_dog";
  973. _ownerID = "0";
  974. if (!isNull cursorTarget) then { _ownerID = cursorTarget getVariable ["CharacterID","0"]; };
  975. if (_canDo and !_inVehicle and alive _dog and _ownerID != dayz_characterID) then {
  976. if (s_player_movedog < 0) then {
  977. s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, false, true, "", ""];
  978. };
  979. if (s_player_speeddog < 0) then {
  980. _text = (localize "str_epoch_player_249");
  981. _speed = 0;
  982. if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = (localize "str_epoch_player_250"); };
  983. 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, "", ""];
  984. };
  985. if (s_player_calldog < 0) then {
  986. 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, "", ""];
  987. };
  988. };
  989. } else {
  990. player removeAction s_player_movedog;
  991. s_player_movedog = -1;
  992. player removeAction s_player_speeddog;
  993. s_player_speeddog = -1;
  994. player removeAction s_player_calldog;
  995. s_player_calldog = -1;
  996. };
  997.  
  998. //DANCE
  999. if (inflamed cursorTarget and _canDo) then {
  1000. if (s_player_dance < 0) then {
  1001. s_player_dance = player addAction ["Dance!","custom\dance\dance.sqf",cursorTarget, 0, false, true, "",""];
  1002. };
  1003. } else {
  1004. player removeAction s_player_dance;
  1005. s_player_dance = -1;
  1006. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement