Advertisement
Guest User

Untitled

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