Guest User

Untitled

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