Advertisement
Guest User

Untitled

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