meanbeandk

fn_selfActions.sqf

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