Advertisement
Guest User

Untitled

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