Advertisement
Guest User

Untitled

a guest
Jun 27th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.16 KB | None | 0 0
  1. scriptName "Functions\misc\fn_selfActions.sqf";
  2.  
  3. private ["_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_isModularDoor","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached"];
  4.  
  5. if (DZE_ActionInProgress) exitWith {};
  6.  
  7. _vehicle = vehicle player;
  8. _isPZombie = player isKindOf "PZombie_VB";
  9. _inVehicle = (_vehicle != player);
  10. _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  11. _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
  12. _nearLight = nearestObject [player,"LitObject"];
  13. _canPickLight = false;
  14.  
  15. if (!isNull _nearLight) then {
  16. if (_nearLight distance player < 4) then {
  17. _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
  18. };
  19. };
  20.  
  21. if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
  22. if (s_player_grabflare < 0) then {
  23. _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
  24. s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
  25. s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
  26. };
  27. } else {
  28. player removeAction s_player_grabflare;
  29. player removeAction s_player_removeflare;
  30. s_player_grabflare = -1;
  31. s_player_removeflare = -1;
  32. };
  33.  
  34. if (DZE_HeliLift) then {
  35. _hasAttached = _vehicle getVariable["hasAttached",false];
  36. if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) < 30) && (speed _vehicle < 5) && (typeName _hasAttached == "OBJECT")) then {
  37. if (s_player_heli_detach < 0) then {
  38. dayz_myLiftVehicle = _vehicle;
  39. s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""];
  40. };
  41. } else {
  42. dayz_myLiftVehicle removeAction s_player_heli_detach;
  43. s_player_heli_detach = -1;
  44. };
  45. };
  46.  
  47. if(DZE_HaloJump) then {
  48. if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) > 400)) then {
  49. if (s_halo_action < 0) then {
  50. DZE_myHaloVehicle = _vehicle;
  51. s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""];
  52. };
  53. } else {
  54. DZE_myHaloVehicle removeAction s_halo_action;
  55. s_halo_action = -1;
  56. };
  57. };
  58.  
  59. if (!DZE_ForceNameTagsOff) then {
  60. if (s_player_showname < 0 && !_isPZombie) then {
  61. if (DZE_ForceNameTags) then {
  62. s_player_showname = 1;
  63. player setVariable["DZE_display_name",true,true];
  64. } else {
  65. s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false, "",""];
  66. s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false, "",""];
  67. };
  68. };
  69. };
  70.  
  71. if(_isPZombie) then {
  72. if (s_player_callzombies < 0) then {
  73. s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
  74. };
  75. if (DZE_PZATTACK) then {
  76. call pz_attack;
  77. DZE_PZATTACK = false;
  78. };
  79. if (s_player_pzombiesvision < 0) then {
  80. 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"];
  81. };
  82. if (!isNull cursorTarget && (player distance cursorTarget < 3)) then {
  83. _isAnimal = cursorTarget isKindOf "Animal";
  84. _isZombie = cursorTarget isKindOf "zZombie_base";
  85. _isHarvested = cursorTarget getVariable["meatHarvested",false];
  86. _isMan = cursorTarget isKindOf "Man";
  87. if (!alive cursorTarget && (_isAnimal || _isMan) && !_isZombie && !_isHarvested) then {
  88. if (s_player_pzombiesfeed < 0) then {
  89. s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""];
  90. };
  91. } else {
  92. player removeAction s_player_pzombiesfeed;
  93. s_player_pzombiesfeed = -1;
  94. };
  95. } else {
  96. player removeAction s_player_pzombiesfeed;
  97. s_player_pzombiesfeed = -1;
  98. };
  99. };
  100.  
  101. _allowedDistance = 4;
  102. _isAir = cursorTarget isKindOf "Air";
  103. _isShip = cursorTarget isKindOf "Ship";
  104.  
  105. if(_isAir || _isShip) then {
  106. _allowedDistance = 8;
  107. };
  108.  
  109. if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then { //Has some kind of target
  110.  
  111. _cursorTarget = cursorTarget;
  112. _typeOfCursorTarget = typeOf _cursorTarget;
  113. _isVehicle = _cursorTarget isKindOf "AllVehicles";
  114. _isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
  115. _isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
  116. _magazinesPlayer = magazines player;
  117. _hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
  118. _hastinitem = false;
  119.  
  120. {
  121. if (_x in _magazinesPlayer) then {
  122. _hastinitem = true;
  123. };
  124. } count boil_tin_cans;
  125.  
  126. _hasFuelE = "ItemJerrycanEmpty" in _magazinesPlayer;
  127. _hasFuelBarrelE = "ItemFuelBarrelEmpty" in _magazinesPlayer;
  128. _hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
  129. _itemsPlayer = items player;
  130. _temp_keys = [];
  131. _temp_keys_names = [];
  132. _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
  133.  
  134. {
  135. if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
  136. _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
  137. _ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
  138. _temp_keys_names set [_ownerKeyId,_ownerKeyName];
  139. _temp_keys set [count _temp_keys,str(_ownerKeyId)];
  140. };
  141. } count _itemsPlayer;
  142.  
  143. _hasKnife = "ItemKnife" in _itemsPlayer;
  144. _hasToolbox = "ItemToolbox" in _itemsPlayer;
  145. _isMan = _cursorTarget isKindOf "Man";
  146. _traderType = _typeOfCursorTarget;
  147. _ownerID = _cursorTarget getVariable ["CharacterID","0"];
  148. _isAnimal = _cursorTarget isKindOf "Animal";
  149. _isDog = (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
  150. _isZombie = _cursorTarget isKindOf "zZombie_base";
  151. _isDestructable = _cursorTarget isKindOf "BuiltItems";
  152. _isWreck = _typeOfCursorTarget in DZE_isWreck;
  153. _isWreckBuilding = _typeOfCursorTarget in DZE_isWreckBuilding;
  154. _isModular = _cursorTarget isKindOf "ModularItems";
  155. _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
  156. _isRemovable = _typeOfCursorTarget in DZE_isRemovable;
  157. _isDisallowRepair = _typeOfCursorTarget in ["M240Nest_DZ"];
  158. _isTent = _cursorTarget isKindOf "TentStorage";
  159. _isAlive = alive _cursorTarget;
  160. _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  161. _rawmeat = meatraw;
  162. _hasRawMeat = false;
  163.  
  164. {
  165. if (_x in _magazinesPlayer) then {
  166. _hasRawMeat = true;
  167. };
  168. } count _rawmeat;
  169.  
  170. _isFuel = false;
  171.  
  172. if (_hasFuelE || _hasFuelBarrelE) then {
  173. {
  174. if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
  175. } count dayz_fuelsources;
  176. };
  177.  
  178. _player_flipveh = false;
  179. _player_deleteBuild = false;
  180. _player_lockUnlock_crtl = false;
  181.  
  182. if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
  183. if (s_player_plotManagement < 0) then {
  184. _adminList = ["0152"]; // Add admins here if you admins to able to manage all plotpoles
  185. _owner = _cursorTarget getVariable ["CharacterID","0"];
  186. _friends = _cursorTarget getVariable ["plotfriends", []];
  187. _fuid = [];
  188. {
  189. _friendUID = _x select 0;
  190. _fuid = _fuid + [_friendUID];
  191. } forEach _friends;
  192. _allowed = [_owner];
  193. _allowed = [_owner] + _adminList + _fuid;
  194. if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then{
  195. s_player_plotManagement = player addAction ["<t color='#0059FF'>Manage Plot</t>", "plotManagement\initPlotManagement.sqf", [], 5, false];
  196. };
  197. };
  198. if (s_player_maintain_area < 0) then {
  199. s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "Scripts\Gold_Coin_system\Maintain\maintain_area.sqf", "maintain", 5, false];
  200. s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "Scripts\Gold_Coin_system\Maintain\maintain_area.sqf", "preview", 5, false];
  201. };
  202. } else {
  203. player removeAction s_player_plotManagement;
  204. s_player_plotManagement = -1;
  205. player removeAction s_player_maintain_area;
  206. s_player_maintain_area = -1;
  207. player removeAction s_player_maintain_area_preview;
  208. s_player_maintain_area_preview = -1;
  209. };
  210.  
  211. if(_isAlive) then {
  212.  
  213. if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
  214. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  215. _player_deleteBuild = true;
  216. };
  217. };
  218.  
  219. ///Allow owners to delete modulars
  220. if(_isModular) then {
  221. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  222. _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
  223. _IsNearPlot = count (_findNearestPoles);
  224. _fuid = [];
  225. _allowed = [];
  226. if(_IsNearPlot > 0)then{
  227. _thePlot = _findNearestPoles select 0;
  228. _owner = _thePlot getVariable ["ownerPUID","010"];
  229. _friends = _thePlot getVariable ["plotfriends", []];
  230. {
  231. _friendUID = _x select 0;
  232. _fuid = _fuid + [_friendUID];
  233. } forEach _friends;
  234. _allowed = [_owner];
  235. _allowed = [_owner] + _fuid;
  236. if ( _playerUID in _allowed && _ownerID in _allowed ) then { // // If u want that the object also belongs to someone on the plotpole.
  237. _player_deleteBuild = true;
  238. };
  239. }else{
  240. if(_ownerID == _playerUID)then{
  241. _player_deleteBuild = true;
  242. };
  243. };
  244. };
  245. };
  246. //Allow owners to delete modular doors without locks
  247. if(_isModularDoor) then {
  248. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  249. _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
  250. _IsNearPlot = count (_findNearestPoles);
  251. _fuid = [];
  252. _allowed = [];
  253. if(_IsNearPlot > 0)then{
  254. _thePlot = _findNearestPoles select 0;
  255. _owner = _thePlot getVariable ["ownerPUID","010"];
  256. _friends = _thePlot getVariable ["plotfriends", []];
  257. {
  258. _friendUID = _x select 0;
  259. _fuid = _fuid + [_friendUID];
  260. } forEach _friends;
  261. _allowed = [_owner];
  262. _allowed = [_owner] + _fuid;
  263. if ( _playerUID in _allowed && _ownerID in _allowed) then { // // If u want that the object also belongs to someone on the plotpole.
  264. _player_deleteBuild = true;
  265. };
  266. }else{
  267. if(_ownerID == _playerUID)then{
  268. _player_deleteBuild = true;
  269. };
  270. };
  271. };
  272. };
  273.  
  274. if(_isVehicle) then {
  275.  
  276. if (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (count (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) select 2) < 0.5) then {
  277. _playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
  278. if(_isVehicletype || (_playersNear >= 2)) then {
  279. _player_flipveh = true;
  280. };
  281. };
  282.  
  283. if(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) then {
  284. _player_lockUnlock_crtl = true;
  285. };
  286. };
  287. };
  288.  
  289. if(_player_deleteBuild) then {
  290. if (s_player_deleteBuild < 0) then {
  291. s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  292. };
  293. } else {
  294. player removeAction s_player_deleteBuild;
  295. s_player_deleteBuild = -1;
  296. };
  297.  
  298. if (DZE_HeliLift) then {
  299.  
  300. _liftHeli = objNull;
  301. _found = false;
  302. _allowTow = false;
  303.  
  304. if ((count (crew _cursorTarget)) == 0) then {
  305. {
  306. if(!_allowTow) then {
  307. _allowTow = _cursorTarget isKindOf _x;
  308. };
  309. } count DZE_HeliAllowToTow;
  310. };
  311.  
  312. if (_allowTow) then {
  313. _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
  314. {
  315. if(!_found) then {
  316. _posL = [_x] call FNC_getPos;
  317. _posC = [_cursorTarget] call FNC_getPos;
  318. _height = (_posL select 2) - (_posC select 2);
  319. _hasAttached = _x getVariable["hasAttached",false];
  320. if(_height < 15 && _height > 5 && (typeName _hasAttached != "OBJECT")) then {
  321. if(((abs((_posL select 0) - (_posC select 0))) < 10) && ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
  322. _liftHeli = _x;
  323. _found = true;
  324. };
  325. };
  326. };
  327. } count _liftHelis;
  328. };
  329.  
  330. _attached = _cursorTarget getVariable["attached",false];
  331.  
  332. if(_found && _allowTow && _canDo && !locked _cursorTarget && !_isPZombie && (typeName _attached != "OBJECT")) then {
  333. if (s_player_heli_lift < 0) then {
  334. s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true, "",""];
  335. };
  336. } else {
  337. player removeAction s_player_heli_lift;
  338. s_player_heli_lift = -1;
  339. };
  340. };
  341.  
  342. if(_player_lockUnlock_crtl) then {
  343. if (s_player_lockUnlock_crtl < 0) then {
  344. _hasKey = _ownerID in _temp_keys;
  345. _oldOwner = (_ownerID == dayz_playerUID);
  346. if(locked _cursorTarget) then {
  347. if(_hasKey || _oldOwner) then {
  348. _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, "", ""];
  349. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  350. s_player_lockUnlock_crtl = 1;
  351. } else {
  352. if(_hasHotwireKit) then {
  353. _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
  354. } else {
  355. _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, true, true, "", ""];
  356. };
  357. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  358. s_player_lockUnlock_crtl = 1;
  359. };
  360. } else {
  361. if(_hasKey || _oldOwner) then {
  362. _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
  363. s_player_lockunlock set [count s_player_lockunlock,_lock];
  364. s_player_lockUnlock_crtl = 1;
  365. };
  366. };
  367. };
  368. } else {
  369. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  370. s_player_lockUnlock_crtl = -1;
  371. };
  372.  
  373. if(DZE_AllowForceSave) then {
  374.  
  375. if((_isVehicle || _isTent) && !_isMan) then {
  376. if (s_player_forceSave < 0) then {
  377. s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
  378. };
  379. } else {
  380. player removeAction s_player_forceSave;
  381. s_player_forceSave = -1;
  382. };
  383. };
  384.  
  385.  
  386.  
  387. if(DZE_AllowCargoCheck) then {
  388. if((_isVehicle || _isTent || _isnewstorage) && _isAlive && !_isMan && !locked _cursorTarget) then {
  389. if (s_player_checkGear < 0) then {
  390. s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""];
  391. };
  392. } else {
  393. player removeAction s_player_checkGear;
  394. s_player_checkGear = -1;
  395. };
  396. };
  397.  
  398. if(_player_flipveh) then {
  399. if (s_player_flipveh < 0) then {
  400. s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];
  401. };
  402. } else {
  403. player removeAction s_player_flipveh;
  404. s_player_flipveh = -1;
  405. };
  406.  
  407. if((_hasFuelE || _hasFuelBarrelE) && _isFuel) then {
  408. if (s_player_fillfuel < 0) then {
  409. s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
  410. };
  411. } else {
  412. player removeAction s_player_fillfuel;
  413. s_player_fillfuel = -1;
  414. };
  415.  
  416. _player_butcher = false;
  417. _player_studybody = false;
  418. _player_SurrenderedGear = false;
  419.  
  420. if (!_isAlive) then {
  421.  
  422. if((_isAnimal || _isZombie) && _hasKnife) then {
  423. _isHarvested = _cursorTarget getVariable["meatHarvested",false];
  424. if (!_isHarvested) then {
  425. _player_butcher = true;
  426. };
  427. };
  428.  
  429. if (_isMan && !_isZombie && !_isAnimal) then {
  430. _player_studybody = true;
  431. }
  432. } else {
  433.  
  434. if(_isMan && !_isZombie && !_isAnimal) then {
  435. _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",false];
  436. if (_isSurrendered) then {
  437. _player_SurrenderedGear = true;
  438. };
  439. };
  440. };
  441.  
  442. if (_player_butcher) then {
  443. if (s_player_butcher < 0) then {
  444. if(_isZombie) then {
  445. s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, true, true, "", ""];
  446. } else {
  447. s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
  448. };
  449. };
  450. } else {
  451. player removeAction s_player_butcher;
  452. s_player_butcher = -1;
  453. };
  454.  
  455. if (_player_studybody) then {
  456. if (s_player_studybody < 0) then {
  457. s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "Scripts\Gold_Coin_system\Check_Wallet\check_wallet.sqf",_cursorTarget, 0, false, true, "",""];
  458. };
  459. } else {
  460. player removeAction s_player_studybody;
  461. s_player_studybody = -1;
  462. };
  463.  
  464. _player_cook = false;
  465. _player_boil = false;
  466.  
  467. if (inflamed _cursorTarget) then {
  468.  
  469. if (_hasRawMeat) then {
  470. _player_cook = true;
  471. };
  472.  
  473. if (_hasbottleitem && _hastinitem) then {
  474. _player_boil = true;
  475. };
  476. };
  477.  
  478. if (_player_SurrenderedGear) then {
  479. if (s_player_SurrenderedGear < 0) then {
  480. s_player_SurrenderedGear = player addAction [localize "STR_EPOCH_ACTIONS_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true, "", ""];
  481. };
  482. } else {
  483. player removeAction s_player_SurrenderedGear;
  484. s_player_SurrenderedGear = -1;
  485. };
  486.  
  487. if (_player_cook) then {
  488. if (s_player_cook < 0) then {
  489. s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""];
  490. };
  491. } else {
  492. player removeAction s_player_cook;
  493. s_player_cook = -1;
  494. };
  495.  
  496. if (_player_boil) then {
  497. if (s_player_boil < 0) then {
  498. s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""];
  499. };
  500. } else {
  501. player removeAction s_player_boil;
  502. s_player_boil = -1;
  503. };
  504.  
  505. if(_cursorTarget == dayz_hasFire) then {
  506. if ((s_player_fireout < 0) && !(inflamed _cursorTarget) && (player distance _cursorTarget < 3)) then {
  507. s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true, "",""];
  508. };
  509. } else {
  510. player removeAction s_player_fireout;
  511. s_player_fireout = -1;
  512. };
  513.  
  514. if(_isTent && (player distance _cursorTarget < 3)) then {
  515. if (_ownerID == dayz_characterID) then {
  516. if (s_player_packtent < 0) then {
  517. s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""];
  518. };
  519. } else {
  520. if(("ItemJerrycan" in _magazinesPlayer) && ("ItemMatchbox_DZE" in weapons player)) then {
  521. if (s_player_packtent < 0) then {
  522. s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  523. };
  524. };
  525. };
  526. } else {
  527. player removeAction s_player_packtent;
  528. s_player_packtent = -1;
  529. };
  530. if((_typeOfCursorTarget in DZE_LockableStorage) && _ownerID != "0" && (player distance _cursorTarget < 3)) then {
  531. if (s_player_unlockvault < 0) then {
  532. if(_typeOfCursorTarget in DZE_LockedStorage) then {
  533. if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then {
  534. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
  535. s_player_combi set [count s_player_combi,_combi];
  536. } else {
  537. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  538. s_player_combi set [count s_player_combi,_combi];
  539. };
  540. s_player_unlockvault = 1;
  541. } else {
  542. if(_ownerID != dayz_combination && _ownerID != dayz_playerUID) then {
  543. _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  544. s_player_combi set [count s_player_combi,_combi];
  545. s_player_unlockvault = 1;
  546. };
  547. };
  548. };
  549. } else {
  550. {player removeAction _x} count s_player_combi;s_player_combi = [];
  551. s_player_unlockvault = -1;
  552. };
  553.  
  554. if(_typeOfCursorTarget in DZE_UnLockedStorage and (player distance _cursorTarget < 3)) then {
  555. if (s_bank_dialog < 0) then {
  556. s_bank_dialog = player addAction ["Online Banking", "Scripts\Gold_Coin_system\Bank_Dialog\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  557. };
  558. } else {
  559. player removeAction s_bank_dialog;
  560. s_bank_dialog = -1;
  561. };
  562.  
  563. if(_typeOfCursorTarget in Bank_Object and (player distance _cursorTarget < 3)) then {
  564. if (s_bank_dialog2 < 0) then {
  565. s_bank_dialog2 = player addAction ["Bank ATM", "Scripts\Gold_Coin_system\Bank_Dialog\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  566. };
  567. } else {
  568. player removeAction s_bank_dialog2;
  569. s_bank_dialog2 = -1;
  570. };
  571.  
  572. if(_typeOfCursorTarget in DZE_UnLockedStorage && _ownerID != "0" && (player distance _cursorTarget < 3)) then {
  573.  
  574. if (s_player_lockvault < 0) then {
  575. if(_ownerID == dayz_combination || _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 && (_ownerID == dayz_combination || _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.  
  583. } else {
  584. player removeAction s_player_packvault;
  585. s_player_packvault = -1;
  586. player removeAction s_player_lockvault;
  587. s_player_lockvault = -1;
  588. };
  589.  
  590. if(_typeOfCursorTarget == "Info_Board_EP1") then {
  591. if (s_player_information < 0) then {
  592. s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true, "",""];
  593. };
  594. } else {
  595. player removeAction s_player_information;
  596. s_player_information = -1;
  597. };
  598.  
  599. if (_isMan and _isAlive and !_isZombie and !_isAnimal and !(_traderType in serverTraders)) then {
  600. if (s_givemoney_dialog < 0) then {
  601. s_givemoney_dialog = player addAction [format["Give Money to %1", (name _cursorTarget)], "Scripts\Gold_Coin_system\Give_Money\give_player_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  602. };
  603. } else {
  604. player removeAction s_givemoney_dialog;
  605. s_givemoney_dialog = -1;
  606. };
  607.  
  608. if(_typeOfCursorTarget in dayz_fuelpumparray) then {
  609. if (s_player_fuelauto < 0) then {
  610.  
  611. _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
  612. _findNearestGen = [];
  613. {
  614. if (alive _x && (_x getVariable ["GeneratorRunning", false])) then {
  615. _findNearestGen set [(count _findNearestGen),_x];
  616. };
  617. } count _findNearestGens;
  618. _IsNearRunningGen = count (_findNearestGen);
  619.  
  620. if(_IsNearRunningGen > 0) then {
  621. s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true, "",""];
  622. } else {
  623. s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  624. };
  625. };
  626. } else {
  627. player removeAction s_player_fuelauto;
  628. s_player_fuelauto = -1;
  629. };
  630.  
  631. if(_typeOfCursorTarget in DZE_fueltruckarray && alive _cursorTarget) then {
  632. if (s_player_fuelauto2 < 0) then {
  633. if(isEngineOn _cursorTarget) then {
  634. s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true, "",""];
  635. } else {
  636. s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  637. };
  638. };
  639. } else {
  640. player removeAction s_player_fuelauto2;
  641. s_player_fuelauto2 = -1;
  642. };
  643.  
  644. if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
  645. if ((s_player_lastTarget select 0) != _cursorTarget) then {
  646. if (s_player_upgrade_build > 0) then {
  647. player removeAction s_player_upgrade_build;
  648. s_player_upgrade_build = -1;
  649. };
  650. };
  651. if (s_player_upgrade_build < 0) then {
  652. s_player_lastTarget set [0,_cursorTarget];
  653. s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "Scripts\custom\BuildVectors\action\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. if((_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") && (DZE_Lock_Door == _ownerID)) then {
  661. if ((s_player_lastTarget select 1) != _cursorTarget) then {
  662. if (s_player_downgrade_build > 0) then {
  663. player removeAction s_player_downgrade_build;
  664. s_player_downgrade_build = -1;
  665. };
  666. };
  667. if (s_player_downgrade_build < 0) then {
  668. s_player_lastTarget set [1,_cursorTarget];
  669. s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "Scripts\custom\BuildVectors\action\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true, "",""];
  670. };
  671. } else {
  672. player removeAction s_player_downgrade_build;
  673. s_player_downgrade_build = -1;
  674. };
  675.  
  676. if((_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ") && (damage _cursorTarget >= DZE_DamageBeforeMaint)) then {
  677. if ((s_player_lastTarget select 2) != _cursorTarget) then {
  678. if (s_player_maint_build > 0) then {
  679. player removeAction s_player_maint_build;
  680. s_player_maint_build = -1;
  681. };
  682. };
  683. if (s_player_maint_build < 0) then {
  684. s_player_lastTarget set [2,_cursorTarget];
  685. 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, "",""];
  686. };
  687. } else {
  688. player removeAction s_player_maint_build;
  689. s_player_maint_build = -1;
  690. };
  691.  
  692. if(_cursorTarget isKindOf "Generator_DZ") then {
  693. if (s_player_fillgen < 0) then {
  694.  
  695. if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
  696. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  697. } else {
  698. if((_cursorTarget getVariable ["GeneratorFilled", false])) then {
  699. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  700. } else {
  701. if("ItemJerrycan" in _magazinesPlayer) then {
  702. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  703. };
  704. };
  705. };
  706. };
  707. } else {
  708. player removeAction s_player_fillgen;
  709. s_player_fillgen = -1;
  710. };
  711.  
  712. if(_isTent && _ownerID == dayz_characterID) then {
  713. if ((s_player_sleep < 0) && (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. _clothesTaken = _cursorTarget getVariable["clothesTaken",false];
  722.  
  723. // Take clothes by Zabn
  724. if (_isMan and !_isAlive and !_isZombie and !_clothesTaken) then {
  725. if (s_player_clothes < 0) then {
  726. s_player_clothes = player addAction [("<t color='#0096ff'>")+("Take Clothes")+("</t>"), "Scripts\Take\player_takeClothes_v2.sqf",[_cursorTarget], -10, false, true, "",""];
  727. };
  728. } else {
  729. player removeAction s_player_clothes;
  730. s_player_clothes = -1;
  731. };
  732.  
  733. if ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) then {
  734. if (s_player_repair_crtl < 0) then {
  735. dayz_myCursorTarget = _cursorTarget;
  736. _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  737. _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  738. s_player_repairActions set [count s_player_repairActions,_menu];
  739. s_player_repairActions set [count s_player_repairActions,_menu1];
  740. s_player_repair_crtl = 1;
  741. } else {
  742. {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  743. s_player_repair_crtl = -1;
  744. };
  745. };
  746.  
  747. if (_isMan && !_isPZombie && _traderType in serverTraders) then {
  748.  
  749. if (s_player_parts_crtl < 0) then {
  750.  
  751. _humanity = player getVariable ["humanity",0];
  752. _traderMenu = call compile format["menu_%1;",_traderType];
  753. _low_high = "low";
  754. _humanity_logic = false;
  755.  
  756. if((_traderMenu select 2) == "friendly") then {
  757. _humanity_logic = (_humanity < -5000);
  758. };
  759. if((_traderMenu select 2) == "hostile") then {
  760. _low_high = "high";
  761. _humanity_logic = (_humanity > -5000);
  762. };
  763. if((_traderMenu select 2) == "hero") then {
  764. _humanity_logic = (_humanity < 5000);
  765. };
  766. if(_humanity_logic) then {
  767. _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
  768. s_player_parts set [count s_player_parts,_cancel];
  769. } else {
  770.  
  771. {
  772. _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, "",""];
  773. s_player_parts set [count s_player_parts,_buy];
  774.  
  775. } count (_traderMenu select 1);
  776. _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  777. s_player_parts set [count s_player_parts,_buy];
  778.  
  779. };
  780. s_player_parts_crtl = 1;
  781. };
  782. } else {
  783. {player removeAction _x} count s_player_parts;s_player_parts = [];
  784. s_player_parts_crtl = -1;
  785. };
  786.  
  787. if(dayz_tameDogs) then {
  788.  
  789. if (_isDog && _isAlive && (_hasRawMeat) && _ownerID == "0" && player getVariable ["dogID", 0] == 0) then {
  790. if (s_player_tamedog < 0) then {
  791. s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""];
  792. };
  793. } else {
  794. player removeAction s_player_tamedog;
  795. s_player_tamedog = -1;
  796. };
  797.  
  798. if (_isDog && _ownerID == dayz_characterID && _isAlive) then {
  799. _dogHandle = player getVariable ["dogID", 0];
  800. if (s_player_feeddog < 0 && _hasRawMeat) then {
  801. s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""];
  802. };
  803. if (s_player_waterdog < 0 && "ItemWaterbottle" in _magazinesPlayer) then {
  804. s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""];
  805. };
  806. if (s_player_staydog < 0) then {
  807. _lieDown = _dogHandle getFSMVariable "_actionLieDown";
  808. if (_lieDown) then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  809. s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true,"",""];
  810. };
  811. if (s_player_trackdog < 0) then {
  812. s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true,"",""];
  813. };
  814. if (s_player_barkdog < 0) then {
  815. s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true,"",""];
  816. };
  817. if (s_player_warndog < 0) then {
  818. _warn = _dogHandle getFSMVariable "_watchDog";
  819. if (_warn) then { _text = (localize "str_epoch_player_247"); _warn = false; } else { _text = (localize "str_epoch_player_248"); _warn = true; };
  820. s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true,"",""];
  821. };
  822. if (s_player_followdog < 0) then {
  823. s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true,"",""];
  824. };
  825. } else {
  826. player removeAction s_player_feeddog;
  827. s_player_feeddog = -1;
  828. player removeAction s_player_waterdog;
  829. s_player_waterdog = -1;
  830. player removeAction s_player_staydog;
  831. s_player_staydog = -1;
  832. player removeAction s_player_trackdog;
  833. s_player_trackdog = -1;
  834. player removeAction s_player_barkdog;
  835. s_player_barkdog = -1;
  836. player removeAction s_player_warndog;
  837. s_player_warndog = -1;
  838. player removeAction s_player_followdog;
  839. s_player_followdog = -1;
  840. };
  841. };
  842.  
  843. } else {
  844.  
  845. {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  846. s_player_repair_crtl = -1;
  847. {player removeAction _x} count s_player_combi;s_player_combi = [];
  848. dayz_myCursorTarget = objNull;
  849. s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  850. {player removeAction _x} count s_player_parts;s_player_parts = [];
  851. s_player_parts_crtl = -1;
  852. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  853. s_player_lockUnlock_crtl = -1;
  854. player removeAction s_player_checkGear;
  855. s_player_checkGear = -1;
  856. player removeAction s_player_SurrenderedGear;
  857. s_player_SurrenderedGear = -1;
  858. player removeAction s_player_forceSave;
  859. s_player_forceSave = -1;
  860. player removeAction s_player_flipveh;
  861. s_player_flipveh = -1;
  862. player removeAction s_player_sleep;
  863. s_player_sleep = -1;
  864. player removeAction s_player_deleteBuild;
  865. s_player_deleteBuild = -1;
  866. player removeAction s_player_butcher;
  867. s_player_butcher = -1;
  868. player removeAction s_player_cook;
  869. s_player_cook = -1;
  870. player removeAction s_player_boil;
  871. s_player_boil = -1;
  872. player removeAction s_player_fireout;
  873. s_player_fireout = -1;
  874. player removeAction s_player_packtent;
  875. s_player_packtent = -1;
  876. player removeAction s_player_fillfuel;
  877. s_player_fillfuel = -1;
  878. player removeAction s_player_studybody;
  879. s_player_studybody = -1;
  880. player removeAction s_player_tamedog;
  881. s_player_tamedog = -1;
  882. player removeAction s_player_feeddog;
  883. s_player_feeddog = -1;
  884. player removeAction s_player_waterdog;
  885. s_player_waterdog = -1;
  886. player removeAction s_player_staydog;
  887. s_player_staydog = -1;
  888. player removeAction s_player_trackdog;
  889. s_player_trackdog = -1;
  890. player removeAction s_player_barkdog;
  891. s_player_barkdog = -1;
  892. player removeAction s_player_warndog;
  893. s_player_warndog = -1;
  894. player removeAction s_player_followdog;
  895. s_player_followdog = -1;
  896. player removeAction s_player_unlockvault;
  897. s_player_unlockvault = -1;
  898. player removeAction s_player_packvault;
  899. s_player_packvault = -1;
  900. player removeAction s_player_lockvault;
  901. s_player_lockvault = -1;
  902. player removeAction s_player_information;
  903. s_player_information = -1;
  904. player removeAction s_player_fillgen;
  905. s_player_fillgen = -1;
  906. player removeAction s_player_upgrade_build;
  907. s_player_upgrade_build = -1;
  908. player removeAction s_player_maint_build;
  909. s_player_maint_build = -1;
  910. player removeAction s_player_downgrade_build;
  911. s_player_downgrade_build = -1;
  912. player removeAction s_player_towing;
  913. s_player_towing = -1;
  914. player removeAction s_player_fuelauto;
  915. s_player_fuelauto = -1;
  916. player removeAction s_player_fuelauto2;
  917. s_player_fuelauto2 = -1;
  918. player removeAction s_givemoney_dialog;
  919. s_givemoney_dialog = -1;
  920. player removeAction s_bank_dialog;
  921. s_bank_dialog = -1;
  922. player removeAction s_bank_dialog2;
  923. s_bank_dialog2 = -1;
  924. player removeAction s_player_packOBJ;
  925. s_player_packOBJ = -1;
  926. player removeAction s_player_clothes;
  927. s_player_clothes = -1;
  928. player removeAction s_player_plotManagement;
  929. s_player_plotManagement = -1;
  930. };
  931.  
  932. _dogHandle = player getVariable ["dogID", 0];
  933.  
  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 && !_inVehicle && alive _dog && _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. };
  960. _weapons = [currentWeapon player] + (weapons player) + (magazines player);
  961. _isBike = typeOf cursorTarget in ["MMT_Civ","MMT_Civ"];
  962.  
  963. //BIKE DEPLOY
  964. if ("ItemToolbox" in _weapons) then {
  965. hasBikeItem = true;
  966. } else { hasBikeItem = false;};
  967. if((speed player <= 1) && hasBikeItem && _canDo) then {
  968. if (s_player_deploybike < 0) then {
  969. s_player_deploybike = player addaction[("<t color=""#007ab7"">" + ("Deploy Bike") +"</t>"),"Scripts\deploys\bike\deploy.sqf","",5,false,true,"", ""];
  970. };
  971. } else {
  972. player removeAction s_player_deploybike;
  973. s_player_deploybike = -1;
  974. };
  975.  
  976. //PACK BIKE
  977. if((_isBike) and _canDo) then {
  978. if (s_player_deploybike2 < 0) then {
  979. s_player_deploybike2 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack Bike") +"</t>"),"Scripts\deploys\bike\pack.sqf","",5,false,true,"", ""];
  980. };
  981. } else {
  982. player removeAction s_player_deploybike2;
  983. s_player_deploybike2 = -1;
  984. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement