Guest User

yeah

a guest
Oct 15th, 2015
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.49 KB | None | 0 0
  1. /*
  2. LOCALISATION
  3. */
  4.  
  5. local vgui = vgui;
  6. local surface = surface;
  7. local render = render;
  8. local Color = Color;
  9. local input = input;
  10. local hook = hook;
  11. local next = next;
  12. local timer = timer;
  13. local util = util;
  14. local player = player;
  15. local Vector = Vector;
  16. local Angle = Angle;
  17. local bit = bit;
  18. local FindMetaTable = FindMetaTable;
  19. local team = team;
  20. local LocalPlayer = LocalPlayer;
  21. local draw = draw;
  22. local require = require;
  23. local debug = debug;
  24. local table = table;
  25. local Entity = Entity;
  26. local ScrW, ScrH = ScrW, ScrH;
  27. local RunConsoleCommand = RunConsoleCommand;
  28. local GAMEMODE = GAMEMODE;
  29. local CurTime = CurTime;
  30. local cam = cam;
  31. local CreateMaterial = CreateMaterial;
  32. local pmt = FindMetaTable("Player");
  33. local emt = FindMetaTable("Entity");
  34. local cmt = FindMetaTable("CUserCmd");
  35.  
  36. /*
  37. OPTIONS
  38. */
  39.  
  40. local options = {
  41. {
  42. "Aimbot",
  43. {"Active", true, "Checkbox"},
  44. {"Targeting Algorithm", "NextShot", "Selection", {"NextShot", "Distance", "Angle"}},
  45. {"Filters", nil, "Break"},
  46. {"Ignore Team", false, "Checkbox"},
  47. {"Ignore Team Color", false, "Checkbox"},
  48. {"Ignore Friends", false, "Checkbox"},
  49. {"Ignore Bots", false, "Checkbox"},
  50. {"Ignore Spawn Protected", true, "Checkbox"},
  51. {"Legit Settings", nil, "Break"},
  52. {"On Key", true, "Checkbox"},
  53. {"On Mouse", false, "Checkbox"},
  54. {"Smooth", false, "Checkbox"},
  55. {"Smooth Int", 0.5, "Slider", {0.01, 0.99, 2}},
  56. {"Visual Effects", nil, "Break"},
  57. {"Silent", true, "Checkbox"},
  58. {"Automation", nil, "Break"},
  59. {"Auto Shoot", true, "Checkbox"},
  60. {"Auto Pistol", true, "Checkbox"},
  61. {"Rage Settings", nil, "Break"},
  62. {"Bullet Time", false, "Checkbox"},
  63. {"Static", false, "Checkbox"},
  64. {"Aim Adjustment", nil, "Break"},
  65. {"Body Aim", false, "Checkbox"},
  66. {"Aim Position", "Hitbox", "Selection", {"Bone", "Hitbox"}}
  67. },
  68.  
  69. {
  70. "ESP",
  71. {"Active", true, "Checkbox"},
  72. {"Filters", nil, "Break"},
  73. {"Show Players", true, "Checkbox"},
  74. {"Show NPC's", false, "Checkbox"},
  75. {"Show SENT's", false, "Checkbox"},
  76. {"Basic", nil, "Break"},
  77. {"Box Type", "2D", "Selection", {"2D", "3D"}},
  78. {"Box", true, "Checkbox"},
  79. {"Filled Box", true, "Checkbox"},
  80. {"Healthbar", true, "Checkbox"},
  81. {"Snapline", true, "Checkbox"},
  82. {"Aim Pos", true, "Checkbox"},
  83. {"Skeleton", true, "Checkbox"},
  84. {"Text", nil, "Break"},
  85. {"Health", true, "Checkbox"},
  86. {"Name", true, "Checkbox"},
  87. {"Weapon", true, "Checkbox"},
  88. {"Money", true, "Checkbox"},
  89. {"Rank", true, "Checkbox"},
  90. {"Fancy", nil, "Break"},
  91. {"Barrel", true, "Checkbox"},
  92. {"HitBox", false, "Checkbox"},
  93. {"Filled HitBox", false, "Checkbox"},
  94. {"Material", nil, "Break"},
  95. {"Chams", true, "Checkbox"},
  96. {"Chams Type", "XQZ", "Selection", {"Solid", "Wireframe", "XQZ"}}
  97. },
  98.  
  99. {
  100. "Visuals",
  101. {"Active", true, "Checkbox"},
  102. {"Perspective", nil, "Break"},
  103. {"FoV", true, "Checkbox"},
  104. {"FoV Int", 120, "Slider", {90, 150, 0}},
  105. {"Third Person", false, "Checkbox"},
  106. {"ThirdPerson Int", 20, "Slider", {10, 20, 0}},
  107. {"Sky", false, "Checkbox"},
  108. {"Sky Type", "None", "Selection", {"None", "Rave"}},
  109. {"Viewmodel", nil, "Break"},
  110. {"No Hands", true, "Checkbox"},
  111. {"Weapon", true, "Checkbox"},
  112. {"Weapon Type", "Solid", "Selection", {"Wireframe", "Solid"}},
  113. {"Laser", true, "Checkbox"},
  114. {"Miscellaneous", nil, "Break"},
  115. {"Crosshair", true, "Checkbox"},
  116. {"Watermark", true, "Checkbox"},
  117. {"Crosshair Type", "Simple", "Selection", {"Simple", "Generic"}}
  118. },
  119.  
  120. {
  121. "Miscellaneous",
  122. {"Active", true, "Checkbox"},
  123. {"Automation", nil, "Break"},
  124. {"Bunny Hop", true, "Checkbox"},
  125. {"Auto Pistol", true, "Checkbox"},
  126. {"Auto Aim", false, "Checkbox"},
  127. {"Auto Use", false, "Checkbox"},
  128. {"Auto Flash", true, "Checkbox"},
  129. {"Auto Strafer", nil, "Break"},
  130. {"Auto Strafer", true, "Checkbox"},
  131. {"Auto-Strafer Type", "Forwards", "Selection", {"Forwards", "Backwards", "Sideways", "W-Hop"}},
  132. {"View Fix", true, "Checkbox"},
  133. {"HvH", nil, "Break"},
  134. {"FakeLag", false, "Checkbox"},
  135. {"Slider", "FakeLag Int", {1, 14, 0}},
  136. {"Anti-Aim", false, "Checkbox"},
  137. {"Selection", "FakeDown", "Anti-Aim X", {"FakeDown", "FakeUp", "Jitter", "OOB"}},
  138. {"Selection", "FakeSide", "Anti-Aim Y", {"FakeSide", "Random"}},
  139. {"Removals", nil, "Break"},
  140. {"No Spread", true, "Checkbox"},
  141. {"No Recoil", true, "Checkbox"},
  142. {"No Punch", true, "Checkbox"},
  143. {"No Visual Recoil", true, "Checkbox"},
  144. {"Edge Jump", true, "Checkbox"},
  145. {"Name Stealer", false, "Checkbox"},
  146. {"Name Stealer Type", "Steam", "Selection", {"Steam", "DarkRP"}},
  147. {"Name Stealer Int", 6, "Slider", {1, 30, 0}},
  148. },
  149.  
  150. {
  151. "Colors",
  152. {"Menu", nil, "Break"},
  153. {"Menu - R", 147, "Slider", {0, 255, 0}},
  154. {"Menu - G", 112, "Slider", {0, 255, 0}},
  155. {"Menu - B", 219, "Slider", {0, 255, 0}},
  156. {"Team", nil, "Break"},
  157. {"Team - R", 0, "Slider", {0, 255, 0}},
  158. {"Team - G", 0, "Slider", {0, 255, 0}},
  159. {"Team - B", 0, "Slider", {0, 255, 0}},
  160. {"Enemy", nil, "Break"},
  161. {"Enemy - R", 0, "Slider", {0, 255, 0}},
  162. {"Enemy - G", 0, "Slider", {0, 255, 0}},
  163. {"Enemy - B", 0, "Slider", {0, 255, 0}},
  164. }
  165. };
  166.  
  167. /*
  168. FLOATS
  169. */
  170.  
  171. local floats = {
  172. {
  173. "Key",
  174. {KEY_INSERT, false, false},
  175. {KEY_F, false, false}
  176. },
  177.  
  178. {
  179. "Mouse",
  180. {MOUSE_MIDDLE, false, false},
  181. {MOUSE_LEFT, false, false}
  182. },
  183.  
  184. {
  185. "Menu",
  186. {"Active Tab", "Aimbot"},
  187. {"Wait", RealTime()}
  188. }
  189. }
  190.  
  191. /*
  192. FONTS
  193. */
  194.  
  195. surface.CreateFont("MenuFont", {
  196. font = "HaxrCorp S8 Standard",
  197. size = 14,
  198. antialias = false,
  199. shadow = true,
  200. })
  201.  
  202. surface.CreateFont("_MenuFont", {
  203. font = "HaxrCorp S8 Standard",
  204. size = 12,
  205. antialias = false,
  206. shadow = true,
  207. })
  208.  
  209. /*
  210. MENU FUNCS
  211. */
  212.  
  213. local function gVal(t, c, o)
  214. for k,v in next, t do
  215. if (c != t[k][1]) then continue; end
  216. for i = 2, #t[k] do
  217. if (t[k][i][1] != o) then continue; end
  218. if (t[k][i][3] == "Break") then continue; end
  219. return t[k][i][2];
  220. end
  221. end
  222. end
  223.  
  224. local function sVal(t, c, o, v)
  225. for k,_v in next, t do
  226. if (c != t[k][1]) then continue; end
  227. for i = 2, #t[k] do
  228. if (t[k][i][1] != o) then continue; end
  229. t[k][i][2] = v;
  230. end
  231. end
  232. end
  233.  
  234. local function gKey(c, o)
  235. for i = 1, 2 do
  236. if (c != floats[i][1]) then continue; end
  237. for _i = 2, #floats[i] do
  238. if (floats[i][_i][1] != o) then continue; end
  239. return floats[i][_i][2] && !floats[i][_i][3];
  240. end
  241. end
  242. end
  243.  
  244. local function UpdateKeys()
  245. for i = 1, 2 do
  246. for _i = 2, #floats[i] do
  247. floats[i][_i][3] = floats[i][_i][2];
  248. if (i == 1) then
  249. floats[i][_i][2] = input.IsKeyDown(floats[i][_i][1]);
  250. end
  251. if (i == 2) then
  252. floats[i][_i][2] = input.IsMouseDown(floats[i][_i][1]);
  253. end
  254. end
  255. end
  256. end
  257.  
  258. local function CursorHovering(x, y, w, h, m)
  259. local cx, cy = input.GetCursorPos();
  260. local px, py = m:GetPos();
  261. x = x + px;
  262. y = y + py;
  263. return (cx > x && cx < (x+w) && cy > y && cy < (y+h));
  264. end
  265.  
  266. /*
  267. DRAWING
  268. */
  269.  
  270. local function DrawRect(x, y, w, h, c)
  271. surface.SetDrawColor(c);
  272. surface.DrawRect(x, y, w, h);
  273. end
  274.  
  275. local function DrawOutlinedRect(x, y, w, h, c)
  276. surface.SetDrawColor(c);
  277. surface.DrawOutlinedRect(x, y, w, h);
  278. end
  279.  
  280. local function DrawText(s, f, x, y, c, ax, ay)
  281. surface.SetFont(f);
  282.  
  283. local w, h = surface.GetTextSize(s);
  284.  
  285. surface.SetTextColor(c);
  286.  
  287. x = (ax == "c" && x - w/2) || (ax == "r" && x - w) || x;
  288. y = (ay == "c" && y - h/2) || (ay == "b" && y - h) || y;
  289.  
  290. surface.SetTextPos(math.ceil(x), math.ceil(y));
  291. surface.DrawText(s);
  292.  
  293. return w, h;
  294. end
  295.  
  296. local function DrawLine(x, y, _x, _y, c)
  297. surface.SetDrawColor(c);
  298. surface.DrawLine(x, y, _x, _y);
  299. end
  300.  
  301. local function DrawTab(s, x, w, h, c, m)
  302. DrawRect(x, 24, w, h, (s == gVal(floats, "Menu", "Active Tab") && c || CursorHovering(x, 24, w, h, m) && Color(c.r*1.1, c.g*1.1, c.b*1.1) || Color(c.r/1.5, c.g/1.5, c.b/1.5)));
  303. DrawText(s, "_MenuFont", x+w/2, 24+h/2, Color(255, 255, 255), "c", "c");
  304.  
  305. if (CursorHovering(x, 24, w, h, m) && input.IsMouseDown(MOUSE_LEFT)) then
  306. sVal(floats, "Menu", "Active Tab", s);
  307. end
  308. end
  309.  
  310. local function DrawCheckbox(s, y, c, o, _c, m)
  311. DrawOutlinedRect(10, y, 10, 10, Color(0,0,0));
  312.  
  313. DrawRect(11, y+1, 8, 8, Color(255,255,255));
  314.  
  315. local w, h = surface.GetTextSize(s);
  316.  
  317. DrawRect(12, y+2, 6, 6, (gVal(options, c, o) && _c || CursorHovering(10, y, 15 + w, 10, m) && Color(150, 150, 150) || Color(255,255,255)));
  318. DrawText(s, "_MenuFont", 23, y+4, Color(255, 255, 255), "l", "c");
  319.  
  320. if (CursorHovering(10, y, 15 + w, 10, m) && input.IsMouseDown(MOUSE_LEFT) && RealTime() > gVal(floats, "Menu", "Wait")) then
  321. sVal(options, c, o, !gVal(options, c, o));
  322. sVal(floats, "Menu", "Wait", RealTime() + 0.1)
  323. end
  324. end
  325.  
  326. local function DrawBreak(s, y, c, m)
  327. local w, h = surface.GetTextSize(s);
  328.  
  329. DrawText(s, "_MenuFont", 390, y+5, CursorHovering(395 - w, y, w, h, m) && Color(math.random(10,255),math.random(10,255),math.random(10,255)) || c, "r", "c");
  330. DrawLine(10, y+5, 386 - w, y+5, c);
  331. end
  332.  
  333. local function DrawSlider(s, y, c, o, _s, b, d, _c, m)
  334. local x, _y = input.GetCursorPos();
  335. local _x, __y = m:GetPos();
  336.  
  337. DrawText(s, "_MenuFont", 13, y+4, Color(255, 255, 255), "l", "c");
  338. DrawText(math.floor(gVal(options, c, o)*10^d)/10^d, "_MenuFont", 390, y+4, Color(255, 255, 255), "r", "c");
  339. DrawLine(15, y+25, 385, y+25, _c);
  340.  
  341. DrawOutlinedRect(14, y+24, 373, 3, Color(0,0,0));
  342. DrawOutlinedRect(((gVal(options, c, o)-_s)/(b-_s)*370)+10, y+15, 10, 20, Color(0,0,0));
  343.  
  344. DrawRect(((gVal(options, c, o)-_s)/(b-_s)*370)+11, y+16, 8, 18, Color(255,255,255));
  345. DrawRect(((gVal(options, c, o)-_s)/(b-_s)*370)+12, y+17, 6, 16, CursorHovering(((gVal(options, c, o)-_s)/(b-_s)*370)+10, y+15, 10, 20, m) && Color(150,150,150) || Color(255,255,255));
  346.  
  347. if (CursorHovering(15, y+15, 371, 20, m) && input.IsMouseDown(MOUSE_LEFT)) then
  348. local val = (x-_x-15)/370*(b-_s)+_s;
  349.  
  350. sVal(options, c, o, val);
  351. end
  352. end
  353.  
  354. local function DrawSelection(s, y, c, o, t, _c, m)
  355. for i = 1, #t do
  356. if (t[i] == gVal(options, c, o)) then
  357. q=i;
  358. end
  359. end
  360. DrawText(s, "_MenuFont", 13, y+4, _c, "l", "c");
  361. DrawText(q, "_MenuFont", 390, y+4, _c, "r", "c");
  362.  
  363. DrawRect(11, y+16, 18, 18, _c);
  364. DrawRect(12, y+17, 16, 16, CursorHovering(10, y+15, 20, 20, m) && Color(150,150,150) || _c);
  365.  
  366. DrawLine(15, y+25, 25, y+25, Color(0,0,0));
  367. DrawLine(29, y+15, 29, y+35, Color(0,0,0));
  368.  
  369. DrawOutlinedRect(10, y+15, 380, 20, Color(0,0,0));
  370.  
  371. DrawRect(371, y+16, 18, 18, _c);
  372. DrawRect(372, y+17, 16, 16, CursorHovering(370, y+15, 20, 20, m) && Color(150,150,150) || _c);
  373.  
  374. DrawLine(375, y+25, 385, y+25, Color(0,0,0));
  375.  
  376. DrawRect(30, y+16, 340, 18, Color(150,150,150));
  377.  
  378. DrawText(gVal(options, c, o), "_MenuFont", 200, y+25, CursorHovering(30, y+15, 340, 20, m) && Color(math.random(10,255),math.random(10,255),math.random(10,255)) || Color(255,255,255), "c", "c");
  379.  
  380. if (CursorHovering(10, y+15, 20, 20, m) && input.IsMouseDown(MOUSE_LEFT) && RealTime() > gVal(floats, "Menu", "Wait")) then
  381. sVal(options, c, o, (t[math.Clamp(q-1, 1, #t)]));
  382. sVal(floats, "Menu", "Wait", RealTime() + 0.1);
  383. end
  384.  
  385. if (CursorHovering(370, y+15, 20, 20, m) && input.IsMouseDown(MOUSE_LEFT) && RealTime() > gVal(floats, "Menu", "Wait")) then
  386. sVal(options, c, o, (t[math.Clamp(q+1, 1, #t)]));
  387. sVal(floats, "Menu", "Wait", RealTime() + 0.1);
  388. end
  389.  
  390. if (CursorHovering(30, y+15, 340, 20, m) && input.IsMouseDown(MOUSE_LEFT) && RealTime() > gVal(floats, "Menu", "Wait")) then
  391. sVal(options, c, o, (t[math.random(1, #t)]));
  392. sVal(floats, "Menu", "Wait", RealTime() + 0.1);
  393. end
  394. end
  395.  
  396. /*
  397. MENU
  398. */
  399.  
  400. local Frame = vgui.Create("DFrame")
  401. Frame:SetSize(400, 500)
  402. Frame:ShowCloseButton(false)
  403. Frame:SetTitle("")
  404. Frame:MakePopup()
  405. Frame:Center()
  406.  
  407. function Frame.Paint(self)
  408. local sw, sh = self:GetWide(), self:GetTall();
  409.  
  410. DrawOutlinedRect(0, 0, sw, sh, Color(0, 0, 0));
  411.  
  412. DrawRect(1, 1, sw-2, sh-2, Color(gVal(options, "Colors", "Menu - R"), gVal(options, "Colors", "Menu - G"), gVal(options, "Colors", "Menu - B")));
  413.  
  414. DrawOutlinedRect(3, 23, sw-6, sh-26, Color(0, 0, 0));
  415.  
  416. DrawRect(4, 24, sw-8, sh-28, Color(80, 80, 80));
  417.  
  418. DrawText("memehook public release", "MenuFont", self:GetWide()/2, 11, Color(255,255,255), "c", "c");
  419.  
  420. for k,v in next, options do
  421. DrawTab(options[k][1], 4+(((sw-8)/#options)*(k-1)), math.ceil((sw-8)/#options), 20, Color(gVal(options, "Colors", "Menu - R"), gVal(options, "Colors", "Menu - G"), gVal(options, "Colors", "Menu - B")), self);
  422.  
  423. if (gVal(floats, "Menu", "Active Tab") == options[k][1]) then
  424. local menuy = 50;
  425.  
  426. for i = 2, #options[k] do
  427.  
  428. if (options[k][i][3] == "Checkbox") then
  429. DrawCheckbox(options[k][i][1], menuy, options[k][1], options[k][i][1], Color(gVal(options, "Colors", "Menu - R"), gVal(options, "Colors", "Menu - G"), gVal(options, "Colors", "Menu - B")), self);
  430. menuy = menuy + 15;
  431.  
  432. elseif (options[k][i][3] == "Slider") then
  433. DrawSlider(options[k][i][1], menuy, options[k][1], options[k][i][1], options[k][i][4][1], options[k][i][4][2], options[k][i][4][3], Color(255,255,255), self);
  434. menuy = menuy + 40;
  435.  
  436. elseif (options[k][i][3] == "Selection") then
  437. DrawSelection(options[k][i][1], menuy, options[k][1], options[k][i][1], options[k][i][4], Color(255,255,255), self);
  438. menuy = menuy + 40;
  439.  
  440. elseif (options[k][i][3] == "Break") then
  441. DrawBreak(options[k][i][1], menuy, Color(255,255,255), self);
  442. menuy = menuy + 15;
  443. end
  444. end
  445. end
  446. end
  447. end
  448.  
  449. local open = true;
  450.  
  451. local function Menu()
  452. if (gKey("Key", KEY_INSERT) && !LocalPlayer():IsTyping()) then
  453. open = !open;
  454. Frame:SetVisible(open)
  455. end
  456. end
  457.  
  458. /*
  459. HOOKING
  460. */
  461.  
  462. function GAMEMODE:Think()
  463. UpdateKeys();
  464. Menu();
  465. end
Advertisement
Add Comment
Please, Sign In to add comment