Guest User

memehook public src

a guest
Oct 16th, 2015
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 13.53 KB | None | 0 0
  1. /*
  2.                               .__                   __    
  3.   _____   ____   _____   ____ |  |__   ____   ____ |  | __
  4.  /     \_/ __ \ /     \_/ __ \|  |  \ /  _ \ /  _ \|  |/ /
  5. |  Y Y  \  ___/|  Y Y  \  ___/|   Y  (  <_> |  <_> )    <
  6. |__|_|  /\___  >__|_|  /\___  >___|  /\____/ \____/|__|_ \
  7.       \/     \/      \/     \/     \/                   \/
  8.       ya nigaz new fukinnnzzz hack from weed_head
  9.       creditz: weed_head, yung pain (my nigga for real), eth0s
  10.       ya
  11. */
  12.  
  13. /*
  14. LOCALISATION
  15. */
  16.  
  17. local vgui = vgui;
  18. local surface = surface;
  19. local render = render;
  20. local input = input;
  21. local hook = hook;
  22. local timer = timer;
  23. local util = util;
  24. local player = player;
  25. local bit = bit;
  26. local team = team;
  27. local draw = draw;
  28. local debug = debug;
  29. local table = table;
  30. local GAMEMODE = GAMEMODE;
  31. local cam = cam;
  32.  
  33. local Color = Color;
  34. local next = next;
  35. local Vector = Vector;
  36. local Angle = Angle;
  37. local FindMetaTable = FindMetaTable;
  38. local LocalPlayer = LocalPlayer;
  39. local require = require;
  40. local Entity = Entity;
  41. local ScrW, ScrH = ScrW, ScrH;
  42. local RunConsoleCommand = RunConsoleCommand;
  43. local CurTime = CurTime;
  44. local CreateMaterial = CreateMaterial;
  45.  
  46. local pmt = FindMetaTable("Player");
  47. local emt = FindMetaTable("Entity");
  48. local cmt = FindMetaTable("CUserCmd");
  49.  
  50. /*
  51. OPTIONS
  52. */
  53.  
  54. local options = {
  55.     {  
  56.         "Aimbot",
  57.         {"aimbot func", false, "Checkbox"},
  58.     },
  59.    
  60.    
  61.     {
  62.         "Visuals",
  63.         {"esp", false, "Checkbox"},
  64.         {"esp 2", false, "Checkbox"},
  65.     },
  66.    
  67.     {
  68.         "Misc",
  69.         {"BHop", false, "Checkbox"},
  70.         {"antaim", false, "Checkbox"},
  71.  
  72.     },
  73.    
  74.     {
  75.         "Colors",
  76.         {"Menu", nil, "Break"},
  77.         {"Menu - R", 147, "Slider", {0, 255, 0}},
  78.         {"Menu - G", 112, "Slider", {0, 255, 0}},
  79.         {"Menu - B", 219, "Slider", {0, 255, 0}},
  80.         {"Team", nil, "Break"},
  81.         {"Team - R", 0, "Slider", {0, 255, 0}},
  82.         {"Team - G", 0, "Slider", {0, 255, 0}},
  83.         {"Team - B", 0, "Slider", {0, 255, 0}},
  84.         {"Enemy", nil, "Break"},
  85.         {"Enemy - R", 0, "Slider", {0, 255, 0}},
  86.         {"Enemy - G", 0, "Slider", {0, 255, 0}},
  87.         {"Enemy - B", 0, "Slider", {0, 255, 0}},
  88.     }
  89. };
  90.  
  91. /*
  92. FLOATS
  93. */
  94.  
  95. local floats = {
  96.     {  
  97.         "Key",
  98.         {KEY_INSERT, false, false},
  99.         {KEY_F, false, false}
  100.     },
  101.    
  102.     {  
  103.         "Mouse",
  104.         {MOUSE_MIDDLE, false, false},
  105.         {MOUSE_LEFT, false, false}
  106.     },
  107.    
  108.     {  
  109.         "Menu",
  110.         {"Active Tab", "Aimbot"},
  111.         {"Wait", RealTime()}
  112.     }
  113. }
  114.  
  115. /*
  116. FONTS
  117. */
  118.  
  119. surface.CreateFont("MenuFont", {
  120.     font = "HaxrCorp S8 Standard",
  121.     size = 14,
  122.     antialias = false,
  123.     shadow = true,
  124. })
  125.  
  126. surface.CreateFont("_MenuFont", {
  127.     font = "HaxrCorp S8 Standard",
  128.     size = 12,
  129.     antialias = false,
  130.     shadow = true,
  131. })
  132.  
  133. /*
  134. MENU FUNCS
  135. */
  136.  
  137. local function gVal(t, c, o)
  138.     for k,v in next, t do
  139.         if (c != t[k][1]) then continue; end
  140.         for i = 2, #t[k] do
  141.             if (t[k][i][1] != o) then continue; end
  142.             if (t[k][i][3] == "Break") then continue; end
  143.             return t[k][i][2];
  144.         end
  145.     end
  146. end
  147.  
  148. local function sVal(t, c, o, v)
  149.     for k,_v in next, t do
  150.         if (c != t[k][1]) then continue; end
  151.         for i = 2, #t[k] do
  152.             if (t[k][i][1] != o) then continue; end
  153.             t[k][i][2] = v;
  154.         end
  155.     end
  156. end
  157.  
  158. local function gKey(c, o)
  159.     for i = 1, 2 do
  160.         if (c != floats[i][1]) then continue; end
  161.         for _i = 2, #floats[i] do
  162.             if (floats[i][_i][1] != o) then continue; end
  163.             return floats[i][_i][2] && !floats[i][_i][3];
  164.         end
  165.     end
  166. end
  167.  
  168. local function UpdateKeys()
  169.     for i = 1, 2 do
  170.         for _i = 2, #floats[i] do
  171.             floats[i][_i][3] = floats[i][_i][2];
  172.             if (i == 1) then
  173.                 floats[i][_i][2] = input.IsKeyDown(floats[i][_i][1]);
  174.             end
  175.             if (i == 2) then
  176.                 floats[i][_i][2] = input.IsMouseDown(floats[i][_i][1]);
  177.             end
  178.         end
  179.     end
  180. end
  181.  
  182. local function CursorHovering(x, y, w, h, m)
  183.     local cx, cy = input.GetCursorPos();
  184.     local px, py = m:GetPos();
  185.     x = x + px;
  186.     y = y + py;
  187.     return (cx > x && cx < (x+w) && cy > y && cy < (y+h));
  188. end
  189.  
  190. /*
  191. DRAWING
  192. */
  193.  
  194. local function DrawRect(x, y, w, h, c)
  195.     surface.SetDrawColor(c);
  196.     surface.DrawRect(x, y, w, h);
  197. end
  198.  
  199. local function DrawOutlinedRect(x, y, w, h, c)
  200.     surface.SetDrawColor(c);
  201.     surface.DrawOutlinedRect(x, y, w, h);
  202. end
  203.  
  204. local function DrawText(s, f, x, y, c, ax, ay)
  205.     surface.SetFont(f);
  206.  
  207.     local w, h = surface.GetTextSize(s);
  208.  
  209.     surface.SetTextColor(c);
  210.  
  211.     x = (ax == "c" && x - w/2) || (ax == "r" && x - w) || x;
  212.     y = (ay == "c" && y - h/2) || (ay == "b" && y - h) || y;
  213.  
  214.     surface.SetTextPos(math.ceil(x), math.ceil(y));
  215.     surface.DrawText(s);
  216.  
  217.     return w, h;
  218. end
  219.  
  220. local function DrawLine(x, y, _x, _y, c)
  221.     surface.SetDrawColor(c);
  222.     surface.DrawLine(x, y, _x, _y);
  223. end
  224.  
  225. local function DrawTab(s, x, w, h, c, m)
  226.     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)));
  227.     DrawText(s, "_MenuFont", x+w/2, 24+h/2, Color(255, 255, 255), "c", "c");
  228.  
  229.     if (CursorHovering(x, 24, w, h, m) && input.IsMouseDown(MOUSE_LEFT)) then
  230.         sVal(floats, "Menu", "Active Tab", s);
  231.     end
  232. end
  233.  
  234. local function DrawCheckbox(s, y, c, o, _c, m)
  235.     DrawOutlinedRect(10, y, 10, 10, Color(0,0,0));
  236.  
  237.     DrawRect(11, y+1, 8, 8, Color(255,255,255));
  238.  
  239.     local w, h = surface.GetTextSize(s);
  240.  
  241.     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)));
  242.     DrawText(s, "_MenuFont", 23, y+4, Color(255, 255, 255), "l", "c");
  243.  
  244.     if (CursorHovering(10, y, 15 + w, 10, m) && input.IsMouseDown(MOUSE_LEFT) && RealTime() > gVal(floats, "Menu", "Wait")) then
  245.         sVal(options, c, o, !gVal(options, c, o));
  246.         sVal(floats, "Menu", "Wait", RealTime() + 0.1)
  247.     end
  248. end
  249.  
  250. local function DrawBreak(s, y, c, m)
  251.     local w, h = surface.GetTextSize(s);
  252.  
  253.     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");
  254.     DrawLine(10, y+5, 386 - w, y+5, c);
  255. end
  256.  
  257. local function DrawSlider(s, y, c, o, _s, b, d, _c, m)
  258.     local x, _y = input.GetCursorPos();
  259.     local _x, __y = m:GetPos();
  260.  
  261.     DrawText(s, "_MenuFont", 13, y+4, Color(255, 255, 255), "l", "c");
  262.     DrawText(math.floor(gVal(options, c, o)*10^d)/10^d, "_MenuFont", 390, y+4, Color(255, 255, 255), "r", "c");
  263.     DrawLine(15, y+25, 385, y+25, _c);
  264.  
  265.     DrawOutlinedRect(14, y+24, 373, 3, Color(0,0,0));
  266.     DrawOutlinedRect(((gVal(options, c, o)-_s)/(b-_s)*370)+10, y+15, 10, 20, Color(0,0,0));
  267.  
  268.     DrawRect(((gVal(options, c, o)-_s)/(b-_s)*370)+11, y+16, 8, 18, Color(255,255,255));
  269.     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));
  270.  
  271.     if (CursorHovering(15, y+15, 371, 20, m) && input.IsMouseDown(MOUSE_LEFT)) then
  272.         local val = (x-_x-15)/370*(b-_s)+_s;
  273.  
  274.         sVal(options, c, o, val);
  275.     end
  276. end
  277.  
  278. local function DrawSelection(s, y, c, o, t, _c, m)
  279.     for i = 1, #t do
  280.         if (t[i] == gVal(options, c, o)) then
  281.             q=i;
  282.         end
  283.     end
  284.     DrawText(s, "_MenuFont", 13, y+4, _c, "l", "c");
  285.     DrawText(q, "_MenuFont", 390, y+4, _c, "r", "c");
  286.  
  287.     DrawRect(11, y+16, 18, 18, _c);
  288.     DrawRect(12, y+17, 16, 16, CursorHovering(10, y+15, 20, 20, m) && Color(150,150,150) || _c);
  289.  
  290.     DrawLine(15, y+25, 25, y+25, Color(0,0,0));
  291.     DrawLine(29, y+15, 29, y+35, Color(0,0,0));
  292.  
  293.     DrawOutlinedRect(10, y+15, 380, 20, Color(0,0,0));
  294.  
  295.     DrawRect(371, y+16, 18, 18, _c);
  296.     DrawRect(372, y+17, 16, 16, CursorHovering(370, y+15, 20, 20, m) && Color(150,150,150) || _c);
  297.  
  298.     DrawLine(375, y+25, 385, y+25, Color(0,0,0));
  299.  
  300.     DrawRect(30, y+16, 340, 18, Color(150,150,150));
  301.  
  302.     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");
  303.  
  304.     if (CursorHovering(10, y+15, 20, 20, m) && input.IsMouseDown(MOUSE_LEFT) && RealTime() > gVal(floats, "Menu", "Wait")) then
  305.         sVal(options, c, o, (t[math.Clamp(q-1, 1, #t)]));
  306.         sVal(floats, "Menu", "Wait", RealTime() + 0.1);
  307.     end
  308.  
  309.     if (CursorHovering(370, y+15, 20, 20, m) && input.IsMouseDown(MOUSE_LEFT) && RealTime() > gVal(floats, "Menu", "Wait")) then
  310.         sVal(options, c, o, (t[math.Clamp(q+1, 1, #t)]));
  311.         sVal(floats, "Menu", "Wait", RealTime() + 0.1);
  312.     end
  313.  
  314.     if (CursorHovering(30, y+15, 340, 20, m) && input.IsMouseDown(MOUSE_LEFT) && RealTime() > gVal(floats, "Menu", "Wait")) then
  315.         sVal(options, c, o, (t[math.random(1, #t)]));
  316.         sVal(floats, "Menu", "Wait", RealTime() + 0.1);
  317.     end
  318. end
  319.  
  320. /*
  321. MENU
  322. */
  323.  
  324. local Frame = vgui.Create("DFrame")
  325. Frame:SetSize(400, 500)
  326. Frame:ShowCloseButton(false)
  327. Frame:SetTitle("")
  328. Frame:MakePopup()
  329. Frame:Center()
  330.  
  331. function Frame.Paint(self)
  332.     local sw, sh = self:GetWide(), self:GetTall();
  333.  
  334.     DrawOutlinedRect(0, 0, sw, sh, Color(0, 0, 0));
  335.  
  336.     DrawRect(1, 1, sw-2, sh-2, Color(gVal(options, "Colors", "Menu - R"), gVal(options, "Colors", "Menu - G"), gVal(options, "Colors", "Menu - B")));
  337.  
  338.     DrawOutlinedRect(3, 23, sw-6, sh-26, Color(0, 0, 0));
  339.  
  340.     DrawRect(4, 24, sw-8, sh-28, Color(80, 80, 80));
  341.  
  342.     DrawText("memehook public release", "MenuFont", self:GetWide()/2, 11, Color(255,255,255), "c", "c");
  343.  
  344.     for k,v in next, options do
  345.         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);
  346.  
  347.         if (gVal(floats, "Menu", "Active Tab") == options[k][1]) then
  348.             local menuy = 50;
  349.  
  350.             for i = 2, #options[k] do
  351.  
  352.                 if (options[k][i][3] == "Checkbox") then
  353.                     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);
  354.                     menuy = menuy + 15;
  355.  
  356.                 elseif (options[k][i][3] == "Slider") then
  357.                     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);
  358.                     menuy = menuy + 40;
  359.  
  360.                 elseif (options[k][i][3] == "Selection") then
  361.                     DrawSelection(options[k][i][1], menuy, options[k][1], options[k][i][1], options[k][i][4], Color(255,255,255), self);
  362.                     menuy = menuy + 40;
  363.  
  364.                 elseif (options[k][i][3] == "Break") then
  365.                     DrawBreak(options[k][i][1], menuy, Color(255,255,255), self);
  366.                     menuy = menuy + 15;
  367.                 end
  368.             end
  369.         end
  370.     end
  371. end
  372.  
  373. local open = true;
  374.  
  375. local function Menu()
  376.     if (gKey("Key", KEY_INSERT) && !LocalPlayer():IsTyping()) then
  377.         open = !open;
  378.         Frame:SetVisible(open)
  379.     end
  380. end
  381.  
  382. /*
  383. HOOKING
  384. */
  385.  
  386. function GAMEMODE:Think()
  387.     UpdateKeys();
  388.     Menu();
  389. end
  390.  
  391. /*
  392. actual codenz lal
  393. */
  394.  
  395. local function gethead(v)
  396.     local pos, ang = v:GetBonePosition(v:LookupBone("ValveBiped.Bip01_Head1"))
  397.     if pos then
  398.         return pos
  399.     end
  400. end
  401.  
  402. local me = LocalPlayer()
  403. local function trashaimbot(cmd)
  404.     if (!gVal("aimbot", "aimbot func")) then return; end
  405.     local myteam = ( team.GetName( me:Team() ) )
  406.     for k,v in next, player.GetAll() do
  407.  
  408.     if (!IsValid(v)
  409.      or v:Health() < 1
  410.      or v:IsDormant()
  411.      or v == me
  412.      or v:Team() == LocalPlayer():Team() ) then
  413.      continue
  414.     end
  415.    
  416.     local head = gethead(v)
  417.     local mypos = me:GetShootPos()
  418.     local tracetable = {
  419.      start = head,
  420.      endpos = mypos,
  421.      filter = {me, v},
  422.      mask = MASK_SHOT
  423.     }
  424.    
  425.     if util.TraceLine(tracetable).Fraction == 1 then
  426.      aiming = 1
  427.      cmd:SetViewAngles((head - mypos):Angle())
  428.      cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_ATTACK))
  429.     else
  430.      aiming = 0
  431.   end
  432.  end
  433. end
  434.  
  435. hook.Add("CreateMove", "", trashaimbot)
  436.  
  437.  
  438. -- WIKI ESPNames I DONT CARE IM BIG HACK USER
  439. hook.Add( "HUDPaint", "ESPNames", function()
  440.     if (!gVal("Visuals", "esp 2")) then return; end
  441.  
  442.  for k,v in pairs ( player.GetAll() ) do
  443.  
  444.   local Position = ( v:GetPos() + Vector( 0,0,80 ) ):ToScreen()
  445.   local Name = ""
  446.  
  447.   if v == LocalPlayer() then Name = "" else Name = v:Name() end
  448.  
  449.   draw.DrawText( Name, "DebugFixedSmall", Position.x, Position.y, Color( 255, 0, 255, 255 ), 1 )
  450.  
  451.  end
  452.  
  453. end )
  454.  
  455.  
  456. -- BAD ANTI AIM
  457. CreateClientConVar("kayko_AntiAim",0,true,false)
  458.  
  459. hook.Add("CreateMove","AntiAim", function(CUserCmd)
  460.     if (!gVal("Misc", "antiaim")) then return; end
  461.  local AntiAimToggle = CreateClientConVar( "kayko_AntiAim", 0, true, false )
  462.   if AntiAimToggle:GetInt() == 1 && LocalPlayer():Alive() && aiming == 0 then
  463.    CUserCmd:SetViewAngles(Angle(-181, LocalPlayer():EyeAngles().y, 180))
  464.   end
  465. end)
  466.  
  467. CreateClientConVar("kayko_lock",0,true,false)
  468.  
  469. hook.Add( "HUDPaint", "IAmLocked", function()
  470.   if GetConVar("kayko_lock"):GetInt() == 1 then
  471.  if aiming == 1 then
  472.   draw.DrawText( "Target Locked", "CloseCaption_Bold", 800, 500, Color( 0, 255, 0, 255 ), 1 )
  473.  else
  474.   draw.DrawText( "Locating Target", "CloseCaption_Bold", 800, 500, Color( 255, 0, 0, 255 ), 1 )
  475.  end
  476. end  
  477. end )
  478.  
  479. -- WORST BHOP EVER
  480. hook.Add("Think", "Bhop", function()
  481.     if (!gVal("Misc", "BHop")) then return; end
  482.  if input.IsKeyDown(KEY_SPACE) && LocalPlayer():IsOnGround() && !LocalPlayer():IsTyping() then
  483.   RunConsoleCommand( "+jump" )
  484.  else
  485.   RunConsoleCommand( "-jump" )
  486.  end
  487. end)
  488.  
  489.  
  490. /*
  491. WATERMARK
  492. */
  493. surface.CreateFont( "MyFont", {
  494.     font = "Arial",
  495.     size = 25,
  496.     weight = 500,
  497.     blursize = 0,
  498.     scanlines = 0,
  499.     antialias = true,
  500.     underline = false,
  501.     italic = true,
  502.     strikeout = false,
  503.     symbol = false,
  504.     rotary = false,
  505.     shadow = false,
  506.     additive = false,
  507.     outline = false,
  508. } )
  509.  
  510.  
  511.  
  512. hook.Add( "HUDPaint", "drawsometext", function()
  513.     if (!gVal("Visuals", "esp")) then return; end
  514.     surface.SetFont( "MyFont" )
  515.     surface.SetTextColor(255, 0, 255)
  516.     surface.SetTextPos( 600, 70 )
  517.     surface.DrawText( "KAYKO~BOT V3.0 by Yung Pain " )
  518. end )
Advertisement
Add Comment
Please, Sign In to add comment