Guest User

Untitled

a guest
Sep 2nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.68 KB | None | 0 0
  1. /*
  2. [AlPmaker MAPH+ESP+TP Script]
  3. 09:01 26/09/12
  4. v 6.69
  5.  
  6. [Benefits]:
  7.  
  8. - configurable through menu opened by key combination (set "musekeys" to "true")
  9. - multitreading - each marker lives it's own "life" until off
  10. - show tents, helicrashes, players, vehicles, dead bodies, nearby animals and zombies
  11. - nice icons
  12. - configurable icons colors
  13. - configurable preload options
  14. - scalable icons
  15. - built-in esp w player tags
  16. - built-in teleport
  17. - icons support direction show (but it is some kind bugged due high ping values)
  18. - when players are in vehicle their names are shown in column like:
  19. - U1-H1
  20. > PlayerName1
  21. > PlayerName2
  22. > PlayerName3
  23. > PlayerName4
  24. - vehicles has real ingame names on map
  25. - autoadding map/GPS if selected and not in inventory
  26. - added alternative TP (credits to monky) allow player (w/o vehicle) TP on buildings
  27. - added "vilayer" bypass
  28. - etc :)
  29.  
  30. [Defects]:
  31. - can freeze while scanning objects on first execution
  32.  
  33. [How to use]:
  34.  
  35. 1) You NEED map or gps (change "mautoaddmap" or "mautoaddgps" to true)
  36. 2) Open GPS if You have it
  37. 2) Exec script
  38. 3) \0/ Profit! :)
  39.  
  40. [Controls]:
  41. F2 key = Show options menu
  42. ALT + LMB click on map = Teleport You and Your vehicle in place You clicked
  43. */
  44.  
  45.  
  46. // Configuration
  47.  
  48.  
  49. if (isNil "musekeys") then {musekeys = true;}; //use keys combinations to show and toggle options
  50. if (isNil "shz") then {shz = true;}; //Show zombies on start
  51. if (isNil "sha") then {sha = false;}; //Show animals on start
  52. if (isNil "shd") then {shd = false;}; //Show dead bodies on start
  53. if (isNil "sht") then {sht = true;}; //Show tents on start
  54. if (isNil "spi") then {spi = true;}; //Show players on HUD (ESP) on start
  55. if (isNil "mgpsm") then {mgpsm = true;}; //Move gps and remove it's fckn frame
  56. if (isNil "sci") then {sci = false;}; //Show "simple" car icon instead default icons
  57. if (isNil "tpe") then {tpe = false;}; //Use built-in teleport
  58. if (isNil "tpa") then {tpa = true;}; //Use alternative teleport (could be used to tp on buildings)(not works for vehicles)(credits to monky)
  59. if (isNil "uvb") then {uvb = true;}; //Use bypass of current antiteleport script (ViLayer)
  60.  
  61.  
  62. mautoaddmap = true; //Add map on start (GPS or MAP nesessary for functionality)
  63. mautoaddgps = false; //Add map on start (GPS or MAP nesessary for functionality)
  64.  
  65. ptxt = "You"; //Text to identify You on map/gps. Leave blank ("") if You want to see only black icon
  66.  
  67. zmc = [1, 0, 0, 1]; //Zombie icon color
  68. amc = [0, 0, 0, 1]; //Animals icon color
  69. pmc = [0, 0, 1 , 1]; //Player icon color
  70. pdmc = [1, 0, 0, 1]; //HUD player text color
  71. vmc = [0.0980392, 0.0980392, 0.439216, 1]; //Vehicle icon color
  72. wmc = [0.4, 0, 0, 1]; //Heliwrecks icon color
  73. tmc = [0.294118, 0, 0.509804, 1]; //Tent icon color
  74. _zdist = 1000; //Distance from You to show zombie/animals icons
  75. _mapside = 15000; //Size of map (longest x or y) in meters
  76.  
  77. // End of configuration
  78.  
  79.  
  80. disableSerialization;
  81. _minimap = (uinamespace getvariable "BIS_RscMiniMap") displayCtrl 101;
  82. _minimap_frame = (uinamespace getvariable "BIS_RscMiniMap") displayCtrl 101000;
  83. _mm_w = 0.35;
  84. _mm_h = 0.301;
  85.  
  86. moptions =
  87. {
  88. mapopt =
  89. [
  90. ["",true],
  91. ["Toggle options:(current state)", [-1], "", -5, [["expression", ""]], "1", "0"],
  92. [format["Built-in HUD(ESP): %1",spi], [2], "", -5, [["expression", "spi = !spi;"]], "1", "1"],
  93. [format["Built-in Teleport: %1",tpe], [3], "", -5, [["expression", "tpe = !tpe;"]], "1", "1"],
  94. [format["Simple car icons: %1",sci], [4], "", -5, [["expression", "sci = !sci;"]], "1", "1"],
  95. [format["Show tents: %1",sht], [5], "", -5, [["expression", "sht = !sht;"]], "1", "1"],
  96. [format["Show nearby zombies: %1",shz], [6], "", -5, [["expression", "shz = !shz;"]], "1", "1"],
  97. [format["Show nearby animals: %1",sha], [7], "", -5, [["expression", "sha = !sha;"]], "1", "1"],
  98. [format["Show dead bodies: %1",shd], [8], "", -5, [["expression", "shd = !shd;"]], "1", "1"],
  99. [format["Use alternative teleport: %1",tpa], [9], "", -5, [["expression", "tpa = !tpa;"]], "1", "1"],
  100. [format["Use 'anticheat' bypass: %1",uvb], [10], "", -5, [["expression", "uvb = !uvb;"]], "1", "1"]
  101. ];
  102. showCommandingMenu "#USER:mapopt";
  103. };
  104.  
  105.  
  106.  
  107. if (isnil "mapm") then
  108. {
  109. if (mautoaddmap and !("ItemMap" in items player)) then {player addweapon "ItemMap";};
  110. if (mautoaddgps and !("ItemGPS" in items player)) then {player addweapon "ItemGPS";};
  111. mapm = true;
  112. plist = [];
  113. vlist = [];
  114. cList = [];
  115. aList = [];
  116. sList = [];
  117. dList = [];
  118. maphalf = _mapside/2; mapscanrad = sqrt (2*maphalf*maphalf);
  119. _map = (findDisplay 12) displayCtrl 51;
  120. if spi then {setGroupIconsVisible [false,true];};
  121.  
  122. titleText ["Loading tents and helicrashes...","PLAIN DOWN"];titleFadeOut 2;
  123. helicrashes = nearestObjects [[maphalf,maphalf],["UH1Wreck_DZ"],mapscanrad];
  124. tents = nearestObjects [[maphalf,maphalf],["TentStorage"],mapscanrad];
  125.  
  126. if mgpsm then
  127. {
  128. _minimap_frame ctrlShow false; //hide gps frame
  129. //_mm_x = (SafeZoneW + SafeZoneX) - (_mm_w + 0.005); //bottom right
  130. //_mm_y = (SafeZoneH + SafeZoneY) - (_mm_h + 0.005); //bottom right
  131. //_mm_x = SafeZoneX + 0.005; //top left
  132. //_mm_y = SafeZoney + 0.005; //top left
  133. _mm_x = (SafeZoneW + SafeZoneX) - (1 - 0.555); //move left a bit (to not cover main right icons)
  134. _mm_y = (SafeZoneH + SafeZoneY) - (1 - 0.480); //move left a bit (to not cover main right icons)
  135. _minimap ctrlsetposition [_mm_x, _mm_y, _mm_w, _mm_h];
  136. _minimap ctrlcommit 0.01;
  137. };
  138. titleText ["Markers Added! Teleporting:Open Map, hold Left ALT, left click on map.","PLAIN DOWN"];titleFadeOut 2;
  139. _mapdraw = _map ctrlSetEventHandler ["Draw", "_this call drawic;"];
  140. _minimapdraw = _minimap ctrlSetEventHandler ["Draw", "_this call drawic;"];
  141. if musekeys then
  142. {
  143. F2_EH = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 0x3C) then {call moptions;};"];
  144. };
  145.  
  146. sleep 0.1;
  147.  
  148. }
  149. else
  150. {
  151. mapm = nil;
  152. _map ctrlremoveeventhandler ["Draw", _mapdraw];
  153. (findDisplay 46) displayRemoveEventHandler ["KeyDown", F2_EH];
  154.  
  155. if mgpsm then
  156. {
  157. _mm_x = (SafeZoneW + SafeZoneX) - (1 - 0.625);
  158. _mm_y = (SafeZoneH + SafeZoneY) - (1 - 0.480);
  159. _minimap_frame ctrlShow true;
  160. _minimap ctrlsetposition [_mm_x, _mm_y, _mm_w, _mm_h];
  161. _minimap ctrlcommit 0.01;
  162. };
  163.  
  164. sleep 0.1;
  165. titleText ["Markers Removed. (Re-add if you want to teleport.)","PLAIN DOWN"];titleFadeOut 2;
  166. };
  167.  
  168.  
  169. keyctrl =
  170. {
  171.  
  172. };
  173.  
  174.  
  175.  
  176. drawic =
  177. {
  178. if (!isnil "mapm") then
  179. {
  180.  
  181. private["_ctrl"];
  182. _ctrl = _this select 0;
  183. _iscale = (1 - ctrlMapScale _ctrl) max .2;
  184.  
  185. _irad = 30;
  186. _color = [0, 0, 0, 1];
  187. _icon = "\ca\ui\data\icon_zora_ca.paa";
  188. if shz then {{if (!isnull _x) then {_ctrl drawIcon ["\ca\ui\data\iconman_ca.paa", zmc, getPosASL _x, _iscale*30, _iscale*30, getDir _x, "", 1];};} foreach zombies;};
  189. if sha then {{if (!isnull _x) then {_ctrl drawIcon ["\ca\ui\data\icon_animals_ca.paa", amc, getPosASL _x, _iscale*15, _iscale*15, 0, "", 1];};} foreach animalsl;};
  190. if sht then {{if (!isnull _x) then {_ctrl drawIcon ["\ca\ui\data\markers\waypoint.paa", tmc, getPosASL _x, 30, 30, 0, "", 1];};} foreach tents;};
  191. if shd then {{if ((!isnull _x) and !(_x isKindOf "zZombie_base") and (_x isKindOf "Man")) then {_ctrl drawIcon ["\ca\ui\data\map_chapel_ca.paa", amc, getPosASL _x, _iscale*30, _iscale*30, 0, "", 1];};} foreach AllDead;};
  192.  
  193. {if (!isnull _x) then {_ctrl drawIcon ["\ca\air2\data\ui\icon_uh1y_ca.paa", wmc, getPosASL _x, 30, 30, 0, "", 1];};} foreach helicrashes;
  194. {
  195. if (!isnull _x) then
  196. {
  197. _icon = getText(configFile >> "CfgVehicles" >> typeOf _x >> "icon");_irad = 30;
  198. if ((sci) and (_x iskindof "landvehicle")) then
  199. {_icon = "\ca\ui\data\iconpapercar_ca.paa";_irad = 20;};
  200. if (_x iskindof "Air") then {_irad = 40;};
  201. _ctrl drawIcon [_icon, vmc, getPosASL _x, _iscale*_irad, _iscale*_irad, getDir _x, "", 1];
  202. };
  203. } foreach (Entities "LandVehicle"+ Entities "Air" + Entities"Ship");
  204.  
  205. {
  206. if ((!isnull _x) and (getPlayerUID _x != "") and !(vehicle _x != _x)) then
  207. {
  208. if (_x == player) then {_color = [0, 0, 0, 1];} else {_color = pmc;};
  209. _ctrl drawIcon ["\ca\ui\data\iconman_ca.paa", _color, getPosASL _x, _iscale*30, _iscale*30, getDir _x, "", 1];
  210. };
  211. } foreach Entities "CAManBase";
  212.  
  213. };
  214.  
  215. };
  216.  
  217. portal =
  218. {
  219. if (!isnil "mapm") then
  220. {
  221. if ((_this select 1) and (tpe)) then
  222. {
  223. _pos = _this select 0;
  224. if tpa then {_dummyveh = "PBX" createVehicleLocal [_pos select 0, _pos select 1];player moveInDriver _dummyveh;deleteVehicle _dummyveh;}
  225. else {(vehicle player) setpos [_pos select 0, _pos select 1, 0];};
  226. _myuvbPos = player getVariable["lastPosition",[]];
  227. if (uvb) then {player setVariable["lastPosition",getPosASL player];};
  228. _myPos = player getVariable["lastPos",[]];
  229. if (count _myPos > 0) then {player setVariable["lastPos",getPosATL player];player setVariable["lastPos",[]];};
  230. openMap [false, false];onMapSingleClick "";
  231. }
  232. else {onMapSingleClick "";};
  233. };
  234. };
  235.  
  236. // Main cicle
  237. waituntil
  238. {
  239.  
  240. if (!isnil "mapm") then
  241. {
  242.  
  243. start_time = diag_tickTime;
  244.  
  245. if ((visiblemap) and (tpe))then
  246. {
  247. onMapSingleClick "[_pos, _alt] call portal;";
  248.  
  249. };
  250.  
  251. if (shz) then {zombies = getPosATL player nearEntities ["zZombie_Base", _zdist];} else {zombies = [];};
  252. if (sha) then {animalsl = getPosATL player nearEntities ["CAAnimalBase", _zdist];} else {animalsl = [];};
  253.  
  254. {
  255. if (!(_x in aList) and sha) then
  256. {
  257. private ["_pos", "_mkr"];
  258. _pos = getPos _x;
  259.  
  260. _mkr = createMarkerLocal [format ["AML%1%2", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
  261. _mkr setMarkerTypeLocal "waypoint";
  262. _mkr setMarkerSizeLocal [0,0];
  263. _mkr setMarkerColorLocal "ColorBlack";
  264. _mkr setMarkerTextLocal format["%1", gettext (configFile >> 'CfgVehicles' >> (typeof _x) >> 'displayName')];
  265. aList set [count aList, _x];
  266. [_x, _mkr] spawn
  267. {
  268. private ["_u", "_m"];
  269. _u = _this select 0;
  270. _m = _this select 1;
  271. while {mapm and sha and (getDammage _u < 1) } do
  272. {
  273. _m setMarkerPosLocal ([(getPos _u select 0) + 20, getPos _u select 1, 0]);
  274. sleep 0.01;
  275. };
  276. deleteMarkerLocal _m;
  277. if (_u in aList) then
  278. {
  279. aList set [(aList find _u), -1];
  280. aList = aList - [-1];
  281.  
  282. };
  283. true;
  284. };
  285. };
  286. } forEach animalsl;
  287. if shd then
  288. {
  289. {
  290. if (!(_x in dList) and !(_x isKindOf "zZombie_base") and (_x isKindOf "Man")) then
  291. {
  292. private ["_pos", "_mkr"];
  293. _pos = getPos _x;
  294.  
  295. _mkr = createMarkerLocal [format ["DBP%1%2", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
  296. _mkr setMarkerTypeLocal "waypoint";
  297. _mkr setMarkerSizeLocal [0,0];
  298. _mkr setMarkerColorLocal "ColorBlack";
  299. _mkr setMarkerTextLocal format["%1", _x getVariable["bodyName","unknown"]];
  300. _mkr setMarkerPosLocal ([(getPosATL _x select 0) + 15, getPosATL _x select 1, 0]);
  301. dList set [count dList, _x];
  302. [_x, _mkr] spawn
  303. {
  304. private ["_u", "_m"];
  305. _u = _this select 0;
  306. _m = _this select 1;
  307. while {mapm and shd and (!isnull _u)} do
  308. {
  309. sleep 0.5;
  310. };
  311. deleteMarkerLocal _m;
  312. if (_u in dList) then
  313. {
  314. dList set [(dList find _u), -1];
  315. dList = dList - [-1];
  316.  
  317. };
  318. true;
  319. };
  320. };
  321. } forEach AllDead;
  322. };
  323.  
  324. {
  325. if !(_x in vList) then
  326. {
  327. private ["_pos", "_mkr"];
  328. _pos = getPos _x;
  329. _mkr = createMarkerLocal [format ["VHC%1%2", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
  330. _mkr setMarkerTextLocal format["%1", gettext (configFile >> 'CfgVehicles' >> (typeof _x) >> 'displayName')];
  331. _mkr setMarkerTypeLocal "waypoint";
  332. _mkr setMarkerColorLocal "ColorRed";
  333. _mkr setMarkerSizeLocal [0,0];
  334. vList set [count vList, _x];
  335. [_x, _mkr] spawn
  336. {
  337. private ["_u", "_m"];
  338. _u = _this select 0;
  339. _m = _this select 1;
  340. _nc = this select 2;
  341. while {mapm} do
  342. {
  343. _m setMarkerPosLocal ([(getPos _u select 0) + 20, getPos _u select 1, 0]);
  344. sleep 0.01;
  345. };
  346. deleteMarkerLocal _m;
  347. if (_u in vList) then
  348. {
  349. vList set [(vList find _u), -1];
  350. vList = vList - [-1];
  351.  
  352. };
  353. true;
  354. };
  355. };
  356.  
  357. if (count (crew _x) > 0) then
  358. {
  359.  
  360. {
  361. if (!(_x in cList) and (alive _x) and (getPlayerUID _x != "")) then
  362. {
  363.  
  364. private ["_pos", "_mkr", "_vhc"];
  365. _vhc = vehicle _x;
  366. _pos = getPos _x;
  367. _mkr = createMarkerLocal [format ["CRW%1%2", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
  368. _mkr setMarkerTextLocal format[">%1", name _x];
  369. _mkr setMarkerTypeLocal "waypoint";
  370. _mkr setMarkerColorLocal "ColorBlue";
  371. _mkr setMarkerSizeLocal [0,0];
  372.  
  373. cList set [count cList, _x];
  374. [_x, _mkr,_vhc] spawn
  375. {
  376. private ["_u", "_m","_pc"];
  377. _u = _this select 0;
  378. _m = _this select 1;
  379. while {mapm and (alive _u) and (vehicle _u != _u) and (getPlayerUID _u != "")} do
  380. {
  381. _pc = ((crew vehicle _u) find _u);
  382. _m setMarkerPosLocal ([(getPos _u select 0) + 20, (getPos _u select 1) - (25 + _pc*20), 0]);
  383. sleep 0.01;
  384. };
  385. deleteMarkerLocal _m;
  386. if (_u in cList) then
  387. {
  388. cList set [(cList find _u), -1];
  389. cList = cList - [-1];
  390.  
  391. };
  392. true;
  393. };
  394.  
  395. };
  396. }forEach crew _x;
  397. };
  398.  
  399. } forEach (Entities "LandVehicle"+ Entities "Air" + Entities"Ship");
  400.  
  401. {
  402. if (!(_x in sList) and (player != _x) and (spi) and (getPlayerUID _x != "")) then
  403. {
  404. group _x addGroupIcon ["x_art", [0,0]];
  405. sList set [count sList, _x];
  406. [_x] spawn
  407. {
  408. private ["_u"];
  409. _u = _this select 0;
  410. while {(alive _u) and mapm and spi} do
  411. {
  412. group _u setGroupIconParams [pdmc,format ["%1 - %2m", name _u, ceil (_u distance player)],0.5,true];
  413. sleep 0.01;
  414. };
  415. clearGroupIcons group _u;
  416. if (_u in sList) then
  417. {
  418. sList set [(sList find _u), -1];
  419. sList = sList - [-1];
  420.  
  421. };
  422. true;
  423. };
  424. };
  425.  
  426. if (!(_x in pList) and (vehicle _x == _x) and (getPlayerUID _x != "")) then
  427. {
  428. private ["_pos", "_mkr"];
  429. _pos = getPos _x;
  430.  
  431. _mkr = createMarkerLocal [format ["PLR%1%2", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
  432. _mkr setMarkerTypeLocal "waypoint";
  433. _mkr setMarkerSizeLocal [0,0];
  434. _mkr setMarkerColorLocal "ColorBlue";
  435. _mkr setMarkerTextLocal format ["%1", name _x];
  436. if (_x == player) then
  437. {
  438. _mkr setMarkerColorLocal "ColorBlack";
  439. _mkr setMarkerTextLocal ptxt;
  440. };
  441. pList set [count pList, _x];
  442. [_x, _mkr] spawn
  443. {
  444. private ["_u", "_m"];
  445. _u = _this select 0;
  446. _m = _this select 1;
  447. while {mapm and (alive _u) and (vehicle _u == _u) and (getPlayerUID _u != "") } do
  448. {
  449. _m setMarkerPosLocal ([(getPos _u select 0) + 20, getPos _u select 1, 0]);
  450. sleep 0.01;
  451. };
  452. deleteMarkerLocal _m;
  453. if (_u in pList) then
  454. {
  455. pList set [(pList find _u), -1];
  456. pList = pList - [-1];
  457.  
  458. };
  459. true;
  460. };
  461. };
  462. } forEach Entities "CAManBase";
  463. sleep 0.1;
  464. };
  465. (isnil "mapm")
  466. };
  467. {clearGroupIcons group _x;} forEach Entities "CAManBase";
Add Comment
Please, Sign In to add comment