Guest User

Untitled

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