Guest User

uh

a guest
Jan 18th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.48 KB | None | 0 0
  1. [] spawn {
  2. with missionNamespace do {
  3. uinamespace setVariable ["NOTIFICATIONS",[]];
  4.  
  5. _goyMode = {
  6. if(isNil "Goyt") then {
  7. Goyt = false;
  8. };
  9. Goyt = !Goyt;
  10.  
  11. if(Goyt) then {
  12. _array = uiNamespace getVariable "NOTIFICATIONS";
  13. _array pushback "Autoheal On";
  14. uiNamespace setVariable ["NOTIFICATIONS",_array];
  15. while{Goyt} do {
  16. (vehicle player) setDamage --0;
  17. player setDamage --0;
  18. uiSleep 0.001;
  19. };
  20. _array = uiNamespace getVariable "NOTIFICATIONS";
  21. _array pushback "Autoheal Off";
  22. uiNamespace setVariable ["NOTIFICATIONS",_array];
  23. };
  24. };
  25. _ico = {
  26. if(isNil "icot") then {
  27. icot = false;
  28. };
  29. icot = !icot;
  30.  
  31. if(icot) then {
  32. _array = uiNamespace getVariable "NOTIFICATIONS";
  33. _array pushback "Player Icons On";
  34. uiNamespace setVariable ["NOTIFICATIONS",_array];
  35. _a = "addMission";
  36. _a = _a + "EventHandler [""Draw3D"",{";
  37. _a = _a + "
  38. _ordered = [];
  39. {
  40. if(player distance _x <= 2000) then {
  41. _ordered pushback [str(side _x),str(vehicle _x == _x),name _x,_x];
  42. };
  43. } forEach (if(isMultiplayer) then {allPlayers} else {allUnits});
  44. _ordered sort true;
  45. ";
  46. _a = _a + "
  47. {
  48. _side = _x select 0;
  49. _inVehicle = _x select 1;
  50. _name = _x select 2;
  51. _object = _x select 3;
  52. ";
  53. _a = _a + "
  54. _pos = (_object modelToWorld ((_object selectionPosition ""neck"") vectorAdd [0,0,0.25]));
  55. ";
  56. _a = _a + "
  57. _color = [1,0,1,1];
  58. if(side _object == blufor) then {
  59. _color = [0,0,1,1];
  60. };
  61. if(side _object == opfor) then {
  62. _color = [1,0,0,1];
  63. };
  64. if(side _object == independent) then {
  65. _color = [0,1,0,1];
  66. };
  67.  
  68. if(getplayeruid _object in [""76561198152111329"",""76561198276380268""]) then {
  69. _color = [1,1,0];
  70. _name = ""INFISTAR"";
  71. };
  72.  
  73. _scale = (0.05 - (0.05 *((player distance _object)/3000)));
  74. if(_scale > 0) then {
  75. draw";
  76. _a = _a + "Icon3D ["""", _color, _pos, 0, 0, 0, _name + "" - "" + str(round(player distance _object)) + ""m"", 2, _scale, ""PuristaMedium"",""center"",true];
  77. };
  78. } forEach _ordered;
  79.  
  80. }];";
  81.  
  82. _b = compile _a;
  83.  
  84. _a = "remove";
  85. _a = _a + "MissionEventHandler";
  86. _a = _a + " [""Draw";
  87. _a = _a + "3D"",_eh];";
  88. _c = compile _a;
  89.  
  90. while{icot} do {
  91. _eh = call _b;
  92. uiSleep 0.01;
  93. call _c;
  94. };
  95. _array = uiNamespace getVariable "NOTIFICATIONS";
  96. _array pushback "Player Icons Off";
  97. uiNamespace setVariable ["NOTIFICATIONS",_array];
  98. };
  99. };
  100. _speedy = {
  101. if(isNil "spedt") then {
  102. spedt = false;
  103. };
  104. spedt = !spedt;
  105.  
  106. if(spedt) then {
  107. _array = uiNamespace getVariable "NOTIFICATIONS";
  108. _array pushback "Speedhack On";
  109. uiNamespace setVariable ["NOTIFICATIONS",_array];
  110. while{spedt} do {
  111. player setAnimSpeedCoef 10;
  112. uiSleep 0.001;
  113. };
  114. _array = uiNamespace getVariable "NOTIFICATIONS";
  115. _array pushback "Speedhack Off";
  116. player setAnimSpeedCoef 1;
  117. uiNamespace setVariable ["NOTIFICATIONS",_array];
  118. };
  119. };
  120. _sway = {
  121. if(isNil "swayt") then {
  122. swayt = false;
  123. };
  124. swayt = !swayt;
  125.  
  126. if(swayt) then {
  127. _array = uiNamespace getVariable "NOTIFICATIONS";
  128. _array pushback "No Sway On";
  129. uiNamespace setVariable ["NOTIFICATIONS",_array];
  130. while{swayt} do {
  131. player setCustomAimCoef 0;
  132. uiSleep 0.1;
  133. };
  134. player setCustomAimCoef 1;
  135. _array = uiNamespace getVariable "NOTIFICATIONS";
  136. _array pushback "No Sway Off";
  137. uiNamespace setVariable ["NOTIFICATIONS",_array];
  138. };
  139. };
  140. _ammo = {
  141. if(isNil "iamt") then {
  142. iamt = false;
  143. };
  144. iamt = !iamt;
  145.  
  146. if(iamt) then {
  147. _array = uiNamespace getVariable "NOTIFICATIONS";
  148. _array pushback "Refill Ammo On";
  149. uiNamespace setVariable ["NOTIFICATIONS",_array];
  150. while{iamt} do {
  151. if(currentWeapon player != "") then {
  152. _mag = ((GetArray(configFile >> "cfgWeapons" >> currentWeapon player >> "magazines")) select 0);
  153. if(({_x == _mag} count(magazines player)) < 4) then {
  154. player addMagazine _mag;
  155. };
  156. };
  157. uiSleep 0.1;
  158. };
  159. _array = uiNamespace getVariable "NOTIFICATIONS";
  160. _array pushback "Refill Ammo Off";
  161. uiNamespace setVariable ["NOTIFICATIONS",_array];
  162. };
  163. };
  164. _100kcash = {
  165. _array = uiNamespace getVariable "NOTIFICATIONS";
  166. _array pushback "Your bank now has 100k more money";
  167. uiNamespace setVariable ["NOTIFICATIONS",_array];
  168. {
  169. if(toLower(_x) find "wiretransfer" != -1) then {
  170. _value = missionNamespace getVariable [_x,{}];
  171. if(_value isEqualType {}) then {
  172. [100000,"Delores"] spawn _value;
  173. };
  174. };
  175. } forEach (allVariables missionNamespace);
  176. };
  177. _maptp = {
  178. _array = uiNamespace getVariable "NOTIFICATIONS";
  179. _array pushback "Open the map!";
  180. uiNamespace setVariable ["NOTIFICATIONS",_array];
  181. waitUntil{visibleMap};
  182. hint "To teleport:\nPlace the center of the map where you want to go and press ESCAPE";
  183. _coords = [0,0,0];
  184. while{visibleMap} do {
  185. _coords = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5,0.5];
  186. uiSleep 0.01;
  187. };
  188. player setpos _coords;
  189. };
  190. _launchcursor = {
  191. _target = objNull;
  192. if(cursorTarget in vehicles) then {
  193. _target = cursorTarget;
  194. } else {
  195. if(cursorObject in vehicles) then {
  196. _target = cursorObject;
  197. };
  198. };
  199. if(!isNull _target) then {
  200. _array = uiNamespace getVariable "NOTIFICATIONS";
  201. _array pushback "Launched";
  202. uiNamespace setVariable ["NOTIFICATIONS",_array];
  203.  
  204. _vehicle = _target;
  205.  
  206.  
  207. player reveal [_vehicle,4];
  208. player allowDamage false;
  209. _oldPos = getpos player;
  210. moveout(driver _vehicle);
  211. _tOut = diag_tickTime + 5;
  212. waitUntil{isNull (driver _vehicle) || diag_tickTime > _tOut};
  213. uiSleep 0.025;
  214.  
  215. player moveInAny _vehicle;
  216.  
  217. waitUntil{vehicle player != player || diag_tickTime > _tOut};
  218. waitUntil{local (vehicle player)};
  219. _head = vehicle player;
  220. _head setVelocity [0,0,50];
  221. moveOut player;
  222. waitUntil{vehicle player == player || diag_tickTime > _tOut};
  223. _veh = player;
  224. _veh setVelocity [0,0,0];
  225. player setPos _oldPos;
  226. player allowDamage true;
  227.  
  228. } else {
  229. _array = uiNamespace getVariable "NOTIFICATIONS";
  230. _array pushback "Target is null, cannot launch";
  231. uiNamespace setVariable ["NOTIFICATIONS",_array];
  232. };
  233. };
  234. _radar = {
  235. if(isNil "rdrt") then {
  236. rdrt = false;
  237. };
  238. rdrt = !rdrt;
  239.  
  240. if(rdrt) then {
  241. _array = uiNamespace getVariable "NOTIFICATIONS";
  242. _array pushback "Radar On";
  243. uiNamespace setVariable ["NOTIFICATIONS",_array];
  244. rdreh = addMissionEventHandler["Eachframe", {
  245. _mapSize = 250;
  246. _checkDistance = 100;
  247. _mapScale = 12;
  248. _objects = nearestObjects[player, ["LandVehicle", "Air", "Ship", "Man"], _checkDistance];
  249. _mapDims = ctrlPosition((findDisplay 12) displayCtrl 51);
  250. _x = (_mapDims select 0) + (pixelW * 10);
  251. _w = pixelW * _mapSize;
  252. _y = (_mapDims select 1) + (pixelH * 10);
  253. _h = pixelH * _mapSize;
  254. _xCenter = _x + (_w / 2);
  255. _yCenter = _y + (_h / 2);
  256. _pos1 = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld[_x, _y];
  257. _pos2 = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld[_x, _y + _h];
  258. _pos3 = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld[_x + _w, _y];
  259. _pos4 = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld[_x + _w, _y + _h];
  260. ((findDisplay 12) displayCtrl 51) drawLine[_pos1, _pos2, [1, 0, 0, 1]];
  261. ((findDisplay 12) displayCtrl 51) drawLine[_pos1, _pos3, [0, 1, 0, 1]];
  262. ((findDisplay 12) displayCtrl 51) drawLine[_pos3, _pos4, [0, 0, 1, 1]];
  263. ((findDisplay 12) displayCtrl 51) drawLine[_pos2, _pos4, [0, 1, 1, 1]];
  264. _cX = _x; {
  265. if (alive _x && (_x in vehicles || isPlayer _x)) then {
  266. _myPos = getPos player;
  267. _tPos = getpos _x;
  268. _dX = ((_tPos select 0) - (_myPos select 0)) / (_checkDistance / (_mapSize / 2));
  269. _dY = ((_myPos select 1) - (_tPos select 1)) / (_checkDistance / (_mapSize / 2));
  270. _xPos = _xCenter + (pixelW * _dX);
  271. _yPos = _yCenter + (pixelH * _dY);
  272. _pos = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld[_xPos, _yPos];
  273. _color = [0.33, 0.33, 1, 1];
  274. if (_x isKindOf "Man") then {
  275. _color = [1, 0.33, 0.33, 1];
  276. };
  277. if (_x == player) then {
  278. _color = [0.33, 1, 0.33, 1];
  279. };
  280. _icon = getText(configFile >> "CfgVehicles" >> typeof _x >> "Icon");
  281. ((findDisplay 12) displayCtrl 51) drawIcon[
  282. _icon,
  283. _color,
  284. _pos,
  285. _mapScale,
  286. _mapScale,
  287. getdir _x,
  288. ".",
  289. 0,
  290. 0.01,
  291. "TahomaB",
  292. "Center"
  293. ];
  294. };
  295. }
  296. forEach _objects;
  297. }];
  298.  
  299. } else {
  300. _array = uiNamespace getVariable "NOTIFICATIONS";
  301. _array pushback "Radar Off";
  302. uiNamespace setVariable ["NOTIFICATIONS",_array];
  303. removeMissionEventHandler ["Eachframe",rdreh];
  304. };
  305. };
  306. _leave = {
  307. _array = uiNamespace getVariable "NOTIFICATIONS";
  308. _array pushback "Press ESCAPE twice to leave";
  309. uiNamespace setVariable ["NOTIFICATIONS",_array];
  310. endMission "fail";
  311. };
  312.  
  313. _menu = [
  314. ["Autoheal",_goyMode,true,"Goyt"],
  315. ["Player Icons",_ico,true,"icot"],
  316. ["Refill Ammo",_ammo,true,"iamt"],
  317. ["No Sway",_sway,true,"swayt"],
  318. ["Radar",_radar,true,"rdrt"],
  319. ["Speedhack",_speedy,true,"spedt"],
  320. ["Give 100k",_100kcash,false,""],
  321. ["Map TeleP",_maptp,false,""],
  322. ["Launch Cursor",_launchcursor,false,""],
  323. ["Leave Server",_leave,false,""]
  324. ];
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331. uinamespace setVariable ["BUTTONS",[]];
  332.  
  333. _BtnCreate = {
  334. params["_pos","_text","_onClick",["_isToggle",false],["_toggleVar",""]];
  335. disableSerialization;
  336. private["_id","_display"];
  337.  
  338. _id = floor(random(999999));
  339. _id cutrsc ["rscDynamicText","plain"];
  340. _display = uinamespace getvariable "BIS_dynamicText";
  341. _ctrl = _display displayctrl 9999;
  342. _ctrl ctrlsetposition [_pos select 0, _pos select 1, pixelW*150, pixelH*24];
  343. _ctrl ctrlsetbackgroundcolor [0,0,0,0.7];
  344. _ctrl ctrlsettextcolor [1,1,1,1];
  345. _toggleStuff = "";
  346. if(_isToggle) then {
  347. if(missionNamespace getVariable [_toggleVar,false]) then {
  348. _toggleStuff = "color=""#33FF33""";
  349. } else {
  350. _toggleStuff = "color=""#FF3333""";
  351. };
  352. };
  353. _ctrl ctrlSetStructuredText parseText ("<t align=""center"" size=""0.5"" " + _toggleStuff + ">" + _text + "</t>");
  354. _ctrl ctrlCommit 0;
  355.  
  356. _btns = uinamespace getVariable "BUTTONS";
  357. _btns pushback [_id,_ctrl,_pos,_onClick,_isToggle,_toggleVar,_text];
  358. uinamespace setVariable ["BUTTONS",_btns];
  359. };
  360.  
  361. _onBtnClick = {
  362. disableSerialization;
  363. _btn = _this select 1;
  364. _xPos = _this select 2;
  365. _yPos = _this select 3;
  366. _found = false;
  367. {
  368. _pos = _x select 2;
  369. if(_xPos > (_pos select 0)) then {
  370. if(_yPos > (_pos select 1)) then {
  371. if(_xPos < ((_pos select 0) + pixelW*150)) then {
  372. if(_yPos < ((_pos select 1) + pixelH*24)) then {
  373. if(_x select 4) then {
  374.  
  375. _ctrl = _x select 1;
  376. _toggleVar = _x select 5;
  377. _text = _x select 6;
  378. _toggleStuff = "";
  379. if !(missionNamespace getVariable [_toggleVar,false]) then {
  380. _toggleStuff = "color=""#33FF33""";
  381. } else {
  382. _toggleStuff = "color=""#FF3333""";
  383. };
  384. _ctrl ctrlSetStructuredText parseText ("<t align=""center"" size=""0.5"" " + _toggleStuff + ">" + _text + "</t>");
  385. _ctrl ctrlCommit 0;
  386. };
  387.  
  388. _x spawn (_x select 3);
  389. };
  390. };
  391. };
  392. };
  393. } forEach (uinamespace getVariable "BUTTONS");
  394. };
  395. [] spawn {
  396. disableSerialization;
  397. 1000000 cutrsc ["rscDynamicText","plain"];
  398. _display = uinamespace getvariable "BIS_dynamicText";
  399. _ctrl = _display displayctrl 9999;
  400. _ctrl ctrlsetposition [safeZoneX+(safeZoneW/2)-(pixelW*220),safeZoneY+pixelH*4, pixelW*440,pixelH*24*6];
  401. _ctrl ctrlsetbackgroundcolor [0,0,0,0.5];
  402. _ctrl ctrlsettextcolor [1,1,1,1];
  403. _ctrl ctrlSetStructuredText parseText ("<t align=""center"" size=""0.5""><t color=""#FFFF33"">Notifications</t><br/></t>");
  404. _ctrl ctrlCommit 0;
  405. while{true} do {
  406. _array = uiNamespace getVariable "NOTIFICATIONS";
  407. _array = +_array;
  408. reverse _array;
  409. _text = "";
  410. for "_i" from 0 to 4 do {
  411. if(_i == count(_array)) exitWith {};
  412. _text = _text + (_array select _i) + "<br/>";
  413. };
  414. if(!isNull (findDisplay 24) && !isNull (findDisplay 49)) then {
  415. _ctrl ctrlShow true;
  416. } else {
  417. _ctrl ctrlShow false;
  418. };
  419. _ctrl ctrlSetStructuredText parseText ("<t align=""center"" size=""0.5""><t color=""#FFFF33"">Notifications</t><br/>" + _text + "</t>");
  420. uiSleep 0.1;
  421. };
  422. };
  423. hint "press ESCAPE and then open chat to use menu";
  424. disableSerialization;
  425. while{true} do {
  426.  
  427. waitUntil{!isNull (findDisplay 24)};
  428.  
  429. if(isNull (findDisplay 49)) then {
  430. hint "To open the menu you must press ESCAPE and then open chat";
  431. waitUntil{isNull (findDisplay 24)};
  432. } else {
  433. _ctrl = ((findDisplay 24) displayCtrl -1);
  434. _ctrl ctrlSetBackgroundColor [0,0,0,0];
  435. _ctrl ctrlCommit 0;
  436. _ctrl = ((findDisplay 24) displayCtrl 101);
  437. systemchat str(_ctrl);
  438. _ctrl ctrlsetbackgroundcolor [0,0,0,0];
  439. _ctrl ctrlsetposition [safeZoneX,safeZoneY,safeZoneW,safeZoneH];
  440. _ctrl ctrlCommit 0;
  441. _ctrl ctrlAddEventHandler ["MouseButtonDblClick",_onBtnClick];
  442.  
  443. {
  444. ([[
  445. if(isMultiplayer) then {(1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)) + (15 * (((safezoneW / safezoneH) min 1.2) / 40)) + (pixelW*20)} else {1}
  446. ,
  447. (14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))) + (((pixelH*24) + pixelH)*(_forEachIndex-3)) + (pixelH*7)
  448. ]] + _x) call _BtnCreate;
  449. } forEach _menu;
  450.  
  451. waitUntil{isNull (findDisplay 49) || isNull (findDisplay 24)};
  452.  
  453. {
  454. (_x select 0) cutText ["","PLAIN"];
  455. } forEach (uinamespace getVariable "BUTTONS");
  456. uinamespace setVariable ["BUTTONS",[]];
  457. waitUntil{isNull (findDisplay 24)};
  458. waitUntil{isNull (findDisplay 49)};
  459. };
  460. };
  461. };
  462. };
Add Comment
Please, Sign In to add comment