Advertisement
Guest User

fn_selfactions

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