Advertisement
Guest User

fn_selfaction.sqf

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