Advertisement
Guest User

Fn_selfaction

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