Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 75.24 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 ["_buildOwner","_nearestBuilding","_nearestBuildList","_originHousing","_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_ownerID2","_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","_playerUID","_characterID"];
  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 && !r_player_unconscious && !_onLadder);
  17.  
  18. //################################# Hades (www.hellgn.com) && Inkko (opendayz.net) | Door ball ##########################################
  19.  
  20. if ( cursorTarget isKindOf "Infostand_1_EP1" && (player distance cursorTarget) < 2 ) then {
  21. if (s_player_zvonok < 0) then {
  22. s_player_zvonok = player addaction[("<t color=""#0000ff"">" + ("To Ring The Bell") +"</t>"),"zvonok.sqf",cursorTarget,5,false,true,"", ""];
  23. };
  24. } else {
  25. player removeAction s_player_zvonok;
  26. s_player_zvonok = -1;
  27. };
  28.  
  29. //########################### Hades (www.hellgn.com) && Inkko (opendayz.net) | Door ball stop ############################################
  30.  
  31. //################################# Hades | www.hellgn.com | Stove ##########################################
  32.  
  33. if ( cursorTarget isKindOf "MAP_Kitchenstove_Elec_normal" && (player distance cursorTarget) < 2 ) then {
  34. if (s_player_stove < 0) then {
  35. s_player_stove = player addaction[("<t color=""#0000ff"">" + ("Cooking") +"</t>"),"Cooking.sqf",cursorTarget,5,false,true,"", ""];
  36. };
  37. } else {
  38. player removeAction s_player_stove;
  39. s_player_stove = -1;
  40. };
  41.  
  42. //########################### Hades | www.hellgn.com | Stove stop ############################################
  43.  
  44. //################################# Hades | www.hellgn.com | Sleep at bad ##########################################
  45.  
  46. if ( cursorTarget isKindOf "MAP_bed_husbands" || cursorTarget isKindOf "MAP_F_postel_manz_kov" || cursorTarget isKindOf "MAP_F_postel_panelak2" || cursorTarget isKindOf "MAP_F_Vojenska_palanda" || cursorTarget isKindOf "MAP_postel_manz_kov" || cursorTarget isKindOf "MAP_postel_panelak1" || cursorTarget isKindOf "MAP_vojenska_palanda" && (player distance cursorTarget) < 2 ) then {
  47. if (s_player_son < 0) then {
  48. s_player_son = player addaction[("<t color=""#0000ff"">" + ("Sleep") +"</t>"),"\z\addons\dayz_code\actions\player_sleep.sqf",cursorTarget,5,false,true,"", ""];
  49. };
  50. } else {
  51. player removeAction s_player_son;
  52. s_player_son = -1;
  53. };
  54.  
  55. //########################### Hades | www.hellgn.com | Sleep at bad stop ############################################
  56.  
  57. //################################# Hades (www.hellgn.com) && Inkko (opendayz.net) | Radio music ##########################################
  58.  
  59. if ( cursorTarget isKindOf "MAP_radio_b_normal" && (player distance cursorTarget) < 2 ) then {
  60. if (s_player_radio_1 < 0) then {
  61. s_player_radio_1 = player addaction[("<t color=""#0000ff"">" + ("Михаил Шуфутинский - Наколочка") +"</t>"),"radio\radio_1.sqf",cursorTarget,5,false,true,"", ""];
  62. };
  63. /*
  64. if (s_player_radio_2 < 0) then {
  65. s_player_radio_2 = player addaction[("<t color=""#0000ff"">" + ("Test 2") +"</t>"),"radio\radio_2.sqf",cursorTarget,5,false,true,"", ""];
  66. };
  67. if (s_player_radio_3 < 0) then {
  68. s_player_radio_3 = player addaction[("<t color=""#0000ff"">" + ("Test 3") +"</t>"),"radio\radio_3.sqf",cursorTarget,5,false,true,"", ""];
  69. };
  70. */
  71. } else {
  72. player removeAction s_player_radio_1;
  73. s_player_radio_1 = -1;
  74. /*
  75. player removeAction s_player_radio_2;
  76. s_player_radio_2 = -1;
  77. player removeAction s_player_radio_3;
  78. s_player_radio_3 = -1;
  79. */
  80. };
  81.  
  82. //########################### Hades (www.hellgn.com) && Inkko (opendayz.net) | Radio music stop ############################################
  83.  
  84. //################################# Hades | www.hellgn.com | Dog house ##########################################
  85.  
  86. if ( cursorTarget isKindOf "Land_psi_bouda" && (player distance cursorTarget) < 2 ) then {
  87. if (s_player_call_a_dog < 0) then {
  88. s_player_call_a_dog = player addaction[("<t color=""#0000ff"">" + ("Call A Dog") +"</t>"),"spawndog.sqf","",5,false,true,"", ""];
  89. };
  90. } else {
  91. player removeAction s_player_call_a_dog;
  92. s_player_call_a_dog = -1;
  93. };
  94.  
  95. //########################### Hades | www.hellgn.com | Dog house stop ############################################
  96.  
  97. //################################# Hades | www.hellgn.com | Cow house ##########################################
  98.  
  99. if ( cursorTarget isKindOf "Land_Farm_Cowshed_a_normal" && (player distance cursorTarget) < 5 ) then {
  100. if (s_player_call_a_cow < 0) then {
  101. s_player_call_a_cow = player addaction[("<t color=""#0000ff"">" + ("Call A Cow") +"</t>"),"spawncow.sqf","",5,false,true,"", ""];
  102. };
  103. } else {
  104. player removeAction s_player_call_a_cow;
  105. s_player_call_a_cow = -1;
  106. };
  107.  
  108. //########################### Hades | www.hellgn.com | Cow house stop ############################################
  109.  
  110. _adminsList= call compile preProcessFileLineNumbers "superadmins.sqf";
  111. if(("ItemMap_Debug" in items player) and ((getPlayerUID player) in _adminsList)) then {
  112. if (s_player_run_events < 0) then {
  113. s_player_run_events = player addaction [("<t color=""#0074E8"">" + ("Events Menu") +"</t>"),"custom\fixes\execute.sqf","",5,false,true,"",""];
  114. };
  115. } else {
  116. player removeAction s_player_run_events;
  117. s_player_run_events = -1;
  118. };
  119.  
  120. _nearLight = nearestObject [player,"LitObject"];
  121. _canPickLight = false;
  122.  
  123. if (!isNull _nearLight) then {
  124. if (_nearLight distance player < 4) then {
  125. _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
  126. };
  127. };
  128.  
  129. //Grab Flare
  130. if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
  131. if (s_player_grabflare < 0) then {
  132. _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
  133. s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
  134. s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
  135. };
  136. } else {
  137. player removeAction s_player_grabflare;
  138. player removeAction s_player_removeflare;
  139. s_player_grabflare = -1;
  140. s_player_removeflare = -1;
  141. };
  142.  
  143. if (_inVehicle && {_vehicle isKindOf "MV22"}) then {
  144. if (isEngineOn _vehicle) then {[_vehicle,0] call mv22_pack;};
  145. if (mv22_fold < 0) then {
  146. themv22 = _vehicle;
  147. if !(isEngineOn themv22) then {
  148. mv22_fold = themv22 addAction ["Fold","scripts\animate\mv22_fold.sqf","",5,false,true];
  149. mv22_unfold = themv22 addAction ["UnFold","scripts\animate\mv22_unfold.sqf","",5,false,true];
  150. mv22_open = themv22 addAction ["Open Ramp","scripts\animate\mv22_open.sqf","",5,false,true];
  151. mv22_close = themv22 addAction ["Close Ramp","scripts\animate\mv22_close.sqf","",5,false,true];
  152. };
  153. };
  154. if (isEngineOn themv22) then {
  155. themv22 removeAction mv22_fold;
  156. mv22_fold = -1;
  157. themv22 removeAction mv22_unfold;
  158. mv22_unfold = -1;
  159. themv22 removeAction mv22_open;
  160. mv22_open = -1;
  161. themv22 removeAction mv22_close;
  162. mv22_close = -1;
  163. };
  164. } else {
  165. if (!isNil "themv22") then {
  166. themv22 removeAction mv22_fold;
  167. mv22_fold = -1;
  168. themv22 removeAction mv22_unfold;
  169. mv22_unfold = -1;
  170. themv22 removeAction mv22_open;
  171. mv22_open = -1;
  172. themv22 removeAction mv22_close;
  173. mv22_close = -1;
  174. };
  175. };
  176.  
  177. if (_inVehicle && {_vehicle isKindOf "ArmoredSUV_Base_PMC"}) then {
  178. if ((_vehicle animationPhase "HideGun_01") == 1) then {
  179. _unit = _vehicle turretUnit [0];
  180. if (!(isNull _unit)) then {
  181. _unit action ["moveToCargo",_vehicle,2];
  182. titleText ["\n\nYou must open the hatch first.","PLAIN DOWN"];titleFadeOut 4;
  183. };
  184. };
  185. if (suv_close < 0) then {
  186. thesuv = _vehicle;
  187. suv_close = thesuv addAction ["Close Hatch","scripts\animate\suv_close.sqf","",5,false,true];
  188. suv_open = thesuv addAction ["Open Hatch","scripts\animate\suv_open.sqf","",5,false,true];
  189. };
  190. } else {
  191. if (!isNil "thesuv") then {
  192. thesuv removeAction suv_close;
  193. suv_close = -1;
  194. thesuv removeAction suv_open;
  195. suv_open = -1;
  196. };
  197. };
  198.  
  199. if (_inVehicle && {(typeOf _vehicle) in ["UH1Y","UH1Y_DZ","UH1Y_DZE"]}) then {
  200. if (isEngineOn _vehicle) then {[_vehicle,0] call uh1y_pack;};
  201. if (uh1y_fold < 0) then {
  202. theuh1y = _vehicle;
  203. if !(isEngineOn theuh1y) then {
  204. uh1y_fold = theuh1y addAction ["Fold","scripts\animate\uh1y_fold.sqf","",5,false,true];
  205. uh1y_unfold = theuh1y addAction ["UnFold","scripts\animate\uh1y_unfold.sqf","",5,false,true];
  206. };
  207. };
  208. if (isEngineOn theuh1y) then {
  209. theuh1y removeAction uh1y_fold;
  210. uh1y_fold = -1;
  211. theuh1y removeAction uh1y_unfold;
  212. uh1y_unfold = -1;
  213. };
  214. } else {
  215. if (!isNil "theuh1y") then {
  216. theuh1y removeAction uh1y_fold;
  217. uh1y_fold = -1;
  218. theuh1y removeAction uh1y_unfold;
  219. uh1y_unfold = -1;
  220. };
  221. };
  222.  
  223. if (_inVehicle && {_vehicle isKindOf "AH1Z"}) then {
  224. if (isEngineOn _vehicle) then {[_vehicle,0] call ah1z_pack;};
  225. if (ah1z_fold < 0) then {
  226. theah1z = _vehicle;
  227. if !(isEngineOn theah1z) then {
  228. ah1z_fold = theah1z addAction ["Fold","scripts\animate\ah1z_fold.sqf","",5,false,true];
  229. ah1z_unfold = theah1z addAction ["UnFold","scripts\animate\ah1z_unfold.sqf","",5,false,true];
  230. };
  231. };
  232. if (isEngineOn theah1z) then {
  233. theah1z removeAction ah1z_fold;
  234. ah1z_fold = -1;
  235. theah1z removeAction ah1z_unfold;
  236. ah1z_unfold = -1;
  237. };
  238. } else {
  239. if (!isNil "theah1z") then {
  240. theah1z removeAction ah1z_fold;
  241. ah1z_fold = -1;
  242. theah1z removeAction ah1z_unfold;
  243. ah1z_unfold = -1;
  244. };
  245. };
  246.  
  247. if (DZE_HeliLift) then {
  248. _hasAttached = _vehicle getVariable["hasAttached",false];
  249. if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) < 30) && (speed _vehicle < 5) && (typeName _hasAttached == "OBJECT")) then {
  250. if (s_player_heli_detach < 0) then {
  251. dayz_myLiftVehicle = _vehicle;
  252. s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""];
  253. };
  254. } else {
  255. dayz_myLiftVehicle removeAction s_player_heli_detach;
  256. s_player_heli_detach = -1;
  257. };
  258. };
  259.  
  260. if(DZE_HaloJump) then {
  261. if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) > 400)) then {
  262. if (s_halo_action < 0) then {
  263. DZE_myHaloVehicle = _vehicle;
  264. s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""];
  265. };
  266. } else {
  267. DZE_myHaloVehicle removeAction s_halo_action;
  268. s_halo_action = -1;
  269. };
  270. };
  271.  
  272. if (!DZE_ForceNameTagsOff) then {
  273. if (s_player_showname < 0 && !_isPZombie) then {
  274. if (DZE_ForceNameTags) then {
  275. s_player_showname = 1;
  276. player setVariable["DZE_display_name",true,true];
  277. } else {
  278. s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false, "",""];
  279. s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false, "",""];
  280. };
  281. };
  282. };
  283.  
  284. if(DZE_Origins_Building_System) then {
  285. if(isnil "s_player_build_origins_H1") then {s_player_build_origins_H1 = -1;};
  286. if(isnil "s_player_build_origins_B1") then {s_player_build_origins_B1 = -1;};
  287. if(isnil "s_player_build_origins_H2") then {s_player_build_origins_H2 = -1;};
  288. if(isnil "s_player_build_origins_B2") then {s_player_build_origins_B2 = -1;};
  289. if(isnil "s_player_build_origins_H3") then {s_player_build_origins_H3 = -1;};
  290. if(isnil "s_player_build_origins_B3") then {s_player_build_origins_B3 = -1;};
  291. if(isnil "s_player_build_origins_SG") then {s_player_build_origins_SG = -1;};
  292. if(isnil "s_player_build_origins_LG") then {s_player_build_origins_LG = -1;};
  293. if(isnil "s_player_build_origins_KING") then {s_player_build_origins_KING = -1;};
  294. if(isnil "s_player_build_origins_SH") then {s_player_build_origins_SH = -1;};
  295.  
  296. if(isnil "s_player_build_origins_NESTLVL1H") then {s_player_build_origins_NESTLVL1H = -1;};
  297. if(isnil "s_player_build_origins_NESTLVL2H") then {s_player_build_origins_NESTLVL2H = -1;};
  298. if(isnil "s_player_build_origins_NESTLVL3H") then {s_player_build_origins_NESTLVL3H = -1;};
  299. if(isnil "s_player_build_origins_NESTLVL1B") then {s_player_build_origins_NESTLVL1B = -1;};
  300. if(isnil "s_player_build_origins_NESTLVL2B") then {s_player_build_origins_NESTLVL2B = -1;};
  301. if(isnil "s_player_build_origins_NESTLVL3B") then {s_player_build_origins_NESTLVL3B = -1;};
  302.  
  303. if(isnil "s_player_build_origins_H4") then {s_player_build_origins_H4 = -1;};
  304. if(isnil "s_player_build_origins_B4") then {s_player_build_origins_B4 = -1;};
  305.  
  306. if(isnil "s_player_origins_unlock") then {s_player_origins_unlock = -1;};
  307. if(isnil "s_player_origins_stronghold_doors") then {s_player_origins_stronghold_doors = -1;};
  308.  
  309. _cursorTarget = cursorTarget;
  310. if (!isNull _cursorTarget) then {
  311. _typeOfCursorTarget = (typeOf _cursorTarget);
  312. if(_typeOfCursorTarget == DZE_Origins_Container ) then {
  313. if((player distance _cursorTarget) < DZE_Origins_Build_Distance) then {
  314.  
  315. private["_humanity","_houselevel","_humanityNeed","_actionText","_classname","_neededMaterials"];
  316.  
  317. _humanity = player getVariable["humanity",0];
  318.  
  319. {
  320. _houselevel = _x select 0;
  321. _humanityNeed = _x select 1;
  322. _actionText = _x select 2;
  323. _classname = _x select 3;
  324. _neededMaterials = _x select 4;
  325.  
  326. if((_humanityNeed > 0 && _humanity >= _humanityNeed) || (_humanityNeed < 0 && _humanity <= _humanityNeed)) then {
  327.  
  328. if(_houselevel in ["H1"] ) then {
  329. if(s_player_build_origins_H1 < 0) then {
  330. s_player_build_origins_H1 = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  331. };
  332. };
  333. if(_houselevel in ["H2"] ) then {
  334. if(s_player_build_origins_H2 < 0) then {
  335. s_player_build_origins_H2 = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  336. };
  337. };
  338. if(_houselevel in ["H3"] ) then {
  339. if(s_player_build_origins_H3 < 0) then {
  340. s_player_build_origins_H3 = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  341. };
  342. };
  343. if(_houselevel in ["B1"] ) then {
  344. if(s_player_build_origins_B1 < 0) then {
  345. s_player_build_origins_B1 = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  346. };
  347. };
  348. if(_houselevel in ["B2"] ) then {
  349. if(s_player_build_origins_B2 < 0) then {
  350. s_player_build_origins_B2 = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  351. };
  352. };
  353. if(_houselevel in ["B3"] ) then {
  354. if(s_player_build_origins_B3 < 0) then {
  355. s_player_build_origins_B3 = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  356. };
  357. };
  358. if(_houselevel in ["SGH","SGB"] ) then {
  359. if(s_player_build_origins_SG < 0) then {
  360. s_player_build_origins_SG = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  361. };
  362. };
  363. if(_houselevel in ["LGH","LGB"] ) then {
  364. if(s_player_build_origins_LG < 0) then {
  365. s_player_build_origins_LG = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  366. };
  367. };
  368. if(_houselevel in ["KINGH","KINGB"] ) then {
  369. if(s_player_build_origins_KING < 0) then {
  370. s_player_build_origins_KING = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  371. };
  372. };
  373. if(_houselevel in ["SHH","SHB"] ) then {
  374. if(s_player_build_origins_SH < 0) then {
  375. s_player_build_origins_SH = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  376. };
  377. };
  378.  
  379.  
  380. if(_houselevel in ["NESTLVL1H"] ) then {
  381. if(s_player_build_origins_NESTLVL1H < 0) then {
  382. s_player_build_origins_NESTLVL1H = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  383. };
  384. };
  385.  
  386. if(_houselevel in ["NESTLVL2H"] ) then {
  387. if(s_player_build_origins_NESTLVL2H < 0) then {
  388. s_player_build_origins_NESTLVL2H = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  389. };
  390. };
  391.  
  392. if(_houselevel in ["NESTLVL3H"] ) then {
  393. if(s_player_build_origins_NESTLVL3H < 0) then {
  394. s_player_build_origins_NESTLVL3H = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  395. };
  396. };
  397.  
  398. if(_houselevel in ["NESTLVL1B"] ) then {
  399. if(s_player_build_origins_NESTLVL1B < 0) then {
  400. s_player_build_origins_NESTLVL1B = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  401. };
  402. };
  403.  
  404. if(_houselevel in ["NESTLVL2B"] ) then {
  405. if(s_player_build_origins_NESTLVL2B < 0) then {
  406. s_player_build_origins_NESTLVL2B = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  407. };
  408. };
  409.  
  410. if(_houselevel in ["NESTLVL3B"] ) then {
  411. if(s_player_build_origins_NESTLVL3B < 0) then {
  412. s_player_build_origins_NESTLVL3B = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  413. };
  414. };
  415.  
  416.  
  417. if(_houselevel in ["H4"] ) then {
  418. if(s_player_build_origins_H4 < 0) then {
  419. s_player_build_origins_H4 = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  420. };
  421. };
  422.  
  423. if(_houselevel in ["B4"] ) then {
  424. if(s_player_build_origins_B4 < 0) then {
  425. s_player_build_origins_B4 = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
  426. };
  427. };
  428.  
  429.  
  430. };
  431.  
  432. } forEach DZE_Origins_Build_HousesGarages;
  433. } else {
  434. [1] call origins_removeActions;
  435. };
  436. };
  437.  
  438. if(_typeOfCursorTarget in DZE_Origins_Buildings && (player distance _cursorTarget) < DZE_Origins_LockUnlock_Distance) then {
  439. private["_ownerUID","_ownerName","_playerUID","_state","_openClose"];
  440. _playerUID = dayz_playerUID;
  441. _ownerUID = _cursorTarget getVariable ["OwnerUID","0"];
  442. _ownerName = _cursorTarget getVariable ["OwnerName","0"];
  443.  
  444. if(_playerUID != _ownerUID && !(_typeOfCursorTarget in DZE_Origins_Stronghold)) exitWith {
  445. cutText [format["This house was built by %1", _ownerName], "PLAIN DOWN",5];
  446. sleep 5;
  447. };
  448. _state = (_cursorTarget getVariable ["CanBeUpdated",false]);
  449. if(_typeOfCursorTarget in DZE_Origins_Stronghold && _state) then {
  450. private["_strongholdDoorsOpen"];
  451. _strongholdDoorsOpen = (_cursorTarget getVariable ["DoorsOpen",false]);
  452. if(_strongholdDoorsOpen) then {
  453. if(s_player_origins_stronghold_doors < 0) then {
  454. s_player_origins_stronghold_doors = player addAction [ "Close Doors","origins\origins_strongholdDoors.sqf",[_cursorTarget,0]];
  455. };
  456. } else {
  457. if(s_player_origins_stronghold_doors < 0)then {
  458. s_player_origins_stronghold_doors = player addAction [ "Open Doors","origins\origins_strongholdDoors.sqf",[_cursorTarget,1]];
  459. };
  460. };
  461. } else {
  462. [3] call origins_removeActions;
  463. };
  464.  
  465. if(s_player_origins_unlock < 0) then {
  466.  
  467. //########################### Hades | www.hellgn.com | Open\close helipads for electro nests ############################################
  468.  
  469. if(_typeOfCursorTarget == "elektro3_hero" && (player distance _cursorTarget < 25)) then {
  470. player addAction ["Open Helipad In Hero Nest", "scripts\open_helipad_h.sqf",_cursorTarget, 0, false, true, "",""];
  471. };
  472.  
  473. if(_typeOfCursorTarget == "elektro3_hero" && (player distance _cursorTarget < 25)) then {
  474. player addAction ["Close Helipad In Hero Nest", "scripts\close_helipad_h.sqf",_cursorTarget, 0, false, true, "",""];
  475. };
  476.  
  477. if(_typeOfCursorTarget == "elektro3" && (player distance _cursorTarget < 25)) then {
  478. player addAction ["Open Helipad In Bandit Nest", "scripts\open_helipad_b.sqf",_cursorTarget, 0, false, true, "",""];
  479. };
  480.  
  481. if(_typeOfCursorTarget == "elektro3" && (player distance _cursorTarget < 25)) then {
  482. player addAction ["Close Helipad In Bandit Nest", "scripts\close_helipad_b.sqf",_cursorTarget, 0, false, true, "",""];
  483. };
  484.  
  485. //########################### Hades | www.hellgn.com | Open\close helipads for electro nests stop ############################################
  486.  
  487. _matched = false;
  488. {
  489. if(_typeOfCursorTarget == (_x select 0)) then {
  490. if(_state) then {
  491. _openClose = format["Lock %1", _X select 1];
  492. } else {
  493. _openClose = format["Unlock %1", _X select 1];
  494. };
  495. _matched = true;
  496. };
  497. if (_matched) exitWith {
  498. s_player_origins_unlock = player addAction [_openClose, "origins\player_lockUnlock.sqf", [_cursorTarget,_typeOfCursorTarget,_state]];
  499. };
  500. } count DZE_Origins_NameLookup;
  501. };
  502. } else {
  503. [2] call origins_removeActions;
  504. };
  505. } else {
  506. [0] call origins_removeActions;
  507. };
  508. };
  509.  
  510. //allow demolition of Origins Housing
  511. if (typeOf _vehicle =="ori_excavator") then
  512. {
  513. if (bucketOut < 0) then {
  514. bucketOut = _vehicle addAction ["Bucket Out","custom\build\bucketOut.sqf","",5,false,true];
  515. };
  516. if(bucketIn < 0) then {
  517. bucketIn = _vehicle addAction ["Bucket In","custom\build\bucketIn.sqf","",5,false,true];
  518. };
  519. _nearestBuildList = [];
  520. _nearestBuilding = "";
  521. _originHousing = DZE_Origins_Buildings;
  522. _nearestBuildList = nearestObjects [_vehicle, _originHousing, 20];
  523. _nearestBuilding = _nearestBuildList select 0;
  524.  
  525. if(!isNil "_nearestBuilding") then
  526. {
  527. _buildOwner = _nearestBuilding getVariable['OwnerUID','0'];
  528.  
  529. if(s_demolish < 0) then {
  530. if (_buildOwner == (getplayerUID player)) then {
  531. s_demolish = _vehicle addaction [("<t color=""#ff0000"">" + format["Demolish %1",typeOf(_nearestBuilding)] +"</t>"),"custom\build\demolish.sqf",_nearestBuilding,6,false,true,"",""];
  532. sleep 5;
  533. };
  534. } else {
  535. _vehicle removeAction s_demolish;
  536. s_demolish = -1;
  537. };
  538. } else {
  539. if(!isNil "player") then {
  540. _vehicle removeAction s_demolish;
  541. s_demolish = -1;
  542. };
  543. };
  544. } else {
  545. _vehicle removeAction bucketIn;
  546. bucketIn = -1;
  547. _vehicle removeAction bucketOut;
  548. bucketOut = -1;
  549. _vehicle removeAction s_demolish;
  550. s_demolish = -1;
  551. };
  552.  
  553. //Submarine Submerging
  554. if (typeOf _vehicle == "ori_submarine" && surfaceIsWater position player) then {
  555.  
  556. if ((_vehicle animationPhase "sink") == 1) then {
  557. if (sub_Up < 0) then {
  558. sub_Up = _vehicle addAction ["Rise","scripts\sub_UPDown.sqf",0,5,false,true];
  559. };
  560. } else {
  561. if (sub_down < 0) then {
  562. sub_Down = _vehicle addAction ["Submerge","scripts\sub_UPDown.sqf",1,5,false,true];
  563. };
  564. };
  565. } else {
  566. _vehicle removeAction sub_Up;
  567. sub_Up = -1;
  568. _vehicle removeAction sub_Down;
  569. sub_Down = -1;
  570. };
  571.  
  572. if(_isPZombie) then {
  573. if (s_player_callzombies < 0) then {
  574. s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
  575. };
  576. if (DZE_PZATTACK) then {
  577. call pz_attack;
  578. DZE_PZATTACK = false;
  579. };
  580. if (s_player_pzombiesvision < 0) then {
  581. 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"];
  582. };
  583. if (!isNull cursorTarget && (player distance cursorTarget < 3)) then { //Has some kind of target
  584. _isAnimal = cursorTarget isKindOf "Animal";
  585. _isZombie = cursorTarget isKindOf "zZombie_base";
  586. _isHarvested = cursorTarget getVariable["meatHarvested",false];
  587. _isMan = cursorTarget isKindOf "Man";
  588. // Pzombie Gut human corpse || animal
  589. if (!alive cursorTarget && (_isAnimal || _isMan) && !_isZombie && !_isHarvested) then {
  590. if (s_player_pzombiesfeed < 0) then {
  591. s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""];
  592. };
  593. } else {
  594. player removeAction s_player_pzombiesfeed;
  595. s_player_pzombiesfeed = -1;
  596. };
  597. } else {
  598. player removeAction s_player_pzombiesfeed;
  599. s_player_pzombiesfeed = -1;
  600. };
  601. };
  602.  
  603. // Increase distance only if AIR || SHIP
  604. _allowedDistance = 4;
  605. _isAir = cursorTarget isKindOf "Air";
  606. _isShip = cursorTarget isKindOf "Ship";
  607. if(_isAir || _isShip || (typeOf cursorTarget in ["BMP2_HQ_TK_EP1","BMP2_HQ_CDF"]) ) then {
  608. _allowedDistance = 8;
  609. };
  610.  
  611. if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then { //Has some kind of target
  612.  
  613. // set cursortarget to variable
  614. _cursorTarget = cursorTarget;
  615.  
  616. // get typeof cursortarget once
  617. _typeOfCursorTarget = typeOf _cursorTarget;
  618.  
  619. // hintsilent _typeOfCursorTarget;
  620.  
  621. _isVehicle = _cursorTarget isKindOf "AllVehicles";
  622. _isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
  623. _isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
  624.  
  625. // get items && magazines only once
  626. _magazinesPlayer = magazines player;
  627.  
  628. //boiled Water
  629. _hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
  630. _hastinitem = false;
  631. {
  632. if (_x in _magazinesPlayer) then {
  633. _hastinitem = true;
  634. };
  635. } count boil_tin_cans;
  636. _hasFuelE = "ItemJerrycanEmpty" in _magazinesPlayer;
  637. _hasFuelBarrelE = "ItemFuelBarrelEmpty" in _magazinesPlayer;
  638. _hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
  639.  
  640. _itemsPlayer = items player;
  641.  
  642. _temp_keys = [];
  643. _temp_keys_names = [];
  644. // find available keys
  645. _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
  646. {
  647. if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
  648. _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
  649. _ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
  650. _temp_keys_names set [_ownerKeyId,_ownerKeyName];
  651. _temp_keys set [count _temp_keys,str(_ownerKeyId)];
  652. };
  653. } count _itemsPlayer;
  654.  
  655. _hasKnife = "ItemKnife" in _itemsPlayer;
  656. _hasToolbox = "ItemToolbox" in _itemsPlayer;
  657.  
  658. _playerUID = getPlayerUID player;
  659. _isMan = _cursorTarget isKindOf "Man";
  660. _traderType = _typeOfCursorTarget;
  661.  
  662. _ownerID = _cursorTarget getVariable ["ownerPUID","0"];
  663. _ownerID2 = _cursorTarget getVariable ["CharacterID","0"];
  664.  
  665. _characterID = _cursorTarget getVariable ["CharacterID","0"];
  666. _isAnimal = _cursorTarget isKindOf "Animal";
  667. _isDog = (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
  668. _isZombie = _cursorTarget isKindOf "zZombie_base";
  669. _isDestructable = _cursorTarget isKindOf "BuiltItems";
  670. _isWreck = _typeOfCursorTarget in DZE_isWreck;
  671. _isWreckBuilding = _typeOfCursorTarget in DZE_isWreckBuilding;
  672. _isModular = (_cursorTarget isKindOf "ModularItems") or ((typeOf _cursorTarget) in Custom_Buildables);
  673. _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
  674.  
  675. _isRemovable = _typeOfCursorTarget in DZE_isRemovable;
  676. _isDisallowRepair = _typeOfCursorTarget in ["M240Nest_DZ"];
  677.  
  678. _isTent = _cursorTarget isKindOf "TentStorage";
  679.  
  680. _isAlive = alive _cursorTarget;
  681.  
  682. _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
  683.  
  684. _rawmeat = meatraw;
  685. _hasRawMeat = false;
  686. {
  687. if (_x in _magazinesPlayer) then {
  688. _hasRawMeat = true;
  689. };
  690. } count _rawmeat;
  691.  
  692. _isFuel = false;
  693. if (_hasFuelE || _hasFuelBarrelE) then {
  694. {
  695. if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
  696. } count dayz_fuelsources;
  697. };
  698.  
  699. // diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID));
  700.  
  701. // logic vars
  702. _player_flipveh = false;
  703. _player_deleteBuild = false;
  704. _player_lockUnlock_crtl = false;
  705.  
  706. if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
  707. if (s_player_plotManagement < 0) then {
  708. _adminList = ["76561198049704275"]; // Add admins here if you admins to able to manage all plotpoles
  709. _owner = _cursorTarget getVariable ["CharacterID","0"];
  710. _friends = _cursorTarget getVariable ["plotfriends", []];
  711. _fuid = [];
  712. {
  713. _friendUID = _x select 0;
  714. _fuid = _fuid + [_friendUID];
  715. } forEach _friends;
  716. _allowed = [_owner];
  717. _allowed = [_owner] + _adminList + _fuid;
  718. if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then{
  719. s_player_plotManagement = player addAction ["<t color='#0059FF'>Manage Plot</t>", "plotManagement\initPlotManagement.sqf", [], 5, false];
  720. };
  721. };
  722. if (s_player_maintain_area < 0) then {
  723. s_player_maintain_area = player addAction [format[], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
  724. s_player_maintain_area_preview = player addAction [format[], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
  725. };
  726. } else {
  727. player removeAction s_player_plotManagement;
  728. s_player_plotManagement = -1;
  729. player removeAction s_player_maintain_area;
  730. s_player_maintain_area = -1;
  731. player removeAction s_player_maintain_area_preview;
  732. s_player_maintain_area_preview = -1;
  733. };
  734.  
  735. // CURSOR TARGET ALIVE
  736. if(_isAlive) then {
  737.  
  738. //diag_log format["fn_actons: [PlayerUID: %1] [_ownerID: %2] [_isModularDoor: %3] [typeOfCursorTarget: %4]",_playerUID, _ownerID, _isModularDoor, _typeOfCursorTarget];
  739. //diag_log format["[_isDestructable:%1 ] [_isWreck: %2 ] [_isRemovable: %3 ] [_isWreckBuilding: %4 ]",_isDestructable, _isWreck, _isRemovable, _isWreckBuilding];
  740.  
  741. //Allow player to delete objects
  742. if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
  743. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  744. _player_deleteBuild = true;
  745. };
  746. };
  747.  
  748. ///Allow owners to delete modulars
  749. if(_isModular) then {
  750. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  751. _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
  752. _IsNearPlot = count (_findNearestPoles);
  753. _fuid = [];
  754. _allowed = [];
  755. if(_IsNearPlot > 0)then{
  756. _thePlot = _findNearestPoles select 0;
  757. _owner = _thePlot getVariable ["ownerPUID","010"];
  758. _friends = _thePlot getVariable ["plotfriends", []];
  759. {
  760. _friendUID = _x select 0;
  761. _fuid = _fuid + [_friendUID];
  762. } forEach _friends;
  763. _allowed = [_owner];
  764. _allowed = [_owner] + _fuid;
  765. if ( _playerUID in _allowed && _ownerID in _allowed ) then {
  766. _player_deleteBuild = true;
  767. };
  768. }else{
  769. if(_ownerID == _playerUID)then{
  770. _player_deleteBuild = true;
  771. };
  772. };
  773. };
  774. };
  775. //Allow owners to delete modular doors without locks
  776. if(_isModularDoor) then {
  777. if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
  778. _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
  779. _IsNearPlot = count (_findNearestPoles);
  780. _fuid = [];
  781. _allowed = [];
  782. if(_IsNearPlot > 0)then{
  783. _thePlot = _findNearestPoles select 0;
  784. _owner = _thePlot getVariable ["ownerPUID","010"];
  785. _friends = _thePlot getVariable ["plotfriends", []];
  786. {
  787. _friendUID = _x select 0;
  788. _fuid = _fuid + [_friendUID];
  789. } forEach _friends;
  790. _allowed = [_owner];
  791. _allowed = [_owner] + _fuid;
  792. if ( _playerUID in _allowed && _ownerID in _allowed) then {
  793. _player_deleteBuild = true;
  794. };
  795. }else{
  796. if(_ownerID == _playerUID)then{
  797. _player_deleteBuild = true;
  798. };
  799. };
  800. };
  801. };
  802.  
  803. // CURSOR TARGET VEHICLE
  804. if(_isVehicle) then {
  805.  
  806. //flip vehicle small vehicles by your self && all other vehicles with help nearby
  807. if (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (count (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) select 2) < 0.5) then {
  808. _playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
  809. if(_isVehicletype || (_playersNear >= 2)) then {
  810. _player_flipveh = true;
  811. };
  812. };
  813.  
  814.  
  815. if(!_isMan && _characterID != "0" && !(_cursorTarget isKindOf "Bicycle")) then {
  816. _player_lockUnlock_crtl = true;
  817. };
  818.  
  819. };
  820.  
  821. };
  822.  
  823. if(_player_deleteBuild) then {
  824. if (s_player_deleteBuild < 0) then {
  825. s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  826. };
  827. } else {
  828. player removeAction s_player_deleteBuild;
  829. s_player_deleteBuild = -1;
  830. };
  831.  
  832. if (DZE_HeliLift) then {
  833. _liftHeli = objNull;
  834. _found = false;
  835.  
  836. _allowTow = false;
  837. if ((count (crew _cursorTarget)) == 0) then {
  838. {
  839. if(!_allowTow) then {
  840. _allowTow = _cursorTarget isKindOf _x;
  841. };
  842. } count DZE_HeliAllowToTow;
  843. };
  844.  
  845. //diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow];
  846.  
  847. if (_allowTow) then {
  848. _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
  849. {
  850. if(!_found) then {
  851. _posL = [_x] call FNC_getPos;
  852. _posC = [_cursorTarget] call FNC_getPos;
  853. _height = (_posL select 2) - (_posC select 2);
  854. _hasAttached = _x getVariable["hasAttached",false];
  855. if(_height < 15 && _height > 5 && (typeName _hasAttached != "OBJECT")) then {
  856. if(((abs((_posL select 0) - (_posC select 0))) < 10) && ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
  857. _liftHeli = _x;
  858. _found = true;
  859. };
  860. };
  861. };
  862. } count _liftHelis;
  863. };
  864.  
  865. //diag_log format["HELI: %1 TARGET: %2",_found,_cursorTarget];
  866.  
  867. _attached = _cursorTarget getVariable["attached",false];
  868. if(_found && _allowTow && _canDo && !locked _cursorTarget && !_isPZombie && (typeName _attached != "OBJECT")) then {
  869. if (s_player_heli_lift < 0) then {
  870. s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true, "",""];
  871. };
  872. } else {
  873. player removeAction s_player_heli_lift;
  874. s_player_heli_lift = -1;
  875. };
  876. };
  877.  
  878. // Allow Owner to lock && unlock vehicle
  879. if(_player_lockUnlock_crtl) then {
  880. if (s_player_lockUnlock_crtl < 0) then {
  881. _hasKey = _characterID in _temp_keys;
  882. _oldOwner = (_characterID == dayz_playerUID);
  883. if(locked _cursorTarget) then {
  884. if(_hasKey || _oldOwner) then {
  885. _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (parseNumber _characterID))], 2, true, true, "", ""];
  886. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  887. s_player_lockUnlock_crtl = 1;
  888. } else {
  889. if(_hasHotwireKit) then {
  890. _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
  891. } else {
  892. _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, true, true, "", ""];
  893. };
  894. s_player_lockunlock set [count s_player_lockunlock,_Unlock];
  895. s_player_lockUnlock_crtl = 1;
  896. };
  897. } else {
  898. if(_hasKey || _oldOwner) then {
  899. _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
  900. s_player_lockunlock set [count s_player_lockunlock,_lock];
  901. s_player_lockUnlock_crtl = 1;
  902. };
  903. };
  904. };
  905.  
  906. } else {
  907. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  908. s_player_lockUnlock_crtl = -1;
  909. };
  910.  
  911. if(DZE_AllowForceSave) then {
  912. //Allow player to force save
  913. if((_isVehicle || _isTent) && !_isMan) then {
  914. if (s_player_forceSave < 0) then {
  915. s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
  916. };
  917. } else {
  918. player removeAction s_player_forceSave;
  919. s_player_forceSave = -1;
  920. };
  921. };
  922.  
  923.  
  924.  
  925. If(DZE_AllowCargoCheck) then {
  926. if((_isVehicle || _isTent || _isnewstorage || _typeOfCursorTarget in DZE_Origins_Buildings) && _isAlive && !_isMan && !locked _cursorTarget) then { if (s_player_checkGear < 0) then {
  927. s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""];
  928. };
  929. } else {
  930. player removeAction s_player_checkGear;
  931. s_player_checkGear = -1;
  932. };
  933. };
  934.  
  935.  
  936. //flip vehicle small vehicles by your self && all other vehicles with help nearby
  937. if(_player_flipveh) then {
  938. if (s_player_flipveh < 0) then {
  939. s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];
  940. };
  941. } else {
  942. player removeAction s_player_flipveh;
  943. s_player_flipveh = -1;
  944. };
  945.  
  946. //Allow player to fill jerrycan
  947. if((_hasFuelE || _hasFuelBarrelE) && _isFuel) then {
  948. if (s_player_fillfuel < 0) then {
  949. s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
  950. };
  951. } else {
  952. player removeAction s_player_fillfuel;
  953. s_player_fillfuel = -1;
  954. };
  955.  
  956. // logic vars for addactions
  957. _player_butcher = false;
  958. _player_studybody = false;
  959. _player_SurrenderedGear = false;
  960.  
  961. if ( cursorTarget isKindOf "GraveDZE") then {
  962. _player_studybody = true;
  963. };
  964.  
  965. // CURSOR TARGET NOT ALIVE
  966. if (!_isAlive) then {
  967.  
  968. // Gut animal/zed
  969. if((_isAnimal || _isZombie) && _hasKnife) then {
  970. _isHarvested = _cursorTarget getVariable["meatHarvested",false];
  971. if (!_isHarvested) then {
  972. _player_butcher = true;
  973. };
  974. };
  975.  
  976. // Study body
  977. if (_isMan && !_isZombie && !_isAnimal) then {
  978. _player_studybody = true;
  979. }
  980. } else {
  981. // unit alive
  982.  
  983. // gear access on surrendered player
  984. if(_isMan && !_isZombie && !_isAnimal) then {
  985. _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",false];
  986. if (_isSurrendered) then {
  987. _player_SurrenderedGear = true;
  988. };
  989. };
  990. };
  991.  
  992.  
  993. // Human Gut animal || zombie
  994. if (_player_butcher) then {
  995. if (s_player_butcher < 0) then {
  996. if(_isZombie) then {
  997. s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, true, true, "", ""];
  998. } else {
  999. s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
  1000. };
  1001. };
  1002. } else {
  1003. player removeAction s_player_butcher;
  1004. s_player_butcher = -1;
  1005. };
  1006.  
  1007. // Study Body
  1008. if (_player_studybody) then {
  1009. if (s_player_studybody < 0) then {
  1010. s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "ZSC\actions\check_wallet.sqf",_cursorTarget, 0, false, true, "",""];
  1011. };
  1012. } else {
  1013. player removeAction s_player_studybody;
  1014. s_player_studybody = -1;
  1015. };
  1016.  
  1017. // logic vars
  1018. _player_cook = false;
  1019. _player_boil = false;
  1020.  
  1021. // CURSOR TARGET IS FIRE
  1022. if (inflamed _cursorTarget) then {
  1023.  
  1024. //Fireplace Actions check
  1025. if (_hasRawMeat) then {
  1026. _player_cook = true;
  1027. };
  1028.  
  1029. // Boil water
  1030. if (_hasbottleitem && _hastinitem) then {
  1031. _player_boil = true;
  1032. };
  1033. };
  1034.  
  1035. if (_player_SurrenderedGear) then {
  1036. if (s_player_SurrenderedGear < 0) then {
  1037. s_player_SurrenderedGear = player addAction [localize "STR_EPOCH_ACTIONS_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true, "", ""];
  1038. };
  1039. } else {
  1040. player removeAction s_player_SurrenderedGear;
  1041. s_player_SurrenderedGear = -1;
  1042. };
  1043.  
  1044. //Fireplace Actions check
  1045. if (_player_cook) then {
  1046. if (s_player_cook < 0) then {
  1047. s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""];
  1048. };
  1049. } else {
  1050. player removeAction s_player_cook;
  1051. s_player_cook = -1;
  1052. };
  1053.  
  1054. // Boil water
  1055. if (_player_boil) then {
  1056. if (s_player_boil < 0) then {
  1057. s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""];
  1058. };
  1059. } else {
  1060. player removeAction s_player_boil;
  1061. s_player_boil = -1;
  1062. };
  1063.  
  1064. if(_cursorTarget == dayz_hasFire) then {
  1065. if ((s_player_fireout < 0) && !(inflamed _cursorTarget) && (player distance _cursorTarget < 3)) then {
  1066. s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true, "",""];
  1067. };
  1068. } else {
  1069. player removeAction s_player_fireout;
  1070. s_player_fireout = -1;
  1071. };
  1072.  
  1073. //Auctionhouse
  1074. if(_typeOfCursorTarget in serverTraders && (player distance _cursorTarget < 5)) then {
  1075. if (s_auction_dialog2 < 0) then {
  1076. s_auction_dialog2 = player addAction ["Buy Items from the Auctionhouse", "custom\scripts\auctionhouse\item_dialog.sqf",_cursorTarget, 0, true, false, "", ""];
  1077. };
  1078. if (s_auction_dialog < 0) then {
  1079. s_auction_dialog = player addAction ["Sell Items to the Auctionhouse", "custom\scripts\auctionhouse\item_sell_list.sqf",_cursorTarget, 0, true, false, "", ""];
  1080. };
  1081. if (s_auction_claim < 0) then {
  1082. s_auction_claim = player addAction ["Claim your Money", "custom\scripts\auctionhouse\claimmoney.sqf",_cursorTarget, 0, true, false, "", ""];
  1083. };
  1084. } else {
  1085. player removeAction s_auction_dialog2;
  1086. s_auction_dialog2 = -1;
  1087. player removeAction s_auction_dialog;
  1088. s_auction_dialog = -1;
  1089. player removeAction s_auction_claim;
  1090. s_auction_claim = -1;
  1091. };
  1092.  
  1093. //Packing my tent
  1094. if(_isTent && (player distance _cursorTarget < 3)) then {
  1095. if (_ownerID == _playerUID) then {
  1096. if (s_player_packtent < 0) then {
  1097. s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""];
  1098. };
  1099. } else {
  1100. if(("ItemJerrycan" in _magazinesPlayer) && ("ItemMatchbox_DZE" in weapons player)) then {
  1101. if (s_player_packtent < 0) then {
  1102. s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
  1103. };
  1104. };
  1105. };
  1106. } else {
  1107. player removeAction s_player_packtent;
  1108. s_player_packtent = -1;
  1109. };
  1110.  
  1111. //Allow manage door
  1112. if((_typeOfCursorTarget in DZE_DoorsLocked)) then {
  1113. if (s_player_manageDoor < 0) then {
  1114. s_player_manageDoor = player addAction ["<t color='#0059FF'>Manage Door</t>", "doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false];
  1115. };
  1116. } else {
  1117. player removeAction s_player_manageDoor;
  1118. s_player_manageDoor = -1;
  1119. };
  1120.  
  1121. //Allow owner to unlock vault
  1122. if((_typeOfCursorTarget in DZE_LockableStorage) && _ownerID2 != "0" && (player distance _cursorTarget < 3)) then {
  1123. if (s_player_unlockvault < 0) then {
  1124. if(_typeOfCursorTarget in DZE_LockedStorage) then {
  1125. if(_ownerID2 == dayz_combination || _ownerID2 == dayz_playerUID) then {
  1126. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
  1127. s_player_combi set [count s_player_combi,_combi];
  1128. } else {
  1129. _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  1130. s_player_combi set [count s_player_combi,_combi];
  1131. };
  1132. s_player_unlockvault = 1;
  1133. } else {
  1134. if(_ownerID2 != dayz_combination && _ownerID2 != dayz_playerUID) then {
  1135. _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
  1136. s_player_combi set [count s_player_combi,_combi];
  1137. s_player_unlockvault = 1;
  1138. };
  1139. };
  1140. };
  1141. } else {
  1142. {player removeAction _x} count s_player_combi;s_player_combi = [];
  1143. s_player_unlockvault = -1;
  1144. };
  1145.  
  1146. if(_typeOfCursorTarget in ZSC_MoneyStorage && (player distance _cursorTarget < 5)) then {
  1147. if (s_bank_dialog < 0) then {
  1148. s_bank_dialog = player addAction ["Money Storage", "ZSC\actions\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  1149. };
  1150. } else {
  1151. player removeAction s_bank_dialog;
  1152. s_bank_dialog = -1;
  1153. };
  1154.  
  1155. // cars
  1156. if( _isVehicle && !_isMan &&_isAlive && !_isMan && !locked _cursorTarget && !(_cursorTarget isKindOf "Bicycle") && (player distance _cursorTarget < 5)) then {
  1157. if (s_bank_dialog2 < 0) then {
  1158. s_bank_dialog2 = player addAction ["Money Storage", "ZSC\actions\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  1159. };
  1160. } else {
  1161. player removeAction s_bank_dialog2;
  1162. s_bank_dialog2 = -1;
  1163. };
  1164.  
  1165. //Allow owner to pack vault
  1166. if(_typeOfCursorTarget in DZE_UnLockedStorage && _ownerID2 != "0" && (player distance _cursorTarget < 3)) then {
  1167.  
  1168. if (s_player_lockvault < 0) then {
  1169. if(_ownerID2 == dayz_combination || _ownerID2 == dayz_playerUID) then {
  1170. s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true, "",""];
  1171. };
  1172. };
  1173. if (s_player_packvault < 0 && (_ownerID2 == dayz_combination || _ownerID2 == dayz_playerUID)) then {
  1174. 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, "",""];
  1175. };
  1176. } else {
  1177. player removeAction s_player_packvault;
  1178. s_player_packvault = -1;
  1179. player removeAction s_player_lockvault;
  1180. s_player_lockvault = -1;
  1181. };
  1182.  
  1183. //Player Deaths
  1184. if(_typeOfCursorTarget == "Info_Board_EP1") then {
  1185. if (s_player_information < 0) then {
  1186. s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true, "",""];
  1187. };
  1188. } else {
  1189. player removeAction s_player_information;
  1190. s_player_information = -1;
  1191. };
  1192.  
  1193. if (_isMan and _isAlive and !_isZombie and !_isAnimal and !(_traderType in serverTraders)) then {
  1194. if (s_givemoney_dialog < 0) then {
  1195. s_givemoney_dialog = player addAction [format["Give Money to %1", (name _cursorTarget)], "ZSC\actions\give_player_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
  1196. };
  1197. } else {
  1198. player removeAction s_givemoney_dialog;
  1199. s_givemoney_dialog = -1;
  1200. };
  1201.  
  1202. //Fuel Pump
  1203. if(_typeOfCursorTarget in dayz_fuelpumparray) then {
  1204. if (s_player_fuelauto < 0) then {
  1205.  
  1206. // check if Generator_DZ is running within 30 meters
  1207. _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
  1208. _findNearestGen = [];
  1209. {
  1210. if (alive _x && (_x getVariable ["GeneratorRunning", false])) then {
  1211. _findNearestGen set [(count _findNearestGen),_x];
  1212. };
  1213. } count _findNearestGens;
  1214. _IsNearRunningGen = count (_findNearestGen);
  1215.  
  1216. // show that pump needs power if no generator nearby.
  1217. if(_IsNearRunningGen > 0) then {
  1218. s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true, "",""];
  1219. } else {
  1220. s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  1221. };
  1222. };
  1223. } else {
  1224. player removeAction s_player_fuelauto;
  1225. s_player_fuelauto = -1;
  1226. };
  1227.  
  1228. //Fuel Pump on truck
  1229. if(_typeOfCursorTarget in DZE_fueltruckarray && alive _cursorTarget) then {
  1230. if (s_player_fuelauto2 < 0) then {
  1231. // show that fuel truck pump needs power.
  1232. if(isEngineOn _cursorTarget) then {
  1233. s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true, "",""];
  1234. } else {
  1235. s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  1236. };
  1237. };
  1238. } else {
  1239. player removeAction s_player_fuelauto2;
  1240. s_player_fuelauto2 = -1;
  1241. };
  1242.  
  1243. // inplace upgrade tool
  1244. if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
  1245. if ((s_player_lastTarget select 0) != _cursorTarget) then {
  1246. if (s_player_upgrade_build > 0) then {
  1247. player removeAction s_player_upgrade_build;
  1248. s_player_upgrade_build = -1;
  1249. };
  1250. };
  1251. if (s_player_upgrade_build < 0) then {
  1252. // s_player_lastTarget = _cursorTarget;
  1253. s_player_lastTarget set [0,_cursorTarget];
  1254. s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "custom\BuildVectors\action\player_upgrade.sqf",_cursorTarget, -1, false, true, "",""];
  1255. };
  1256. } else {
  1257. player removeAction s_player_upgrade_build;
  1258. s_player_upgrade_build = -1;
  1259. };
  1260. //diag_log text "============================================";
  1261.  
  1262. //diag_log format["fn_actons: [PlayerUID: %1] [_ownerID: %2] [DZE_Lock_Door: %3] [_characterID: %4] [typeOfCursorTarget: %5]",_playerUID, _ownerID, DZE_Lock_Door, _characterID, _typeOfCursorTarget];
  1263. //diag_log format["[s_player_downgrade_build:%1 ] [s_player_lastTarget: %2 ] [_isRemovable: %3 ] [_isWreckBuilding: %4 ]",s_player_downgrade_build, s_player_lastTarget, _isRemovable, _isWreckBuilding];
  1264.  
  1265. // downgrade system
  1266. if((_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") && (DZE_Lock_Door == _characterID)) then {
  1267. if ((s_player_lastTarget select 1) != _cursorTarget) then {
  1268. if (s_player_downgrade_build > 0) then {
  1269. player removeAction s_player_downgrade_build;
  1270. s_player_downgrade_build = -1;
  1271. };
  1272. };
  1273.  
  1274. if (s_player_downgrade_build < 0) then {
  1275. s_player_lastTarget set [1,_cursorTarget];
  1276. s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "custom\BuildVectors\action\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true, "",""];
  1277. };
  1278. } else {
  1279. player removeAction s_player_downgrade_build;
  1280. s_player_downgrade_build = -1;
  1281. };
  1282.  
  1283. // inplace maintenance tool
  1284. if((_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ") && (damage _cursorTarget >= DZE_DamageBeforeMaint)) then {
  1285. if ((s_player_lastTarget select 2) != _cursorTarget) then {
  1286. if (s_player_maint_build > 0) then {
  1287. player removeAction s_player_maint_build;
  1288. s_player_maint_build = -1;
  1289. };
  1290. };
  1291.  
  1292. if (s_player_maint_build < 0) then {
  1293. s_player_lastTarget set [2,_cursorTarget];
  1294. 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, "",""];
  1295. };
  1296. } else {
  1297. player removeAction s_player_maint_build;
  1298. s_player_maint_build = -1;
  1299. };
  1300.  
  1301.  
  1302. //Start Generator
  1303. if(_cursorTarget isKindOf "Generator_DZ") then {
  1304. if (s_player_fillgen < 0) then {
  1305.  
  1306. // check if not running
  1307. if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
  1308. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  1309. } else {
  1310. // check if not filled && player has jerry.
  1311. if((_cursorTarget getVariable ["GeneratorFilled", false])) then {
  1312. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  1313. } else {
  1314. if("ItemJerrycan" in _magazinesPlayer) then {
  1315. s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
  1316. };
  1317. };
  1318. };
  1319. };
  1320. } else {
  1321. player removeAction s_player_fillgen;
  1322. s_player_fillgen = -1;
  1323. };
  1324.  
  1325. //Towing with tow truck
  1326. /*
  1327. if(_typeOfCursorTarget == "TOW_DZE") then {
  1328. if (s_player_towing < 0) then {
  1329. if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
  1330. s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];
  1331. } else {
  1332. s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];
  1333. };
  1334. };
  1335. } else {
  1336. player removeAction s_player_towing;
  1337. s_player_towing = -1;
  1338. };
  1339. */
  1340.  
  1341. //Sleep
  1342. if(_isTent && _ownerID == _playerUID) then {
  1343. if ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) then {
  1344. s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
  1345. };
  1346. } else {
  1347. player removeAction s_player_sleep;
  1348. s_player_sleep = -1;
  1349. };
  1350.  
  1351. //################################# Hades (www.hellgn.com) && Inkko (opendayz.net) | Take milk ##########################################
  1352.  
  1353. if (("ItemEmptyBucket" in _itemsPlayer) && cursorTarget isKindOf "Cow01" || cursorTarget isKindOf "Cow02" || cursorTarget isKindOf "Cow03" || cursorTarget isKindOf "Cow04" || cursorTarget isKindOf "Cow04_normal" && (player distance cursorTarget) < 2 ) then {
  1354. if (s_player_moloko < 0) then {
  1355. s_player_moloko = player addaction[("<t color=""#0000ff"">" + ("Take Milk") +"</t>"),"scripts\player_takemoloko.sqf",cursorTarget,5,false,true,"", ""];
  1356. };
  1357. } else {
  1358. player removeAction s_player_moloko;
  1359. s_player_moloko = -1;
  1360. };
  1361.  
  1362. //################################# Hades (www.hellgn.com) && Inkko (opendayz.net) | Take milk stop ##########################################
  1363.  
  1364. _clothesTaken = cursorTarget getVariable["clothesTaken",false];
  1365.  
  1366. // Take clothes by Zabn @ BalotaBuddies.net
  1367. if (_isMan and !_isAlive and !_isZombie and !_clothesTaken and !_isAnimal) then {
  1368. if (s_player_clothes < 0) then {
  1369. s_player_clothes
  1370. = player addAction [("<t color='#0096ff'>")+("Take
  1371. Clothes")+("</t>"), "scripts\player_takeClothes.sqf",cursorTarget,
  1372. -10, false, true, "",""];
  1373. };
  1374. } else {
  1375. player removeAction s_player_clothes;
  1376. s_player_clothes = -1;
  1377. };
  1378.  
  1379. //Repairing Vehicles
  1380. if ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) then {
  1381. if (s_player_repair_crtl < 0) then {
  1382. dayz_myCursorTarget = _cursorTarget;
  1383. _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  1384. _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
  1385. s_player_repairActions set [count s_player_repairActions,_menu];
  1386. s_player_repairActions set [count s_player_repairActions,_menu1];
  1387.  
  1388. //########################### Hades (www.hellgn.com) | Vehicles upgrade stop ############################################
  1389.  
  1390. if (_typeOfCursorTarget in Ori_VehiclesList) then {
  1391. _cfg = configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "AnimationSources";
  1392. _tc = count _cfg;
  1393. _part = "PartGeneric";
  1394.  
  1395. for "_mti" from 0 to _tc-1 do {
  1396. _mt = (_cfg select _mti);
  1397. _st = getText(_mt >> "source");
  1398. _anim_array = Ori_VehicleUpgrades;
  1399. if (_st in _anim_array) then {
  1400. _statuss = _cursorTarget getVariable [_st,1];
  1401. if (_statuss == 1) then {
  1402. _num = _anim_array find _st;
  1403. _upgrade = _anim_array select _num;
  1404. _upgradeName = "";
  1405. switch _upgrade do {
  1406. case "pluhPredni" : {_upgradeName = "Front Plow";};
  1407. case "kolaOchrana" : {_upgradeName = "Wheel Guards";};
  1408. case "oknaOchrana" : {_upgradeName = "Window Guards";};
  1409. case "predniOknoOchrana" : {_upgradeName = "Windshield Guards";};
  1410. };
  1411. _color = "color='#ff0000'";
  1412. _stname = format["Upgrade %1",_upgradeName];
  1413. _string = format["<t %2>%1</t>", _stname,_color];
  1414.  
  1415. hint format["menu: %1", _string];
  1416.  
  1417. _handle = dayz_myCursorTarget addAction [_string, "compile\ori_upgrade.sqf",[_cursorTarget,_part,_st], 0, false, true, "",""];
  1418. s_player_repairActions set [count s_player_repairActions,_handle];
  1419. };
  1420. };
  1421. };
  1422. };
  1423.  
  1424. //########################### Hades (www.hellgn.com) | Vehicles upgrade stop ############################################
  1425.  
  1426. s_player_repair_crtl = 1;
  1427. } else {
  1428. {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  1429. s_player_repair_crtl = -1;
  1430. };
  1431. };
  1432.  
  1433. // All Traders
  1434. if (_isMan && !_isPZombie && _traderType in serverTraders) then {
  1435.  
  1436. if (s_player_parts_crtl < 0) then {
  1437.  
  1438. // get humanity
  1439. _humanity = player getVariable ["humanity",0];
  1440. _traderMenu = call compile format["menu_%1;",_traderType];
  1441.  
  1442. // diag_log ("TRADER = " + str(_traderMenu));
  1443.  
  1444. _low_high = "low";
  1445. _humanity_logic = false;
  1446.  
  1447. if((_traderMenu select 2) == "bandit_1_lvl") then {
  1448. _low_high = "high";
  1449. _humanity_logic = (_humanity > -2500);
  1450. };
  1451. if((_traderMenu select 2) == "hero_1_lvl") then {
  1452. _humanity_logic = (_humanity < 7500);
  1453. };
  1454. if((_traderMenu select 2) == "bandit_2_lvl") then {
  1455. _low_high = "high";
  1456. _humanity_logic = (_humanity > -7500);
  1457. };
  1458. if((_traderMenu select 2) == "hero_2_lvl") then {
  1459. _humanity_logic = (_humanity < 12500);
  1460. };
  1461. if((_traderMenu select 2) == "bandit_3_lvl") then {
  1462. _low_high = "high";
  1463. _humanity_logic = (_humanity > -17500);
  1464. };
  1465. if((_traderMenu select 2) == "hero_3_lvl") then {
  1466. _humanity_logic = (_humanity < 22500);
  1467. };
  1468.  
  1469. if(_humanity_logic) then {
  1470. _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
  1471. s_player_parts set [count s_player_parts,_cancel];
  1472. } else {
  1473.  
  1474. // Static Menu
  1475. {
  1476. //diag_log format["DEBUG TRADER: %1", _x];
  1477. _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, "",""];
  1478. s_player_parts set [count s_player_parts,_buy];
  1479.  
  1480. } count (_traderMenu select 1);
  1481.  
  1482. _buySm = player addAction ["Skins Trading (Male)", "custom\chameleon\male_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  1483. s_player_parts set [count s_player_parts,_buySm];
  1484.  
  1485. _buySf = player addAction ["Skins Trading (Female)", "custom\chameleon\female_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  1486. s_player_parts set [count s_player_parts,_buySf];
  1487.  
  1488. _buyV = player addAction ["<t color='#0059FF'>Advanced Trading</t>", "zupa\advancedTrading\init.sqf",(_traderMenu select 0), 999, true, false, "",""];
  1489. s_player_parts set [count s_player_parts,_buyV];
  1490.  
  1491. // Database menu
  1492. LastTraderMenu = (_traderMenu select 0);
  1493. _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
  1494. s_player_parts set [count s_player_parts,_buy];
  1495.  
  1496. };
  1497. s_player_parts_crtl = 1;
  1498.  
  1499. };
  1500. } else {
  1501. {player removeAction _x} count s_player_parts;s_player_parts = [];
  1502. s_player_parts_crtl = -1;
  1503. };
  1504.  
  1505.  
  1506. if(dayz_tameDogs) then {
  1507.  
  1508. //Dog
  1509. if (_isDog && _isAlive && (_hasRawMeat) && _characterID == "0" && player getVariable ["dogID", 0] == 0) then {
  1510. if (s_player_tamedog < 0) then {
  1511. s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""];
  1512. };
  1513. } else {
  1514. player removeAction s_player_tamedog;
  1515. s_player_tamedog = -1;
  1516. };
  1517. if (_isDog && _characterID == dayz_characterID && _isAlive) then {
  1518. _dogHandle = player getVariable ["dogID", 0];
  1519. if (s_player_feeddog < 0 && _hasRawMeat) then {
  1520. s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""];
  1521. };
  1522. if (s_player_waterdog < 0 && "ItemWaterbottle" in _magazinesPlayer) then {
  1523. s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""];
  1524. };
  1525. if (s_player_staydog < 0) then {
  1526. _lieDown = _dogHandle getFSMVariable "_actionLieDown";
  1527. if (_lieDown) then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
  1528. s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true,"",""];
  1529. };
  1530. if (s_player_trackdog < 0) then {
  1531. s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true,"",""];
  1532. };
  1533. if (s_player_barkdog < 0) then {
  1534. s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true,"",""];
  1535. };
  1536. if (s_player_warndog < 0) then {
  1537. _warn = _dogHandle getFSMVariable "_watchDog";
  1538. if (_warn) then { _text = (localize "str_epoch_player_247"); _warn = false; } else { _text = (localize "str_epoch_player_248"); _warn = true; };
  1539. s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true,"",""];
  1540. };
  1541. if (s_player_followdog < 0) then {
  1542. s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true,"",""];
  1543. };
  1544. } else {
  1545. player removeAction s_player_feeddog;
  1546. s_player_feeddog = -1;
  1547. player removeAction s_player_waterdog;
  1548. s_player_waterdog = -1;
  1549. player removeAction s_player_staydog;
  1550. s_player_staydog = -1;
  1551. player removeAction s_player_trackdog;
  1552. s_player_trackdog = -1;
  1553. player removeAction s_player_barkdog;
  1554. s_player_barkdog = -1;
  1555. player removeAction s_player_warndog;
  1556. s_player_warndog = -1;
  1557. player removeAction s_player_followdog;
  1558. s_player_followdog = -1;
  1559. };
  1560. };
  1561.  
  1562. /////////////////////////////
  1563. // CCTV Custom self actions
  1564. _isLaptop = _cursorTarget isKindOf "Notebook";
  1565. if (_isLaptop && _canDo) then {
  1566. if (s_player_laptop < 0) then {
  1567. s_player_laptop = player addAction ["Activate Laptop", "cctv\init.sqf",_cursorTarget, 1, true, true, "", ""];
  1568. }
  1569. } else {
  1570. player removeAction s_player_laptop;
  1571. s_player_laptop = -1;
  1572. };
  1573. /////////////////////////////
  1574.  
  1575. } else {
  1576. //Engineering
  1577. player removeAction s_player_plotManagement;
  1578. s_player_plotManagement = -1;
  1579.  
  1580. {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
  1581. s_player_repair_crtl = -1;
  1582.  
  1583. {player removeAction _x} count s_player_combi;s_player_combi = [];
  1584.  
  1585. dayz_myCursorTarget = objNull;
  1586. s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
  1587.  
  1588. {player removeAction _x} count s_player_parts;s_player_parts = [];
  1589. s_player_parts_crtl = -1;
  1590.  
  1591. {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
  1592. s_player_lockUnlock_crtl = -1;
  1593.  
  1594. player removeAction s_player_checkGear;
  1595. s_player_checkGear = -1;
  1596.  
  1597. player removeAction s_player_SurrenderedGear;
  1598. s_player_SurrenderedGear = -1;
  1599.  
  1600. //Others
  1601. player removeAction s_player_maintain_area;
  1602. s_player_maintain_area = -1;
  1603. player removeAction s_player_maintain_area_preview;
  1604. s_player_maintain_area_preview = -1;
  1605. player removeAction s_player_forceSave;
  1606. s_player_forceSave = -1;
  1607. player removeAction s_player_flipveh;
  1608. s_player_flipveh = -1;
  1609. player removeAction s_player_sleep;
  1610. s_player_sleep = -1;
  1611. player removeAction s_player_deleteBuild;
  1612. s_player_deleteBuild = -1;
  1613. player removeAction s_player_butcher;
  1614. s_player_butcher = -1;
  1615. player removeAction s_player_cook;
  1616. s_player_cook = -1;
  1617. player removeAction s_player_boil;
  1618. s_player_boil = -1;
  1619. player removeAction s_player_fireout;
  1620. s_player_fireout = -1;
  1621. player removeAction s_player_packtent;
  1622. s_player_packtent = -1;
  1623. player removeAction s_player_fillfuel;
  1624. s_player_fillfuel = -1;
  1625. player removeAction s_player_studybody;
  1626. s_player_studybody = -1;
  1627. //Dog
  1628. player removeAction s_player_tamedog;
  1629. s_player_tamedog = -1;
  1630. player removeAction s_player_feeddog;
  1631. s_player_feeddog = -1;
  1632. player removeAction s_player_waterdog;
  1633. s_player_waterdog = -1;
  1634. player removeAction s_player_staydog;
  1635. s_player_staydog = -1;
  1636. player removeAction s_player_trackdog;
  1637. s_player_trackdog = -1;
  1638. player removeAction s_player_barkdog;
  1639. s_player_barkdog = -1;
  1640. player removeAction s_player_warndog;
  1641. s_player_warndog = -1;
  1642. player removeAction s_player_followdog;
  1643. s_player_followdog = -1;
  1644.  
  1645. // door
  1646. player removeAction s_player_manageDoor;
  1647. s_player_manageDoor = -1; // u might also want to add this to variables reset in your variables.sqf
  1648.  
  1649. // vault
  1650. player removeAction s_player_unlockvault;
  1651. s_player_unlockvault = -1;
  1652. player removeAction s_player_packvault;
  1653. s_player_packvault = -1;
  1654. player removeAction s_player_lockvault;
  1655. s_player_lockvault = -1;
  1656.  
  1657. player removeAction s_player_information;
  1658. s_player_information = -1;
  1659. player removeAction s_player_fillgen;
  1660. s_player_fillgen = -1;
  1661.  
  1662. player removeAction s_player_ckc;
  1663. s_player_ckc = -1;
  1664. player removeAction s_player_Safe_ckc;
  1665. s_player_Safe_ckc = -1;
  1666.  
  1667. player removeAction s_player_upgrade_build;
  1668. s_player_upgrade_build = -1;
  1669. player removeAction s_player_maint_build;
  1670. s_player_maint_build = -1;
  1671. player removeAction s_player_downgrade_build;
  1672. s_player_downgrade_build = -1;
  1673.  
  1674. /*
  1675. player removeAction s_player_ckc;
  1676. s_player_ckc = -1;
  1677. player removeAction s_player_Safe_ckc;
  1678. s_player_Safe_ckc = -1;
  1679. */
  1680.  
  1681. player removeAction s_auction_dialog2;
  1682. s_auction_dialog2 = -1;
  1683. player removeAction s_auction_dialog;
  1684. s_auction_dialog = -1;
  1685. player removeAction s_auction_claim;
  1686. s_auction_claim = -1;
  1687. player removeAction s_player_towing;
  1688. s_player_towing = -1;
  1689. player removeAction s_player_fuelauto;
  1690. s_player_fuelauto = -1;
  1691. /////////////////////////////
  1692. // CCTV Custom self actions
  1693. player removeAction s_player_laptop;
  1694. s_player_laptop = -1;
  1695. /////////////////////////////
  1696. player removeAction s_player_fuelauto2;
  1697. s_player_fuelauto2 = -1;
  1698. player removeAction s_givemoney_dialog;
  1699. s_givemoney_dialog = -1;
  1700. player removeAction s_bank_dialog;
  1701. s_bank_dialog = -1;
  1702. player removeAction s_bank_dialog2;
  1703. s_bank_dialog2 = -1;
  1704. };
  1705.  
  1706.  
  1707.  
  1708. //Dog actions on player self
  1709. _dogHandle = player getVariable ["dogID", 0];
  1710. if (_dogHandle > 0) then {
  1711. _dog = _dogHandle getFSMVariable "_dog";
  1712. _characterID = "0";
  1713. if (!isNull cursorTarget) then { _characterID = cursorTarget getVariable ["CharacterID","0"]; };
  1714. if (_canDo && !_inVehicle && alive _dog && _characterID != dayz_characterID) then {
  1715. if (s_player_movedog < 0) then {
  1716. s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, false, true, "", ""];
  1717. };
  1718. if (s_player_speeddog < 0) then {
  1719. _text = (localize "str_epoch_player_249");
  1720. _speed = 0;
  1721. if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = (localize "str_epoch_player_250"); };
  1722. 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, "", ""];
  1723. };
  1724. if (s_player_calldog < 0) then {
  1725. 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, "", ""];
  1726. };
  1727. };
  1728. } else {
  1729. player removeAction s_player_movedog;
  1730. s_player_movedog = -1;
  1731. player removeAction s_player_speeddog;
  1732. s_player_speeddog = -1;
  1733. player removeAction s_player_calldog;
  1734. s_player_calldog = -1;
  1735. };
  1736.  
  1737. _driver = driver _vehicle;
  1738.  
  1739. if(_inVehicle && (_driver == player)) then {
  1740. _rideAR=nearestObjects[player, ["Ship","Air","LandVehicle"], 25];
  1741. _ride=_rideAR select 0;
  1742. _player_name = name player;
  1743. if((name _ride)!="") then {
  1744. _ride setVehicleVarName "CurrentRide"+_player_name;
  1745. };
  1746. _crew=crew _vehicle;
  1747. _crew=_crew-[player];
  1748.  
  1749. if(Player_Vehicle_Crew_Count != (count _crew)) then {
  1750. Player_Vehicle_Crew_Count=(count _crew);
  1751.  
  1752. if((count Eject_Array)>0) then{
  1753. {_ride removeAction _x} forEach Eject_Array;
  1754. };
  1755. Eject_Array=[];
  1756. _eject_text="";
  1757. _counter=0;
  1758. _crew_name="";
  1759. _friendlies = player getVariable ["friendlyTo",[]];
  1760.  
  1761. {
  1762. _crew_name=name _x;
  1763. _crewID = _x getVariable["CharacterID","0"];
  1764. if(_crewID in _friendlies) then {} else {
  1765. _eject_text=format ["Eject %1",_crew_name];
  1766. s_player_driver_eject = _vehicle addaction[_eject_text,"custom\eject.sqf",[_x,_ride],0,false,true,"", "(driver _target)==player"];
  1767. Eject_Array set[_counter, s_player_driver_eject];
  1768. _counter=_counter + 1;
  1769. };
  1770. }forEach _crew;
  1771. };
  1772.  
  1773. }else {
  1774. {_ride removeAction _x} forEach Eject_Array;
  1775. Eject_Array=[];
  1776. Player_Vehicle_Crew_Count=0;
  1777. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement