Advertisement
Guest User

Untitled

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