Caliber_

Gmod leak dump part 5: skidscorcher pub

Dec 31st, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 50.98 KB | None | 0 0
  1. /*
  2.     [S]kid[S]corcher <= {PUBLIC} =>
  3.     VERSION: PUBLIC 2.0
  4.    
  5.     Credits:
  6.         kalis0x - most of code
  7.         razor - astrafe + engine pred module + fakelag pred (thx)
  8.         nanocat - walkbot
  9. */
  10.  
  11. require("dickwrap")
  12. require("mega")
  13. require("enginepred")
  14. bSendPacket = true
  15. surface.CreateFont("wireless gamer", {font = "Open Sans MS", size = 45})
  16. surface.CreateFont("visual gamer", {font = "Courier New", size = 15, weight = 500, outline = true})
  17. surface.CreateFont("gamer title", {font = "Trebuchet", size = 18, weight = 650})
  18. surface.CreateFont("gamer tab", {font = "Trebuchet", size = 16, weight = 550})
  19. local me = LocalPlayer()
  20. ok = {}
  21. ok.rang = {}
  22. ok.cvars = {}
  23. ok.flvel = {}
  24. ok.bttab = {}
  25. ok.ys = GetConVarNumber("m_yaw")
  26. ok.aat = nil
  27. ok.aas = false
  28. ok.atk = false
  29. ok.ld = false
  30. ok.gd = false
  31. ok.hm = 0
  32. ok.dc = 0
  33. ok.ct = 0
  34. ok.flt = 0
  35. ok.fltm = 0
  36. ok.er = 0
  37. ok.eg = 0
  38. ok.eb = 0
  39. ok.fa = nil
  40. ok.sp = nil
  41. ok.ep = nil
  42. ok.atl = 0
  43. ok.tc = 0
  44.  
  45. function ok.Log(...)
  46.     MsgC(Color(5, 130, 255), "[SkidScorcher] ", Color(255, 190, 5), ...)
  47.     MsgN("")
  48. end
  49.  
  50. ok.Log("Loading...")
  51.  
  52. function ok.CreateConsoleVar(name, default)
  53.     local ret = CreateClientConVar(name, default)
  54.     ok.cvars[name] = tostring(default)
  55.     ok.Log("Created convar: ", Color(255, 120, 5), name, Color(255, 0, 0), " (default: " .. tostring(default) .. ", value: ", ret:GetString(), ")")
  56.     return ret
  57. end
  58.  
  59. ok.vars = {
  60.     aimbot = {
  61.         enabled = ok.CreateConsoleVar("ok_aimbot", 1),
  62.         point = ok.CreateConsoleVar("ok_aimbot_point", 0.65),
  63.         multipoint = ok.CreateConsoleVar("ok_aimbot_multipoint", 1),
  64.         mpmode = ok.CreateConsoleVar("ok_aimbot_multipoint_mode", 1),
  65.         autowall = ok.CreateConsoleVar("ok_aimbot_autowall", 0),
  66.         silent = ok.CreateConsoleVar("ok_aimbot_silent", 1),
  67.         nospread = ok.CreateConsoleVar("ok_aimbot_nospread", 1),
  68.         bodyaim = ok.CreateConsoleVar("ok_aimbot_body", 0),
  69.         static = ok.CreateConsoleVar("ok_aimbot_staticaa", 1),
  70.         nextshot = ok.CreateConsoleVar("ok_aimbot_nextshot", 1),
  71.         autoshoot = ok.CreateConsoleVar("ok_aimbot_autoshoot", 1),
  72.         team = ok.CreateConsoleVar("ok_aimbot_ignoreteam", 1),
  73.         friends = ok.CreateConsoleVar("ok_aimbot_ignorefriends", 0),
  74.         backtracking = ok.CreateConsoleVar("ok_aimbot_backtracking", 0) // doesnt work lol
  75.     },
  76.  
  77.     visuals = {
  78.         esp = ok.CreateConsoleVar("ok_visuals_esp", 1),
  79.         name = ok.CreateConsoleVar("ok_visuals_esp_name", 1),
  80.         box = ok.CreateConsoleVar("ok_visuals_esp_box", 1),
  81.         weapon = ok.CreateConsoleVar("ok_visuals_esp_weapon", 1),
  82.         rank = ok.CreateConsoleVar("ok_visuals_esp_rank", 1),
  83.         angles = ok.CreateConsoleVar("ok_visuals_esp_angles", 1),
  84.         health = ok.CreateConsoleVar("ok_visuals_esp_health", 1),
  85.         snapline = ok.CreateConsoleVar("ok_visuals_snapline", 1),
  86.         chams = ok.CreateConsoleVar("ok_visuals_chams", 0),
  87.         wepchams = ok.CreateConsoleVar("ok_visuals_wepchams", 1),
  88.         watermark = ok.CreateConsoleVar("ok_visuals_watermark", 1),
  89.         fullbright = ok.CreateConsoleVar("ok_visuals_fullbright", 0),
  90.         asus = ok.CreateConsoleVar("ok_visuals_asuswalls", 1),
  91.         viewmodel = ok.CreateConsoleVar("ok_visuals_viewmodel", 1),
  92.         fov = ok.CreateConsoleVar("ok_visuals_fov", 125)
  93.     },
  94.  
  95.     misc = {
  96.         autohop = ok.CreateConsoleVar("ok_misc_autohop", 1),
  97.         highjump = ok.CreateConsoleVar("ok_misc_highjump", 0),
  98.         thirdperson = ok.CreateConsoleVar("ok_thirdperson", 1),
  99.         killspam = ok.CreateConsoleVar("ok_misc_killspam", 0),
  100.         ksmode = ok.CreateConsoleVar("ok_misc_killspam_mode", 1),
  101.         robo = ok.CreateConsoleVar("ok_misc_killspam_robo", 0),
  102.         autostrafe = ok.CreateConsoleVar("ok_misc_autostrafe", 1),
  103.         autogain = ok.CreateConsoleVar("ok_misc_autostrafe_gain", 1),
  104.         autogainmin = ok.CreateConsoleVar("ok_misc_autostrafe_gain_min", 0.75),
  105.         autogainmax = ok.CreateConsoleVar("ok_misc_autostrafe_gain_max", 4.25),
  106.         autogainmult = ok.CreateConsoleVar("ok_misc_autostrafe_gain_velmult", 0.03),
  107.         autogainkey = ok.CreateConsoleVar("ok_misc_autostrafe_gain_key", "f"),
  108.         walkbot = ok.CreateConsoleVar("ok_misc_walkbot", 0),
  109.         walkbotrec = ok.CreateConsoleVar("ok_misc_walkbot_rec", 0),
  110.         robobitch = ok.CreateConsoleVar("ok_misc_robot", 0)
  111.     },
  112.  
  113.     hvh = {
  114.         antiaim = ok.CreateConsoleVar("ok_hvh_antiaim", 1),
  115.         spinbot = ok.CreateConsoleVar("ok_hvh_aa_spin", 0),
  116.         spinspeed = ok.CreateConsoleVar("ok_hvh_aa_spin_speed", 8),
  117.         edge = ok.CreateConsoleVar("ok_hvh_aa_edge", 1),
  118.         edgemet = ok.CreateConsoleVar("ok_hvh_aa_edge_met", 3),
  119.         adaptive = ok.CreateConsoleVar("ok_hvh_aa_adaptive", 0),
  120.         adapyaw = ok.CreateConsoleVar("ok_hvh_adap_yaw", 540),
  121.         adapmax = ok.CreateConsoleVar("ok_hvh_adap_max", 2),
  122.         adapspeed = ok.CreateConsoleVar("ok_hvh_adap_speed", 1),
  123.         adapyawfa = ok.CreateConsoleVar("ok_hvh_adap_yaw_fa", 547.5),
  124.         adapmove = ok.CreateConsoleVar("ok_Hvh_adap_move", 1),
  125.         pitch = ok.CreateConsoleVar("ok_hvh_aa_pitch", -180),
  126.         pitchfa = ok.CreateConsoleVar("ok_hvh_aa_pitch_fa", 179),
  127.         yawfa = ok.CreateConsoleVar("ok_hvh_aa_yaw_fa", -540),
  128.         pitchrand = ok.CreateConsoleVar("ok_hvh_aa_pitch_addrand", 0),
  129.         pitchrandmin = ok.CreateConsoleVar("ok_hvh_aa_pitch_rand_min", -3),
  130.         pitchrandmax = ok.CreateConsoleVar("ok_hvh_aa_pitch_rand_max", 3),
  131.         yaw = ok.CreateConsoleVar("ok_hvh_aa_yaw", -540),
  132.         roll = ok.CreateConsoleVar("ok_hvh_aa_roll", 0),
  133.         fakelag = ok.CreateConsoleVar("ok_hvh_fakelag", 1),
  134.         flchoke = ok.CreateConsoleVar("ok_hvh_fl_choke", 14),
  135.         flsend = ok.CreateConsoleVar("ok_hvh_fl_send", 1),
  136.         aaa = ok.CreateConsoleVar("ok_hvh_antiaa", 1),
  137.         aaamode = ok.CreateConsoleVar("ok_hvh_antiaa_mode", 1),
  138.         flpred = ok.CreateConsoleVar("ok_hvh_fakelag_pred", 1)
  139.     }
  140. }
  141.  
  142. ok.cones = {}
  143.  
  144. local _R = debug.getregistry()
  145. _R["__ok"] = _R["__ok"] and _R["__ok"] or table.Copy(_R)
  146. function _R.Entity.FireBullets(ent, bul)
  147.     local wep = me:GetActiveWeapon()
  148.     if IsValid(wep) then ok.cones[wep:GetClass()] = (bul.Spread * -1) end
  149.     return _R["__ok"].Entity.FireBullets(ent, bul)
  150. end
  151.  
  152. function ok.Compensate(cmd, ang)
  153.     local wep = me:GetActiveWeapon()
  154.     if !IsValid(wep) then return ang end
  155.     local cone = ok.cones[wep:GetClass()]
  156.     if !cone then return ang end
  157.     return (ok.vars["aimbot"]["nospread"]:GetBool() and dickwrap.Predict(cmd, ang:Forward(), cone):Angle()) or ang
  158. end
  159.  
  160. function ok.GetCorners(min, max)
  161.     return {
  162.         Vector(min.x, min.y, min.z),
  163.         Vector(min.x, max.y, min.z),
  164.         Vector(max.x, max.y, min.z),
  165.         Vector(max.x, min.y, min.z),           
  166.         Vector(min.x, min.y, max.z),
  167.         Vector(min.x, max.y, max.z),
  168.         Vector(max.x, max.y, max.z),
  169.         Vector(max.x, min.y, max.z)
  170.     }
  171. end
  172.  
  173. function ok.CheckVis(ent)
  174.     local bodyaim = ok.vars["aimbot"]["bodyaim"]:GetBool()
  175.     local sp = me:GetShootPos()
  176.     local ep
  177.     local bone, ang, min, max
  178.     local __hitbox, __hitgroup = 0, 0
  179.     if bodyaim then
  180.         __hitbox = 15
  181.         bone, ang = ent:GetBonePosition(ent:GetHitBoxBone(15, 0))
  182.         min, max = ent:GetHitBoxBounds(15, 0)
  183.     else
  184.         bone, ang = ent:GetBonePosition(ent:GetHitBoxBone(0, 0))
  185.         min, max = ent:GetHitBoxBounds(0, 0)
  186.     end
  187.  
  188.     min:Rotate(ang)
  189.     max:Rotate(ang)
  190.     ep = bone + ((min + max) * ok.vars["aimbot"]["point"]:GetFloat())
  191.     local tdata = {
  192.         start = sp,
  193.         endpos = ep,
  194.         filter = {ent, me},
  195.         mask = MASK_SHOT
  196.     }
  197.  
  198.     local trace = util.TraceLine(tdata)
  199.     if trace.Fraction != 1 and ok.vars["aimbot"]["multipoint"]:GetBool() then
  200.         local mode = ok.vars["aimbot"]["mpmode"]:GetInt()
  201.         if mode == 1 then // corners
  202.             local tests = ok.GetCorners(min, max)
  203.             for i = 1, #tests do
  204.                 ep = bone + tests[i]
  205.                 tdata.endpos = ep
  206.                 trace = util.TraceLine(tdata)
  207.                 if trace.Fraction == 1 then
  208.                     ok.ep_hg = __hitbox
  209.                     ok.ep_hb = __hitgroup
  210.                     ok.ep_i = i
  211.                     return true, sp, ep
  212.                 end
  213.             end
  214.         else // hitscan
  215.             local group = 0
  216.             for hitbox = 0, ent:GetHitBoxCount(group) - 1 do
  217.                 bone, ang = ent:GetBonePosition(ent:GetHitBoxBone(hitbox, group))
  218.                 min, max = ent:GetHitBoxBounds(hitbox, group)
  219.                 min:Rotate(ang)
  220.                 max:Rotate(ang)
  221.                 ep = bone + ((min + max) * 0.5)
  222.                 tdata.endpos = ep
  223.                 trace = util.TraceLine(tdata)
  224.                 if trace.Fraction == 1 then
  225.                     ok.ep_hg = hitbox
  226.                     ok.ep_hb = group
  227.                     return true, sp, ep
  228.                 end
  229.             end
  230.         end
  231.     end
  232.  
  233.     return trace.Fraction == 1, sp, ep
  234. end
  235.  
  236. function ok.CanWallbang(sp, ep, ent)
  237.     local tdata = {
  238.         start = sp,
  239.         endpos = ep,
  240.         filter = {ent, me},
  241.         mask = 1577075107
  242.     }
  243.  
  244.     local wall = util.TraceLine(tdata)
  245.     tdata.start = ep
  246.     tdata.endpos = sp
  247.     local wall2 = util.TraceLine(tdata)
  248.     if 17.49 > (wall2.HitPos - wall.HitPos):Length2D() then
  249.         return true
  250.     else
  251.         return false
  252.     end
  253. end
  254.  
  255. function ok.AngleDistance(ang1, ang2)
  256.     local diff1 = math.NormalizeAngle(ang2.p - ang1.p)
  257.     local diff2 = math.NormalizeAngle(ang2.y - ang1.y)
  258.     return math.abs(diff1) + math.abs(diff2)
  259. end
  260.  
  261. function ok.TimeToTicks(time)
  262.     return math.floor(0.5 + time / engine.TickInterval())
  263. end
  264.  
  265. function ok.TicksToTime(ticks)
  266.     return ticks * engine.TickInterval()
  267. end
  268.  
  269. function ok.FakeLagPredict(cmd, ent) // credits 2 razor
  270.     if cmd:CommandNumber() == 0 then return end
  271.     if !ok.vars["hvh"]["flpred"]:GetBool() then return end
  272.     local simtime = engineprediction.GetSimulationTime(ent:EntIndex())
  273.     if 16 > math.abs(ok.TimeToTicks(simtime) - cmd:TickCount()) then
  274.         engineprediction.SetTickCount(cmd, ok.TimeToTicks(simtime))
  275.     end
  276. end
  277.  
  278. function ok.LengthSqrAng(ang)
  279.     return math.pow(ang.p, 2) + math.pow(ang.y, 2) + math.pow(ang.z, 2)
  280. end
  281.  
  282. ok.bteam = 0.1 * 0.1
  283. function ok.Backtrack(ent, cmd)
  284.     if ok.bttab[ent] and false then
  285.         local last = math.huge
  286.         local record
  287.         local simtime
  288.         for k,v in next, ok.bttab[ent] do
  289.             if last > k then
  290.                 last = k
  291.                 simtime = k
  292.                 record = v
  293.             end
  294.         end
  295.  
  296.         if !record or !simtime then return end
  297.         local correct = engineprediction.GetLatency(me:EntIndex())
  298.         local targettick = ok.TimeToTicks(simtime)
  299.         local deltaticks = ok.TimeToTicks(correct - ok.TicksToTime(engineprediction.TickCount() - targettick))
  300.         if math.abs(deltaticks) > (1 / engine.TickInterval() / 4) then
  301.             return
  302.         end
  303.  
  304.         local angles = record["angles"]
  305.         local pos = record["pos"]
  306.         local angdiff = ent:EyeAngles() - angles
  307.         local posdiff = ent:GetPos() - pos
  308.         if ok.LengthSqrAng(angdiff) > ok.bteam then
  309.             ent:SetEyeAngles(record["angles"])
  310.         end
  311.  
  312.         ent:SetCollisionBounds(record["mins"], record["maxs"])
  313.         if posdiff:LengthSqr() > ok.bteam then
  314.             ent:SetPos(record["pos"])
  315.         end
  316.  
  317.         for k,v in next, record["poseparams"] do
  318.             ent:SetPoseParameter(k, v)
  319.         end
  320.  
  321.         ent:InvalidateBoneCache()
  322.         ent:SetupBones()
  323.         engineprediction.SetTickCount(cmd, ok.TimeToTicks(simtime) - engineprediction.GetLatency(me:EntIndex()))
  324.     end
  325. end
  326.  
  327. function ok.GetTarget(cmd)
  328.     local vis
  329.     ok.sp, ok.ep, ok.aat, ok.aimtarg = nil, nil, nil, nil
  330.     if !me:Alive() or 0 >= me:Health() then return end
  331.     for k,v in ipairs(player.GetAll()) do
  332.         if !ok.vars["aimbot"]["enabled"]:GetBool() or !v or !v:IsPlayer() or v:IsDormant() or v == me or 0 >= v:Health() then continue end
  333.         if ok.vars["aimbot"]["team"]:GetBool() and v:Team() == me:Team() then continue end
  334.         if ok.vars["aimbot"]["friends"]:GetBool() and v:GetFriendStatus() == "friend" then continue end
  335.         if ok.vars["aimbot"]["backtracking"]:GetBool() then ok.Backtrack(v, cmd) end
  336.         local sp, ep
  337.         vis, sp, ep = ok.CheckVis(v)
  338.         ok.aat = v
  339.         if vis or (ok.vars["aimbot"]["autowall"]:GetBool() and ok.CanWallbang(sp, ep, v)) then
  340.             ok.sp = sp
  341.             ok.ep = ep
  342.             ok.aimtarg = v
  343.             break
  344.         else
  345.             continue
  346.         end
  347.     end
  348. end
  349.  
  350. function ok.DoSilent(cmd)
  351.     if !ok.fa then ok.fa = cmd:GetViewAngles() end
  352.     ok.fa = ok.fa + Angle(cmd:GetMouseY() * ok.ys, cmd:GetMouseX() * -ok.ys, 0)
  353.     ok.fa.p = math.Clamp(ok.fa.p, -89, 89)
  354.     ok.fa.y = math.NormalizeAngle(ok.fa.y)
  355. end
  356.  
  357. function ok.FixMove(cmd, ang)
  358.     local angs = cmd:GetViewAngles()
  359.     local fa = ok.fa
  360.     if ang then
  361.         fa = ang
  362.     end
  363.  
  364.     local viewang = Angle(0, angs.y, 0)
  365.     local fix = Vector(cmd:GetForwardMove(), cmd:GetSideMove(), 0)
  366.     fix = (fix:Angle() + (viewang - fa)):Forward() * fix:Length()
  367.    
  368.     if angs.p > 90 or angs.p < -90 then
  369.         fix.x = -fix.x
  370.     end
  371.    
  372.     cmd:SetForwardMove(fix.x)
  373.     cmd:SetSideMove(fix.y)
  374. end
  375.  
  376. function ok.GetCurTime()
  377.     if IsFirstTimePredicted() then
  378.         ok.ct = CurTime() + engine.TickInterval()
  379.     end
  380. end
  381.  
  382. function ok.CanFire(nextshot)
  383.     if ok.vars["hvh"]["fakelag"]:GetBool() and ok.flt != (ok.fltm - 1) then return false end
  384.     if !nextshot then return true end
  385.     if !ok.ct or ok.ct == 0 then return false end
  386.     local wep = me:GetActiveWeapon() or NULL
  387.     if !IsValid(wep) then return false end
  388.     return wep:GetActivity() != ACT_RELOAD and ok.ct > wep:GetNextPrimaryFire()
  389. end
  390.  
  391. ok.as_max = 10^4
  392. ok.as_l = 400
  393. function ok.AutoHop(cmd)
  394.     if !ok.vars["misc"]["autohop"]:GetBool() or cmd:CommandNumber() == 0 then return end
  395.     local autostrafe = ok.vars["misc"]["autostrafe"]:GetBool()
  396.     if me:IsOnGround() and cmd:KeyDown(IN_JUMP) then
  397.         cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_JUMP))
  398.         if autostrafe then
  399.             cmd:SetForwardMove(ok.as_max)
  400.         end
  401.     else
  402.         if autostrafe and cmd:KeyDown(IN_JUMP) then
  403.             cmd:SetForwardMove(5850 / me:GetVelocity():Length2D())
  404.             cmd:SetSideMove((cmd:CommandNumber() % 2 == 0) and ok.as_l or -ok.as_l)
  405.         end
  406.  
  407.         cmd:RemoveKey(IN_JUMP)
  408.     end
  409. end
  410.  
  411. ok.ip = true
  412. ok.pst = 0
  413. function ok.Aimbot(cmd)
  414.     local autoshoot = ok.vars["aimbot"]["autoshoot"]:GetBool()
  415.     local nextshot = ok.vars["aimbot"]["nextshot"]:GetBool()
  416.     local silent = ok.vars["aimbot"]["silent"]:GetBool()
  417.     local fakelag = ok.vars["hvh"]["fakelag"]:GetBool()
  418.     local antiaim = ok.vars["hvh"]["antiaim"]:GetBool()
  419.     local static = ok.vars["aimbot"]["static"]:GetBool()
  420.     local backtracking = false//ok.vars["aimbot"]["backtracking"]:GetBool()
  421.     local flpred = ok.vars["hvh"]["flpred"]:GetBool()
  422.     ok.DoSilent(cmd)
  423.     if cmd:CommandNumber() == 0 and !ok.vars["misc"]["thirdperson"]:GetBool() and (silent or antiaim or ok.vars["misc"]["walkbot"]:GetBool()) then cmd:SetViewAngles(ok.fa) return end
  424.     if (backtracking or flpred) and ok.ip then
  425.         ok.ip = false
  426.         engineprediction.SetInterpolation(ok.ip)
  427.     end
  428.  
  429.     if !fakelag then
  430.         bSendPacket = true
  431.     end
  432.  
  433.     if ok.sp and ok.ep and ok.aimtarg then
  434.         if backtracking then
  435.             ok.Backtrack(ok.aimtarg, cmd)
  436.         end
  437.  
  438.         local ap = ok.Compensate(cmd, (ok.ep - me:GetShootPos()):Angle())
  439.         ap.p, ap.y = math.NormalizeAngle(ap.p), math.NormalizeAngle(ap.y)
  440.         local cs = true
  441.         if !fakelag and (ok.pst >= 14) then
  442.             cs = false
  443.         end
  444.  
  445.         if fakelag and bSendPacket then
  446.             cs = false
  447.         end
  448.  
  449.         if ok.CanFire(nextshot) and (autoshoot or cmd:KeyDown(IN_ATTACK)) and cs then
  450.             if static then
  451.                 aafix = true
  452.                 ap.p = -ap.p - 540
  453.                 ap.y = ap.y + 180
  454.             end
  455.            
  456.             cmd:SetViewAngles(ap)
  457.             if autoshoot then
  458.                 if nextshot then
  459.                     cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_ATTACK))
  460.                 else
  461.                     if ok.atk then
  462.                         cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_ATTACK))
  463.                     else
  464.                         cmd:RemoveKey(IN_ATTACK)
  465.                     end
  466.  
  467.                     ok.atk = !ok.atk
  468.                 end
  469.             end
  470.  
  471.             if silent then
  472.                 ok.FixMove(cmd)
  473.             end
  474.  
  475.             if !fakelag then
  476.                 bSendPacket = false
  477.                 ok.pst = ok.pst + 1
  478.             end
  479.         else
  480.             if autoshoot and nextshoot then
  481.                 cmd:RemoveKey(IN_ATTACK)
  482.             end
  483.  
  484.             if antiaim then
  485.                 ok.AntiAim(cmd, true)
  486.             elseif silent then
  487.                 cmd:SetViewAngles(ok.fa)
  488.             end
  489.  
  490.             if !fakelag then
  491.                 ok.pst = 0
  492.                 bSendPacket = true
  493.             end
  494.         end
  495.  
  496.         if !backtracking then
  497.             ok.FakeLagPredict(cmd, ok.aimtarg)
  498.         end
  499.  
  500.         return
  501.     end
  502.  
  503.     if antiaim or silent or ok.vars["misc"]["walkbot"]:GetBool() then
  504.         cmd:SetViewAngles(ok.fa)
  505.     end
  506. end
  507.  
  508. ok.aa_as = false
  509. ok.paa_s = false
  510. ok.aa_a = 0
  511. ok.as_y = 0
  512. ok.sb_c = 0
  513. ok.aa_ry = 0
  514. function ok.AntiAim(cmd, force)
  515.     if cmd:CommandNumber() == 0 and !ok.vars["misc"]["thirdperson"]:GetBool() then return end
  516.     if me:GetActiveWeapon() != NULL and me:GetActiveWeapon():GetClass():lower():find("knife") or 0 >= me:Health() then return end
  517.     if !force and ok.aat == nil and ok.vars["aimbot"]["enabled"]:GetBool() then return end
  518.     if !force and (ok.sp != nil or ok.ep != nil) then return end
  519.     if !force and cmd:KeyDown(IN_ATTACK) then
  520.         if ok.vars["aimbot"]["static"]:GetBool() then
  521.             cmd:SetViewAngles(Angle(-ok.fa.p - 180, ok.fa.y + 180, 0))
  522.             ok.FixMove(cmd)
  523.         end
  524.  
  525.         return
  526.     end
  527.  
  528.     if ok.vars["hvh"]["antiaim"]:GetBool() then
  529.         local pitch = ok.vars["hvh"]["pitch"]:GetFloat() or -180
  530.         local pitchfa = ok.vars["hvh"]["pitchfa"]:GetFloat()
  531.         if ok.vars["hvh"]["pitchrand"]:GetBool() then
  532.             pitch = pitch + math.random(ok.vars["hvh"]["pitchrandmin"]:GetFloat(), ok.vars["hvh"]["pitchrandmax"]:GetFloat())
  533.         end
  534.  
  535.         local yaw = ok.vars["hvh"]["yaw"]:GetFloat() or 450
  536.         local roll = ok.vars["hvh"]["roll"]:GetFloat() or 0
  537.         if ok.vars["hvh"]["adaptive"]:GetBool() then
  538.             local adapmax = ok.vars["hvh"]["adapmax"]:GetInt()
  539.             local adapspeed = ok.vars["hvh"]["adapspeed"]:GetInt()
  540.             if ok.aa_a >= adapmax then
  541.                 ok.aa_a = adapmax
  542.                 ok.aa_as = false
  543.             elseif -adapmax >= ok.aa_a then
  544.                 ok.aa_a = -adapmax
  545.                 ok.aa_as = true
  546.             end
  547.  
  548.             if ok.aa_as then
  549.                 ok.aa_a = ok.aa_a + adapspeed
  550.             else
  551.                 ok.aa_a = ok.aa_a - adapspeed
  552.             end
  553.  
  554.             if !ok.vars["hvh"]["adapmove"]:GetBool() then
  555.                 ok.aa_a = 0
  556.             end
  557.  
  558.             local adapyaw = ok.vars["hvh"]["adapyaw"]:GetFloat()
  559.             local aay = (ok.aat and ok.aat != NULL) and ((ok.aat:GetPos() + ok.aat:OBBCenter()) - me:GetShootPos()):Angle().y or 0
  560.             if !ok.vars["hvh"]["fakelag"]:GetBool() then
  561.                 cmd:SetViewAngles(Angle(pitch, aay + adapyaw + ok.aa_a, roll))
  562.             else
  563.                 if bSendPacket then
  564.                     cmd:SetViewAngles(Angle(pitchfa, aay + ok.vars["hvh"]["adapyawfa"]:GetFloat(), roll))
  565.                 else
  566.                     cmd:SetViewAngles(Angle(pitch, aay + adapyaw + ok.aa_a, roll))
  567.                 end
  568.             end
  569.         elseif ok.vars["hvh"]["spinbot"]:GetBool() then
  570.             local speed = ok.vars["hvh"]["spinspeed"]:GetFloat()
  571.             ok.sb_c = ok.sb_c + speed
  572.             if ok.sb_c >= 180 then
  573.                 ok.sb_c = ok.sb_c - 360
  574.             end
  575.  
  576.             if !ok.vars["hvh"]["fakelag"]:GetBool() then
  577.                 cmd:SetViewAngles(Angle(pitch, ok.sb_c, roll))
  578.             else
  579.                 if bSendPacket then
  580.                     cmd:SetViewAngles(Angle(pitchfa, ok.sb_c + 90, roll))
  581.                 else
  582.                     cmd:SetViewAngles(Angle(pitch, ok.sb_c, roll))
  583.                 end
  584.             end
  585.         else
  586.             if ok.vars["hvh"]["fakelag"]:GetBool() then
  587.                 if bSendPacket then
  588.                     cmd:SetViewAngles(Angle(pitchfa, yaw + ok.vars["hvh"]["yawfa"]:GetFloat(), 0))
  589.                 else
  590.                     cmd:SetViewAngles(Angle(pitch, yaw, 0))
  591.                 end
  592.             else
  593.                 cmd:SetViewAngles(Angle(pitch, yaw, 0))
  594.             end
  595.         end
  596.  
  597.         if ok.vars["hvh"]["edge"]:GetBool() then
  598.             local setp = false
  599.             local edge = false
  600.             local ang = Angle(0, 0, 0)
  601.             local eyepos = me:GetShootPos() - Vector(0, 0, 5)
  602.             for y = 1, 8 do
  603.                 local tmp = Angle(0, y * 45, 0)
  604.                 local forward = tmp:Forward()
  605.                 forward = forward * 35
  606.  
  607.                 local tdata
  608.                 local _filter = {}
  609.                 for k,v in next, player.GetAll() do
  610.                     _filter[k] = v
  611.                 end
  612.  
  613.                 tdata = {start = eyepos, endpos = eyepos + forward, filter = _filter, mask = MASK_SOLID}
  614.                 local trace = util.TraceLine(tdata)
  615.            
  616.                 if trace.Fraction != 1 then
  617.                     local negate = trace.HitNormal * -1
  618.                     tmp.y = negate:Angle().y
  619.                    
  620.                     local left = (tmp + Angle(0, 11.25, 0)):Forward() * 17.5
  621.                     local right = (tmp - Angle(0, 11.25, 0)):Forward() * 17.5
  622.                     tdata = {start = eyepos, endpos = eyepos + left, filter = _filter, mask = MASK_SOLID}
  623.                     local lt = util.TraceLine(tdata)
  624.                     tdata = {start = eyepos, endpos = eyepos + right, filter = _filter, mask = MASK_SOLID}
  625.                     local rt = util.TraceLine(tdata)
  626.                     local ltw = lt.Fraction == 1
  627.                     local rtw = rt.Fraction == 1
  628.  
  629.                     local edgem = ok.vars["hvh"]["edgemet"]:GetInt()
  630.                     if edgem == 1 then
  631.                         if ltw or rtw then
  632.                             tmp.y = tmp.y + 180
  633.                         end
  634.  
  635.                         ang.y = 270 - tmp.y + 360
  636.                         if ok.vars["hvh"]["fakelag"]:GetBool() then
  637.                             if bSendPacket then
  638.                                 ang.p = pitchfa
  639.                                 ang.y = ang.y - 90
  640.                             end
  641.                         end
  642.                     elseif edgem == 2 or edgem == 3 then
  643.                         ang.y = tmp.y + (edgem == 2 and 180 or 360)
  644.                         if ok.vars["hvh"]["fakelag"]:GetBool() then
  645.                             if bSendPacket then
  646.                                 ang.p = pitchfa
  647.                                 ang.y = ang.y + 125
  648.                             end
  649.                         end
  650.                     elseif edgem == 4 then
  651.                         if ltw or rtw then
  652.                             tmp.y = tmp.y + 180
  653.                         end
  654.  
  655.                         ang.y = 270 - tmp.y + math.random(-15, 15) + math.Rand(0.03, 0.08)
  656.                         if ok.vars["hvh"]["fakelag"]:GetBool() then
  657.                             if bSendPacket then
  658.                                 ang.p = pitchfa
  659.                                 ang.y = ang.y - 90
  660.                             end
  661.                         end
  662.                     end
  663.  
  664.                     edge = true
  665.                     break
  666.                 end
  667.             end
  668.  
  669.             if edge then
  670.                 cmd:SetViewAngles(Angle(ang.p != 0 and ang.p or pitch, ang.y, roll))
  671.             end
  672.         end
  673.  
  674.         pitch = cmd:GetViewAngles().p
  675.         ok.aas = !ok.aas
  676.         ok.FixMove(cmd)
  677.     end
  678. end
  679.  
  680. function ok.FakeLag(cmd)
  681.     if cmd:CommandNumber() == 0 then return end
  682.     local choke = ok.vars["hvh"]["flchoke"]:GetInt()
  683.     local send = ok.vars["hvh"]["flsend"]:GetInt()
  684.     ok.fltm = choke + send
  685.  
  686.     if ok.vars["hvh"]["fakelag"]:GetBool() then
  687.         ok.flt = ok.flt + 1
  688.        
  689.         if ok.flt > ok.fltm then
  690.             ok.flt = 1
  691.         end
  692.  
  693.         if send >= ok.flt then
  694.             bSendPacket = true
  695.         else
  696.             bSendPacket = false
  697.         end
  698.     end
  699. end
  700.  
  701. ok.gayaa = {}
  702. ok.aaatab = {}
  703. function ok.CheckAAA(ent, ang)
  704.     local pitch = ang.x
  705.     local yaw = ang.y
  706.     local roll = ang.z
  707.     if ok.vars["hvh"]["aaamode"]:GetInt() == 1 then
  708.         if roll != 0 then
  709.             if roll == 180 or roll == -180 then
  710.                 if 0 > pitch then
  711.                     pitch = -89
  712.                 else
  713.                     pitch = 89
  714.                 end
  715.             end
  716.  
  717.             if roll == 180 or roll == -180 then
  718.                 yaw = yaw + 180
  719.             end
  720.         else
  721.             if pitch >= 90 and 180 > pitch then
  722.                 pitch = 89
  723.             elseif pitch >= 180 and 290 > pitch then
  724.                 pitch = -89
  725.             end
  726.         end
  727.     else
  728.         if roll == 180 or roll == -180 or ((pitch >= 90 or -90 >= pitch) and !(pitch >= 355 or 365 >= pitch)) then
  729.             ok.gayaa[ent] = ok.gayaa[ent] or 0
  730.             ok.gayaa[ent] = ok.gayaa[ent] + 1
  731.             if 16 >= ok.gayaa[ent] then
  732.                 pitch = 89
  733.             elseif ok.gayaa[ent] > 16 and 32 >= ok.gayaa[ent] then
  734.                 pitch = -89
  735.             end
  736.  
  737.             if ok.gayaa[ent] % 16 >= 8 then
  738.                 yaw = yaw + 180
  739.             end
  740.  
  741.             if ok.gayaa[ent] >= 48 then
  742.                 ok.gayaa[ent] = 0
  743.             end
  744.         end
  745.     end
  746.  
  747.     ent:SetPoseParameter("aim_pitch", pitch)
  748.     ent:SetPoseParameter("head_pitch", pitch)
  749.     ent:SetPoseParameter("body_yaw", 0)
  750.     ent:SetPoseParameter("aim_yaw", 0)
  751.     ent:InvalidateBoneCache()
  752.     ent:SetRenderAngles(Angle(0, math.NormalizeAngle(yaw), 0))
  753.     ent:SetupBones()
  754. end
  755.  
  756. function ok.HighJump(cmd)
  757.     if !ok.vars["misc"]["highjump"]:GetBool() then return end
  758.     local pos = me:GetPos()
  759.     local tdata = {start = pos, endpos = pos - Vector(0, 0, 1337), mask = MASK_SOLID}
  760.     local trace = util.TraceLine(tdata)
  761.     local len = (pos - trace.HitPos).z
  762.     if len > 25 and 51.5 > len then
  763.         cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_DUCK))
  764.     else
  765.         cmd:RemoveKey(IN_DUCK)
  766.     end
  767. end
  768.  
  769. function ok.Visuals()
  770.     if ok.vars["visuals"]["watermark"]:GetBool() then
  771.         ok.er = math.sin(CurTime() * 4) * 127 + 128
  772.         ok.eg = math.sin(CurTime() * 4 + 2) * 127 + 128
  773.         ok.eb = math.sin(CurTime() * 4 + 4) * 127 + 128
  774.         draw.SimpleText("SkidScorcher", "wireless gamer", ScrW() / 2, 0, Color(ok.er, ok.eg, ok.eb), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  775.     end
  776.  
  777.     surface.SetFont("visual gamer")
  778.     local width, height = surface.GetTextSize("bSendPacket")
  779.     draw.SimpleText("bSendPacket", "gamer title", 4, 0, bSendPacket and Color(0, 255, 0) or Color(255, 0, 0), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
  780.     for k,v in next, player.GetAll() do
  781.         if !ok.vars["visuals"]["esp"]:GetBool() or !v:IsValid() or !v:Alive() or 0 >= v:Health() then continue end
  782.         if !ok.vars["misc"]["thirdperson"]:GetBool() and v == me then continue end
  783.         local min, max = v:GetCollisionBounds()
  784.         local pos = v:GetPos()
  785.         local top, bottom = (pos + Vector(0, 0, max.z)):ToScreen(), (pos - Vector(0, 0, 8)):ToScreen()
  786.         local middle = bottom.y - top.y
  787.         local width = middle / 2.245
  788.  
  789.         if ok.vars["visuals"]["name"]:GetBool() then
  790.             draw.SimpleText(v:Nick(), "visual gamer", bottom.x, top.y, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM)
  791.         end
  792.  
  793.         if ok.vars["visuals"]["box"]:GetBool() then
  794.             surface.SetDrawColor(me:Team() == v:Team() and Color(0, 100, 255) or Color(200, 225, 0))
  795.             surface.DrawOutlinedRect(bottom.x - width, top.y, width * 2, middle)
  796.             surface.SetDrawColor(Color(0, 0, 0))
  797.             surface.DrawOutlinedRect(bottom.x - width - 1, top.y - 1, width * 2 + 2, middle + 2)
  798.             surface.DrawOutlinedRect(bottom.x - width + 1, top.y + 1, width * 2 - 2, middle - 2)
  799.         end
  800.  
  801.         ok.drawpos = 0
  802.  
  803.         if ok.vars["visuals"]["weapon"]:GetBool() then
  804.             local wep = v:GetActiveWeapon()
  805.             if wep and wep != NULL then
  806.                 draw.SimpleText(wep.GetPrintName and wep:GetPrintName() or wep:GetClass(), "visual gamer", bottom.x, bottom.y + ok.drawpos, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  807.                 ok.drawpos = ok.drawpos + 10
  808.             end
  809.         end
  810.  
  811.         if ok.vars["visuals"]["rank"]:GetBool() then
  812.             draw.SimpleText(v.GetUserGroup and v:GetUserGroup() or "__norank", "visual gamer", bottom.x, bottom.y + ok.drawpos, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  813.             ok.drawpos = ok.drawpos + 10
  814.         end
  815.  
  816.         if ok.vars["visuals"]["angles"]:GetBool() then
  817.             if ok.rang[v] then
  818.                 local ang = ok.rang[v]
  819.                 draw.SimpleText("x: " .. tostring(math.Round(ang.x)) .. " y: " .. tostring(math.Round(ang.y)) .. " z: " .. tostring(math.Round(ang.z)), "visual gamer", bottom.x, bottom.y + ok.drawpos, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  820.                 ok.drawpos = ok.drawpos + 10
  821.             end
  822.         end
  823.  
  824.         if ok.vars["visuals"]["health"]:GetBool() then
  825.             local health = math.Clamp(v:Health(), 0, 100)
  826.             local green = health * 2.55
  827.             local red = 255 - green
  828.             surface.SetDrawColor(Color(0, 0, 0))
  829.             surface.DrawRect(bottom.x + width + 2, top.y - 1, 4, middle + 2)
  830.             surface.SetDrawColor(Color(red, green, 0))
  831.             local height = health * middle / 100
  832.             surface.DrawRect(bottom.x + width + 3, top.y + (middle - height), 2, height)
  833.         end
  834.     end
  835.  
  836.     if ok.vars["visuals"]["snapline"]:GetBool() and ok.ep then
  837.         local pos = ok.ep:ToScreen()
  838.         if pos.visible then
  839.             surface.SetDrawColor(Color(255, 255, 255))
  840.             surface.DrawLine(ScrW() / 2, ScrH(), pos.x, pos.y)
  841.         end
  842.     end
  843. end
  844.  
  845. ok.wepchams = CreateMaterial("wireless_weapon_mat", "VertexLitGeneric", {
  846.     ["$ignorez"] = 1,
  847.     ["$model"] = 1,
  848.     ["$basetexture"] = "models/debug/debugwhite"
  849. })
  850.  
  851. ok.chams1 = CreateMaterial("wireless_gamer_mat", "VertexLitGeneric", {
  852.     ["$ignorez"] = 1,
  853.     ["$model"] = 1,
  854.     ["$basetexture"] = "models/debug/debugwhite"
  855. })
  856.  
  857. ok.chams2 = CreateMaterial("wired_gamer_mat", "VertexLitGeneric", {
  858.     ["$ignorez"] = 0,
  859.     ["$model"] = 1,
  860.     ["$basetexture"] = "models/debug/debugwhite"
  861. })
  862.  
  863. function ok.GetWepChamsColor()
  864.     return 255 / 255, 255 / 255, 255 / 255
  865. end
  866.  
  867. function ok.GetChamsColor(t, v)
  868.     if t then
  869.         if v then
  870.             return 50 / 255, 200 / 255, 25 / 255
  871.         else
  872.             return 0, 100 / 255, 255 / 255
  873.         end
  874.     else
  875.         if v then
  876.             return 200 / 255, 125 / 255, 0
  877.         else
  878.             return 200 / 255, 225 / 255, 0
  879.         end
  880.     end
  881. end
  882.  
  883. function ok.Chams()
  884.     for k,v in next, ents.GetAll() do
  885.         if !ok.vars["visuals"]["wepchams"]:GetBool() or !v:IsValid() or !v:IsWeapon() then continue end
  886.         cam.Start3D()
  887.         render.MaterialOverride(ok.wepchams)
  888.         render.SetColorModulation(ok.GetWepChamsColor(false))
  889.         v:DrawModel()
  890.         cam.End3D()
  891.     end
  892.  
  893.     for k,v in next, player.GetAll() do
  894.         if !ok.vars["visuals"]["chams"]:GetBool() or !v:IsValid() or !v:IsPlayer() or !v:Alive() or 0 >= v:Health() then continue end
  895.         if !ok.vars["misc"]["thirdperson"]:GetBool() and v == me then continue end
  896.         cam.Start3D()
  897.         render.MaterialOverride(ok.chams1)
  898.         render.SetColorModulation(ok.GetChamsColor(me:Team() == v:Team(), false))
  899.         v:DrawModel()
  900.  
  901.         if v == me then
  902.             render.SetColorModulation(ok.GetChamsColor(me:Team() == v:Team(), false))
  903.         else
  904.             render.SetColorModulation(ok.GetChamsColor(me:Team() == v:Team(), true))
  905.         end
  906.  
  907.         render.MaterialOverride(ok.chams2)
  908.         v:DrawModel()
  909.         cam.End3D()
  910.     end
  911. end
  912.  
  913. function ok.CalcView(ent, pos, angle, fov, nearZ, farZ)
  914.     local view = {}
  915.     view.angles = (ok.vars["hvh"]["antiaim"]:GetBool() or ok.vars["aimbot"]["silent"]:GetBool() or ok.vars["misc"]["walkbot"]:GetBool()) and ok.fa or angle
  916.     view.origin = ok.vars["misc"]["thirdperson"]:GetBool() and (pos - ok.fa:Forward() * 100) or pos
  917.     view.fov = ok.vars["visuals"]["fov"]:GetInt()
  918.  
  919.     return view
  920. end
  921.  
  922. function ok.ShouldDrawLocalPlayer()
  923.     return ok.vars["misc"]["thirdperson"]:GetBool()
  924. end
  925.  
  926. function ok.PreDrawOpaqueRenderables()
  927.     for k,v in next, player.GetAll() do
  928.         local ang = v:EyeAngles()
  929.         ok.rang[v] = ang
  930.         if ok.vars["hvh"]["aaa"]:GetBool() and v != me then
  931.             ok.CheckAAA(v, ang)
  932.         end
  933.     end
  934. end
  935.  
  936. function ok.ResetConsoleVars()
  937.     for k,v in next, ok.cvars do
  938.         me:ConCommand(k .. " " .. v)
  939.         ok.Log("Reset convar: ", Color(255, 120, 5), k, Color(255, 0, 0), " (value: ", v, ")")
  940.     end
  941. end
  942.  
  943. function ok.FindPlayerWithID(userid)
  944.     for k,v in next, player.GetAll() do
  945.         if v:UserID() == userid then
  946.             return v
  947.         end
  948.     end
  949.  
  950.     return false
  951. end
  952.  
  953. function ok.PlayerHurt(data)
  954.     if !ok.vars["misc"]["killspam"]:GetBool() or ok.vars["misc"]["ksmode"]:GetInt() == 2 then return end
  955.     local health = data.health
  956.     local id = data.userid
  957.     local attackerid = data.attacker
  958.     local target = Player(id)
  959.     local attacker = Player(attackerid)
  960.     if !target or !attacker then return end
  961.     if attacker != NULL and target != NULL then
  962.         if attacker == me then
  963.             target.hits = target.hits and target.hits + 1 or 1
  964.             target.hitsme = 0
  965.             if health == 0 then
  966.                 if ok.vars["misc"]["robo"]:GetBool() then
  967.                     MEGA.TextToSpeech("easy " .. tostring(target.hits) .. " tap")
  968.                 end
  969.  
  970.                 me:ConCommand("say", "[SS] owned " .. target:Nick() .. " in " .. tostring(target.hits) .. " shot" .. (target.hits > 1 and "s" or ""))
  971.                 target.hits = 0
  972.             end
  973.         elseif target == me then
  974.             attacker.hitsme = attacker.hitsme and attacker.hitsme + 1 or 1
  975.             attacker.hits = 0
  976.             if health == 0 then
  977.                 if attacker.hitsme > 1 then
  978.                     me:ConCommand("say [SS] it took " .. attacker:Nick() .. " " .. tostring(attacker.hitsme) .. " shots to kill me")
  979.                     attacker.hitsme = 0
  980.                 else
  981.                     me:ConCommand("say [SS] i just got owned by " .. attacker:Nick())
  982.                 end
  983.             end
  984.         end
  985.     end
  986. end
  987.  
  988. function ok.EntityKilled(data)
  989.     if !ok.vars["misc"]["killspam"]:GetBool() or ok.vars["misc"]["ksmode"]:GetInt() == 1 then return end
  990.     local target = Entity(data.entindex_killed)
  991.     local attacker = Entity(data.entindex_attacker)
  992.     if !target or !attacker then return end
  993.     if attacker != NULL and target != NULL then
  994.         if attacker == me then
  995.             if ok.vars["misc"]["robo"]:GetBool() then
  996.                 MEGA.TextToSpeech("owned")
  997.             end
  998.  
  999.             local str = "say [SKIDSQUASHDOTCC] owned"
  1000.             if target:IsPlayer() then
  1001.                 str = str .. " " .. target:Nick()
  1002.             end
  1003.  
  1004.             me:ConCommand(str)
  1005.         elseif target == me then
  1006.             local str = "say [SKIDSQUASHDOTCC] i just got owned"
  1007.             if attacker:IsPlayer() then
  1008.                 str = str .. " by " .. attacker:Nick()
  1009.             end
  1010.  
  1011.             me:ConCommand(str)
  1012.         end
  1013.     end
  1014. end
  1015.  
  1016. ok.ga_y = 0
  1017.  
  1018. function ok.AutoGain(cmd)
  1019.     if !ok.vars["misc"]["autogain"]:GetBool() or cmd:CommandNumber() == 0 then return end
  1020.     local min = ok.vars["misc"]["autogainmin"]:GetFloat()
  1021.     local max = ok.vars["misc"]["autogainmax"]:GetFloat()
  1022.     local mult = ok.vars["misc"]["autogainmult"]:GetFloat()
  1023.     ok.ga_y = ok.ga_y + math.Clamp((me:GetVelocity():Length2D() * mult), min, max)
  1024.     math.NormalizeAngle(ok.ga_y)
  1025.  
  1026.     local key = _G["KEY_" .. string.upper(ok.vars["misc"]["autogainkey"]:GetString())] or KEY_F
  1027.     if input.IsKeyDown(key) then
  1028.         cmd:SetForwardMove(10^4)
  1029.         cmd:SetSideMove(0)
  1030.         ok.FixMove(cmd, Angle(ok.fa.p, ok.ga_y, 0))
  1031.     end
  1032. end
  1033.  
  1034. ok.wbh = "\x6Fkwb\n"
  1035. ok.wbm = -1
  1036. ok.wbfs = nil
  1037. ok.wbwp = {}
  1038. ok.wbpd = 1
  1039. ok.wbnw = 1
  1040. ok.wblp = Vector()
  1041. ok.wbly = 0
  1042. ok.wbcm = nil
  1043.  
  1044. function ok.RecordVector(vec)
  1045.     ok.wbfs:WriteFloat(vec.x)
  1046.     ok.wbfs:WriteFloat(vec.y)
  1047.     ok.wbfs:WriteFloat(vec.z)
  1048.     ok.wbfs:Flush()
  1049. end
  1050.  
  1051. function ok.Walkbot(cmd)
  1052.     local walkbot = ok.vars["misc"]["walkbot"]:GetBool()
  1053.     local wbrec = ok.vars["misc"]["walkbotrec"]:GetBool()
  1054.     if !walkbot and !wbrec then
  1055.         if ok.wfs then
  1056.             ok.wfs:Close()
  1057.         end
  1058.  
  1059.         ok.wbcm = nil
  1060.         ok.wbm = -1
  1061.         ok.wbnw = 1
  1062.         ok.wbpd = 1
  1063.         return
  1064.     end
  1065.  
  1066.     if wbrec then
  1067.         if !ok.wbfs then
  1068.             ok.wbfs = file.Open("ok_wb_" .. util.CRC(game.GetMap()) .. ".dat", "wb", "DATA")
  1069.        
  1070.             if ok.wbfs then
  1071.                 ok.wbfs:Write(ok.wbh)
  1072.                 ok.wbfs:Write(util.CRC(game.GetMap()))
  1073.                 ok.wblp = me:GetPos()
  1074.             end
  1075.         end
  1076.  
  1077.         ok.wbcm = nil
  1078.         ok.wbm = 0
  1079.     elseif walkbot then
  1080.         if ok.wfs then
  1081.             ok.wfs:Close()
  1082.         end
  1083.        
  1084.         local fs = file.Open("ok_wb_" .. util.CRC(game.GetMap()) .. ".dat", "rb", "DATA")
  1085.         if fs and !ok.wbcm then
  1086.             ok.wbcm = true
  1087.             local head = fs:Read(#ok.wbh)
  1088.             local mcrc = fs:Read(#util.CRC(game.GetMap()))
  1089.             if head == ok.wbh then
  1090.                 if mcrc == util.CRC(game.GetMap()) then
  1091.                     ok.wbpd = 1
  1092.                     ok.wbnd = 1
  1093.                     ok.wbm = 1
  1094.                                
  1095.                     table.Empty(ok.wbwp)
  1096.                     local x = fs:ReadFloat()
  1097.                     local y = fs:ReadFloat()
  1098.                     local z = fs:ReadFloat()
  1099.                                
  1100.                     while x and y and z do
  1101.                         table.insert(ok.wbwp, Vector(x, y, z))
  1102.                                        
  1103.                         x = fs:ReadFloat()
  1104.                         y = fs:ReadFloat()
  1105.                         z = fs:ReadFloat()
  1106.                     end
  1107.                 else
  1108.                     ok.Log("Bad map crc for walkbot data file! Disabling")
  1109.                     ok.vars["misc"]["walkbot"]:SetBool(false)
  1110.                     ok.wbcm = nil
  1111.                     fs:Close()
  1112.                     return
  1113.                 end
  1114.             else
  1115.                 ok.Log("Bad header for walkbot data file! Disabling")
  1116.                 ok.vars["misc"]["walkbot"]:SetBool(false)
  1117.                 ok.wbcm = nil
  1118.                 fs:Close()
  1119.                 return
  1120.             end
  1121.                
  1122.             fs:Close()
  1123.         elseif !fs then
  1124.             ok.Log("Walkbot failed, no data for this map! Disabling")
  1125.             ok.vars["misc"]["walkbot"]:SetBool(false)
  1126.             ok.wbcm = nil
  1127.             return
  1128.         end
  1129.  
  1130.         ok.wbm = 1
  1131.     end
  1132.  
  1133.     local pos = me:GetPos()
  1134.     if ok.wbfs then
  1135.         if ok.wbm == 0 then
  1136.             if math.abs(math.abs(ok.wbly) - math.abs(ok.fa.y)) > 10 and ok.wblp:Distance(pos) > 52 or ok.wblp:Distance(pos) > 392 then          
  1137.                 ok.wblp = pos
  1138.                 ok.wbly = ok.fa.y
  1139.                                
  1140.                 ok.RecordVector(util.QuickTrace(pos + me:OBBCenter(), pos - Vector(0, 0, 8192), me).HitPos)
  1141.             end
  1142.         end
  1143.     end
  1144.        
  1145.     if ok.wbm == 1 then
  1146.         local vec = ok.wbwp[ok.wbnw] - pos
  1147.         if vec:Length2D() < me:GetVelocity():Length2D() * 0.1 then
  1148.             if ok.wbwp[ok.wbnw + ok.wbpd] then
  1149.                 ok.wbnw = ok.wbnw + ok.wbpd
  1150.             else
  1151.                 if ok.wbpd == 1 then
  1152.                     ok.wbpd = -1
  1153.                 elseif ok.wbpd == -1 then
  1154.                     ok.wbpd = 1
  1155.                 end
  1156.             end
  1157.         end
  1158.        
  1159.         local ang = vec:Angle()
  1160.         cmd:SetForwardMove(10^4)
  1161.         cmd:SetSideMove(0)
  1162.         ok.FixMove(cmd, Angle(ok.fa.p, ang.y, 0))
  1163.     end
  1164. end
  1165.  
  1166. function ok.DrawWalkbotBox(v, c)
  1167.     surface.SetDrawColor(c)
  1168.        
  1169.     local b1 = (v + Vector(5, 5, 0)):ToScreen()
  1170.     local b2 = (v + Vector(5, -5, 0)):ToScreen()
  1171.     local b3 = (v + Vector(-5, 5, 0)):ToScreen()
  1172.     local b4 = (v + Vector(-5, -5, 0)):ToScreen()
  1173.        
  1174.     local t1 = (v + Vector(5, 5, 32)):ToScreen()
  1175.     local t2 = (v + Vector(5, -5, 32)):ToScreen()
  1176.     local t3 = (v + Vector(-5, 5, 32)):ToScreen()
  1177.     local t4 = (v + Vector(-5, -5, 32)):ToScreen()
  1178.  
  1179.     surface.DrawLine(b1.x, b1.y, b3.x, b3.y)
  1180.     surface.DrawLine(b2.x, b2.y, b4.x, b4.y)
  1181.     surface.DrawLine(b1.x, b1.y, b2.x, b2.y)
  1182.     surface.DrawLine(b3.x, b3.y, b4.x, b4.y)
  1183.        
  1184.     surface.DrawLine(b1.x, b1.y, t1.x, t1.y)
  1185.     surface.DrawLine(b2.x, b2.y, t2.x, t2.y)
  1186.     surface.DrawLine(b3.x, b3.y, t3.x, t3.y)
  1187.     surface.DrawLine(b4.x, b4.y, t4.x, t4.y)
  1188.        
  1189.     surface.DrawLine(t1.x, t1.y, t3.x, t3.y)
  1190.     surface.DrawLine(t2.x, t2.y, t4.x, t4.y)
  1191.     surface.DrawLine(t1.x, t1.y, t2.x, t2.y)
  1192.     surface.DrawLine(t3.x, t3.y, t4.x, t4.y)
  1193. end
  1194.  
  1195. function ok.DrawWalkbot()
  1196.     if ok.wbm == 0 and ok.wbfs then
  1197.         draw.SimpleText("WALKBOT RECORDING", "Trebuchet24", ScrW(), 0, Color(255, 255, 255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP)
  1198.     elseif ok.wbm == 1 then
  1199.         local prev
  1200.         for k,v in next, ok.wbwp do
  1201.             local scr = v:ToScreen()
  1202.             if not scr.visible then continue end
  1203.                        
  1204.             if prev and prev.x and prev.y then
  1205.                 surface.SetDrawColor(Color(255, 255, 255))
  1206.                 surface.DrawLine(prev.x, prev.y, scr.x, scr.y)
  1207.              end
  1208.                        
  1209.             ok.DrawWalkbotBox(v, ok.wbnw == k and Color(50, 200, 25) or Color(225, 25, 10))
  1210.             prev = scr
  1211.         end
  1212.     end
  1213. end
  1214.  
  1215. function ok.CreateMove(cmd)
  1216.     if cmd:TickCount() != 0 then ok.tc = cmd:TickCount() end
  1217.     ok.AutoHop(cmd)
  1218.     if cmd:CommandNumber() != 0 then engineprediction.Start(cmd) end
  1219.     ok.GetTarget(cmd)
  1220.     ok.Aimbot(cmd)
  1221.     ok.AntiAim(cmd)
  1222.     ok.FakeLag(cmd)
  1223.     ok.HighJump(cmd)
  1224.     ok.AutoGain(cmd)
  1225.     ok.Walkbot(cmd)
  1226.     if cmd:CommandNumber() != 0 then engineprediction.Finish() end
  1227. end
  1228.  
  1229. function ok.AddHook(htype, name, func)
  1230.     hook.Add(htype, name, func)
  1231.     ok.Log("Created ", Color(255, 120, 5), htype, Color(255, 190, 5), " hook: ", Color(255, 120, 5), name, Color(255, 0, 0), " (" .. tostring(func) .. ")")
  1232. end
  1233.  
  1234. ok.curtab = 0
  1235. ok.menuitems = {}
  1236.  
  1237. function ok.CreateTab(frame, name, index, max)
  1238.     local tab = vgui.Create("DButton", frame)
  1239.     tab:SetText("")
  1240.     tab:SetSize(frame:GetWide() / max - 1, 30)
  1241.     tab:SetPos((index - 1) * (tab:GetWide() + 1), 24)
  1242.     function tab.Paint(self, width, height)
  1243.         surface.SetDrawColor(Color(100, 100, 100))
  1244.         surface.DrawRect(0, 0, width, height)
  1245.         if ok.curtab == index then
  1246.             surface.SetDrawColor(Color(255, 255, 255, 15))
  1247.             surface.DrawRect(0, 0, width, height)
  1248.         end
  1249.  
  1250.         draw.SimpleText(name, "gamer tab", width / 2, height / 2, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  1251.     end
  1252.  
  1253.     function tab.DoClick()
  1254.         ok.curtab = index
  1255.         for i = 1, #ok.menuitems do
  1256.             local items = ok.menuitems[i]
  1257.             for k,v in next, items do
  1258.                 v:SetVisible(i == index)
  1259.             end
  1260.         end
  1261.     end
  1262. end
  1263.  
  1264. function ok.CreateCheckbox(frame, name, tab, index, cvtab, cvname)
  1265.     local cvar = ok.vars[cvtab][cvname]
  1266.     local check = vgui.Create("DButton", frame)
  1267.     check:SetText("")
  1268.     surface.SetFont("gamer tab")
  1269.     local wid = surface.GetTextSize(name)
  1270.     check:SetSize(26 + wid, 18)
  1271.     local x = 10
  1272.     local y = 64 + (22 * (index - 1))
  1273.     if (y + 27) >= frame:GetTall() then
  1274.         local firstindex = 0
  1275.         for i = 1, index do
  1276.             local _y = 64 + (22 * (i - 1))
  1277.             if (_y + 27) >= frame:GetTall() then
  1278.                 firstindex = i
  1279.                 break
  1280.             end
  1281.         end
  1282.  
  1283.         x = (x * 2.5) + 192
  1284.         y = 64 + (22 * (index - (firstindex - 1) - 1))
  1285.     end
  1286.  
  1287.     check:SetPos(x, y)
  1288.     function check.Paint(self, width, height)
  1289.         surface.SetDrawColor(Color(100, 100, 100))
  1290.         surface.DrawOutlinedRect(0, 0, 18, height)
  1291.         if cvar:GetBool() then
  1292.             surface.DrawRect(0, 0, 18, height)
  1293.         end
  1294.  
  1295.         draw.SimpleText(name, "gamer tab", 24, height / 2, Color(255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
  1296.     end
  1297.  
  1298.     function check.DoClick()
  1299.         cvar:SetBool(!cvar:GetBool())
  1300.     end
  1301.  
  1302.     if ok.curtab != tab then
  1303.         check:SetVisible(false)
  1304.     end
  1305.  
  1306.     ok.menuitems[tab][#ok.menuitems[tab] + 1] = check
  1307. end
  1308.  
  1309. function ok.CreateSlider(frame, name, tab, index, cvtab, cvname, min, max, dec)
  1310.     min = min * 10
  1311.     max = max * 10
  1312.     local cvar = ok.vars[cvtab][cvname]
  1313.     local slider = vgui.Create("DButton", frame)
  1314.     slider:SetText("")
  1315.     slider:SetSize(192, 32)
  1316.     local x = 10
  1317.     local y = 64 + (22 * (index - 1))
  1318.     if (y + 27) >= frame:GetTall() then
  1319.         local firstindex = 0
  1320.         for i = 1, index do
  1321.             local _y = 64 + (22 * (i - 1))
  1322.             if (_y + 27) >= frame:GetTall() then
  1323.                 firstindex = i
  1324.                 break
  1325.             end
  1326.         end
  1327.  
  1328.         x = (x * 2.5) + 192
  1329.         y = 64 + (22 * (index - (firstindex - 1) - 1))
  1330.     end
  1331.  
  1332.     slider:SetPos(x, y)
  1333.     function slider.Paint(self, width, height)
  1334.         draw.SimpleText(name .. " [" .. math.Round(cvar:GetFloat(), dec) .. "]", "gamer tab", width / 2, height / 2 - (height / 4), Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  1335.         surface.SetDrawColor(Color(100, 100, 100))
  1336.         surface.DrawRect(0, height / 1.25, width, 1)
  1337.         surface.DrawRect(math.Clamp(((cvar:GetFloat() * 10) - min) / (max - min) * width - 2, 0, width - 4), height / 1.25 - 4, 4, 8)
  1338.         if input.IsMouseDown(MOUSE_LEFT) then
  1339.             local fx, fy = frame:GetPos()
  1340.             local sx, sy = slider:GetPos()
  1341.             local rx = fx + sx
  1342.             local ry = fy + sy
  1343.             local ssx, ssy = slider:GetSize()
  1344.             local mx = gui.MouseX()
  1345.             local my = gui.MouseY()
  1346.             local rmx = mx - rx
  1347.             if ((mx >= rx) and ((rx + ssx) >= mx)) and ((my >= ry) and ((ry + ssy) >= my)) then
  1348.                 cvar:SetFloat(math.Round(rmx / width * ((max / 10) - (min / 10)) + (min / 10), dec))
  1349.             end
  1350.         end
  1351.     end
  1352.  
  1353.     function slider.DoClick() end
  1354.  
  1355.     if ok.curtab != tab then
  1356.         slider:SetVisible(false)
  1357.     end
  1358.  
  1359.     ok.menuitems[tab][#ok.menuitems[tab] + 1] = slider
  1360. end
  1361.  
  1362. function ok.Menu()
  1363.     ok.menuitems = {{}, {}, {}, {}}
  1364.     local frame = vgui.Create("DFrame")
  1365.     frame:SetTitle("")
  1366.     frame:SetSize(600, 450)
  1367.     frame:SetPos(0, 0)
  1368.     frame:ShowCloseButton(false)
  1369.     frame:SetDraggable(false)
  1370.     frame:Center()
  1371.     frame:MakePopup()
  1372.     function frame.Paint(self, width, height)
  1373.         surface.SetDrawColor(Color(75, 75, 75))
  1374.         surface.DrawRect(0, 0, width, height)
  1375.         draw.SimpleText("SkidScorcher", "gamer title", width / 2, 12, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  1376.     end
  1377.  
  1378.     local close = vgui.Create("DButton", frame)
  1379.     close:SetText("")
  1380.     close:SetSize(24, 24)
  1381.     close:SetPos(frame:GetWide() - 24, 0)
  1382.     function close.Paint(self, width, height)
  1383.         surface.SetDrawColor(Color(255, 0, 0))
  1384.         surface.DrawRect(0, 0, width, height)
  1385.     end
  1386.  
  1387.     function close.DoClick()
  1388.         frame:Remove()
  1389.     end
  1390.  
  1391.     //// TABS \\\\
  1392.     ok.CreateTab(frame, "Aimbot", 1, 4)
  1393.     ok.CreateTab(frame, "Visuals", 2, 4)
  1394.     ok.CreateTab(frame, "Misc", 3, 4)
  1395.     ok.CreateTab(frame, "HvH", 4, 4)
  1396.  
  1397.     //// AIMBOT TAB \\\\
  1398.     ok.CreateCheckbox(frame, "Enabled", 1, 1, "aimbot", "enabled")
  1399.     ok.CreateSlider(frame, "Hitbox Point", 1, 2, "aimbot", "point", 0.01, 1, 2)
  1400.     ok.CreateCheckbox(frame, "Multi Point", 1, 4, "aimbot", "multipoint")
  1401.     ok.CreateSlider(frame, "Multi Point Mode", 1, 5, "aimbot", "mpmode", 1, 2, 0)
  1402.     ok.CreateCheckbox(frame, "AutoWall", 1, 7, "aimbot", "autowall")
  1403.     ok.CreateCheckbox(frame, "Silent", 1, 8, "aimbot", "silent")
  1404.     ok.CreateCheckbox(frame, "NoSpread", 1, 9, "aimbot", "nospread")
  1405.     ok.CreateCheckbox(frame, "BodyAim", 1, 10, "aimbot", "bodyaim")
  1406.     ok.CreateCheckbox(frame, "Static AA", 1, 11, "aimbot", "static")
  1407.     ok.CreateCheckbox(frame, "NextShot", 1, 12, "aimbot", "nextshot")
  1408.     ok.CreateCheckbox(frame, "AutoShoot", 1, 13, "aimbot", "autoshoot")
  1409.     ok.CreateCheckbox(frame, "Ignore Team", 1, 14, "aimbot", "team")
  1410.     ok.CreateCheckbox(frame, "Ignore Friends", 1, 15, "aimbot", "friends")
  1411.  
  1412.     //// VISUALS TAB \\\\
  1413.     ok.CreateCheckbox(frame, "ESP Enabled", 2, 1, "visuals", "esp")
  1414.     ok.CreateCheckbox(frame, "Name ESP", 2, 2, "visuals", "name")
  1415.     ok.CreateCheckbox(frame, "Box ESP", 2, 3, "visuals", "box")
  1416.     ok.CreateCheckbox(frame, "Weapon ESP", 2, 4, "visuals", "weapon")
  1417.     ok.CreateCheckbox(frame, "Rank ESP", 2, 5, "visuals", "rank")
  1418.     ok.CreateCheckbox(frame, "Angle ESP", 2, 6, "visuals", "angles")
  1419.     ok.CreateCheckbox(frame, "Healthbar", 2, 7, "visuals", "health")
  1420.     ok.CreateCheckbox(frame, "Snapline", 2, 8, "visuals", "snapline")
  1421.     ok.CreateCheckbox(frame, "Player Chams", 2, 9, "visuals", "chams")
  1422.     ok.CreateCheckbox(frame, "Weapon Chams", 2, 10, "visuals", "wepchams")
  1423.     ok.CreateCheckbox(frame, "Watermark", 2, 11, "visuals", "watermark")
  1424.     ok.CreateCheckbox(frame, "Fullbright", 2, 12, "visuals", "fullbright")
  1425.     ok.CreateCheckbox(frame, "ASUS Walls", 2, 13, "visuals", "asus")
  1426.     ok.CreateSlider(frame, "Viewmodel", 2, 14, "visuals", "viewmodel", 0, 2, 0)
  1427.     ok.CreateSlider(frame, "FOV", 2, 16, "visuals", "fov", 65, 125, 0)
  1428.  
  1429.     //// MISC TAB \\\\
  1430.     ok.CreateCheckbox(frame, "AutoHop", 3, 1, "misc", "autohop")
  1431.     ok.CreateCheckbox(frame, "HighJump", 3, 2, "misc", "highjump")
  1432.     ok.CreateCheckbox(frame, "Third Person", 3, 3, "misc", "thirdperson")
  1433.     ok.CreateCheckbox(frame, "KillSpam", 3, 4, "misc", "killspam")
  1434.     ok.CreateSlider(frame, "KillSpam Mode", 3, 5, "misc", "ksmode", 1, 2, 0)
  1435.     ok.CreateCheckbox(frame, "KillSpam TTS", 3, 7, "misc", "robo")
  1436.     ok.CreateCheckbox(frame, "AutoStrafe", 3, 8, "misc", "autostrafe")
  1437.     ok.CreateCheckbox(frame, "AutoGain", 3, 9, "misc", "autogain")
  1438.     ok.CreateSlider(frame, "AutoGain Min", 3, 10, "misc", "autogainmin", 0.75, 1.25, 2)
  1439.     ok.CreateSlider(frame, "AutoGain Max", 3, 12, "misc", "autogainmax", 4.25, 5.75, 2)
  1440.     ok.CreateSlider(frame, "AutoGain Multiplier", 3, 14, "misc", "autogainmult", 0.01, 0.035, 3)
  1441.     ok.CreateCheckbox(frame, "Walkbot", 3, 16, "misc", "walkbot")
  1442.     ok.CreateCheckbox(frame, "Record Path", 3, 17, "misc", "walkbotrec")
  1443.     ok.CreateCheckbox(frame, "Robot", 3, 18, "misc", "robobitch")
  1444.  
  1445.     //// HVH TAB \\\\
  1446.     ok.CreateCheckbox(frame, "AntiAim", 4, 1, "hvh", "antiaim")
  1447.     ok.CreateCheckbox(frame, "Spinbot", 4, 2, "hvh", "spinbot")
  1448.     ok.CreateSlider(frame, "Spinbot Speed", 4, 3, "hvh", "spinspeed", 1, 45, 0)
  1449.     ok.CreateCheckbox(frame, "Edge AntiAim", 4, 5, "hvh", "edge")
  1450.     ok.CreateSlider(frame, "Edge Method", 4, 6, "hvh", "edgemet", 1, 4, 0)
  1451.     ok.CreateCheckbox(frame, "Adaptive AntiAim", 4, 8, "hvh", "adaptive")
  1452.     ok.CreateSlider(frame, "Adaptive Yaw", 4, 9, "hvh", "adapyaw", 270, 540, 0)
  1453.     ok.CreateSlider(frame, "Adaptive Max", 4, 11, "hvh", "adapmax", 2, 30, 0)
  1454.     ok.CreateSlider(frame, "Adaptive Speed", 4, 13, "hvh", "adapspeed", 1, 15, 0)
  1455.     ok.CreateSlider(frame, "AntiAim Pitch", 4, 15, "hvh", "pitch", -250, 250, 0)
  1456.     ok.CreateSlider(frame, "AntiAim Yaw", 4, 17, "hvh", "yaw", 270, 541, 0)
  1457.     ok.CreateSlider(frame, "AntiAim Roll", 4, 18, "hvh", "roll", -720, -360, 0)
  1458.     ok.CreateCheckbox(frame, "Add Rand Pitch", 4, 20, "hvh", "pitchrand")
  1459.     ok.CreateSlider(frame, "Rand Min", 4, 21, "hvh", "pitchrandmin", -15, 15, 0)
  1460.     ok.CreateSlider(frame, "Rand Max", 4, 23, "hvh", "pitchrandmax", 0, 45, 0)
  1461.     ok.CreateCheckbox(frame, "FakeLag", 4, 25, "hvh", "fakelag")
  1462.     ok.CreateSlider(frame, "FakeLag Choke", 4, 26, "hvh", "flchoke", 2, 14, 0)
  1463.     ok.CreateSlider(frame, "FakeLag Send", 4, 28, "hvh", "flsend", 1, 14, 0)
  1464.     ok.CreateCheckbox(frame, "Anti-AntiAim", 4, 30, "hvh", "aaa")
  1465. end
  1466.  
  1467. ok.lmc = false
  1468. function ok.PreRender()
  1469.     if !ok.vars["visuals"]["fullbright"]:GetBool() then return end
  1470.     render.SetLightingMode(1)
  1471.     ok.lmc = true
  1472. end
  1473.  
  1474. function ok.PostRender()
  1475.     if !ok.vars["visuals"]["fullbright"]:GetBool() then return end
  1476.     if ok.lmc then
  1477.         render.SetLightingMode(0)
  1478.         ok.lmc = false
  1479.     end
  1480. end
  1481.  
  1482. function ok.PreDrawViewModel(vm, ent, wep)
  1483.     if !vm or !ent then return end
  1484.     local viewmodel = ok.vars["visuals"]["viewmodel"]:GetInt()
  1485.     if 0 >= viewmodel then return end
  1486.     render.MaterialOverride((viewmodel == 1) and Material("models/wireframe") or Material("models/debug/debugwhite"))
  1487.     render.SetColorModulation(1, 1, 1)
  1488. end
  1489.  
  1490. function ok.PostDrawViewModel(vm, ent, wep)
  1491.     if !vm or !ent then return end
  1492.     local viewmodel = ok.vars["visuals"]["viewmodel"]:GetInt()
  1493.     if 0 >= viewmodel then return end
  1494.     render.MaterialOverride()
  1495.     wep:SetMaterial("")
  1496.     wep:DrawModel()
  1497. end
  1498.  
  1499. function ok.RenderScene()
  1500.     for k,v in next, game.GetWorld():GetMaterials() do
  1501.         local mat = Material(v)
  1502.         if ok.vars["visuals"]["asus"]:GetBool() then
  1503.             mat:SetFloat("$alpha", 0.75)
  1504.         else
  1505.             mat:SetFloat("$alpha", 1)
  1506.         end
  1507.     end
  1508. end
  1509.  
  1510. function ok.PostDraw2DSkyBox(ent, pos)
  1511.     if ok.vars["visuals"]["asus"]:GetBool() then
  1512.         render.Clear(0, 0, 0, 0, true, true)
  1513.     end
  1514. end
  1515.  
  1516. function ok.Robot()
  1517.     if ok.vars["misc"]["robobitch"]:GetBool() then
  1518.         me:ConCommand("act robot")
  1519.     end
  1520. end
  1521.  
  1522. FRAME_UNDEFINED = -1
  1523. FRAME_START = 0
  1524. FRAME_NET_UPDATE_START = 1
  1525. FRAME_NET_UPDATE_POSTDATAUPDATE_START = 2
  1526. FRAME_NET_UPDATE_POSTDATAUPDATE_END = 3
  1527. FRAME_NET_UPDATE_END = 4
  1528. FRAME_RENDER_START = 5
  1529. FRAME_RENDER_END = 6
  1530. function ok.BacktrackRecord(stage)
  1531.     if stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START then
  1532.         for k,ent in next, player.GetAll() do
  1533.             if ent == me then continue end
  1534.             if !ent:Alive() or 0 >= ent:Health() then continue end
  1535.             if !ok.bttab[ent] then
  1536.                 ok.bttab[ent] = {}
  1537.             else
  1538.                 for i,v in next, ok.bttab[ent] do
  1539.                     local correct = engineprediction.GetLatency(me:EntIndex())
  1540.                     local targettick = ok.TimeToTicks(i)
  1541.                     local deltaticks = ok.TimeToTicks(correct - ok.TicksToTime(engineprediction.TickCount() - targettick))
  1542.                     if math.abs(deltaticks) > (1 / engine.TickInterval() / 4) then
  1543.                         ok.bttab[ent][i] = nil
  1544.                     end
  1545.                 end
  1546.             end
  1547.  
  1548.             local simtime = engineprediction.GetSimulationTime(ent:EntIndex())
  1549.             if ok.bttab[ent][simtime] then
  1550.                 continue
  1551.             end
  1552.  
  1553.             ok.bttab[ent][simtime] = {
  1554.                 poseparams = {
  1555.                     ["aim_pitch"] = ent:GetPoseParameter("aim_pitch"),
  1556.                     ["head_pitch"] = ent:GetPoseParameter("head_pitch"),
  1557.                     ["body_yaw"] = ent:GetPoseParameter("body_yaw"),
  1558.                     ["aim_yaw"] = ent:GetPoseParameter("aim_yaw")
  1559.                 },
  1560.  
  1561.                 angles = ent:EyeAngles(),
  1562.                 pos = ent:GetPos(),
  1563.                 mins = ent:OBBMins(),
  1564.                 maxs = ent:OBBMaxs()
  1565.             }
  1566.         end
  1567.     end
  1568. end
  1569.  
  1570. ok.AddHook("Move", "ok.GetCurTime", ok.GetCurTime)
  1571. ok.AddHook("DrawOverlay", "ok.Visuals", ok.Visuals)
  1572. ok.AddHook("RenderScreenspaceEffects", "ok.Chams", ok.Chams)
  1573. ok.AddHook("CreateMove", "ok.CreateMove", ok.CreateMove)
  1574. ok.AddHook("CalcView", "ok.CalcView", ok.CalcView)
  1575. ok.AddHook("ShouldDrawLocalPlayer", "ok.ShouldDrawLocalPlayer", ok.ShouldDrawLocalPlayer)
  1576. ok.AddHook("PreDrawOpaqueRenderables", "ok.PreDrawOpaqueRenderables", ok.PreDrawOpaqueRenderables)
  1577. ok.AddHook("PreRender", "ok.PreRender", ok.PreRender)
  1578. ok.AddHook("PostRender", "ok.PostRender", ok.PostRender)
  1579. ok.AddHook("PreDrawHUD", "ok.PostRender", ok.PostRender) // gmod becomes satanic without this
  1580. ok.AddHook("PreDrawViewModel", "ok.PreDrawViewModel", ok.PreDrawViewModel)
  1581. ok.AddHook("PostDrawViewModel", "ok.PostDrawViewModel", ok.PostDrawViewModel)
  1582. ok.AddHook("RenderScene", "ok.RenderScene", ok.RenderScene)
  1583. ok.AddHook("PostDraw2DSkyBox", "ok.PostDraw2DSkyBox", ok.PostDraw2DSkyBox)
  1584. ok.AddHook("DrawOverlay", "ok.DrawWalkbot", ok.DrawWalkbot)
  1585. ok.AddHook("PostFrameStageNotify", "ok.BacktrackRecord", ok.BacktrackRecord)
  1586. timer.Create("ok.Robot", 0.15, 0, ok.Robot)
  1587. gameevent.Listen("player_hurt")
  1588. ok.AddHook("player_hurt", "ok.PlayerHurt", ok.PlayerHurt)
  1589. gameevent.Listen("entity_killed")
  1590. ok.AddHook("entity_killed", "ok.EntityKilled", ok.EntityKilled)
  1591. concommand.Add("ok_menu", ok.Menu)
  1592. ok.Log("Created concommand: ", Color(255, 120, 5), "ok_menu", Color(255, 0, 0), " (" .. tostring(ok.Menu) .. ")")
  1593. concommand.Add("ok_resetcv", ok.ResetConsoleVars)
  1594. ok.Log("Created concommand: ", Color(255, 120, 5), "ok_resetcv", Color(255, 0, 0), " (" .. tostring(ok.ResetConsoleVars) .. ")")
  1595. concommand.Add("+ok_aimbot", function() ok.vars["aimbot"]["enabled"]:SetBool(true) end)
  1596. concommand.Add("-ok_aimbot", function() ok.vars["aimbot"]["enabled"]:SetBool(false) end)
  1597. ok.Log("Loaded!")
Add Comment
Please, Sign In to add comment