Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[local info = debug.getinfo(debug.getinfo)
- if info.short_src:find("client/vehicle.lua") then
- print"disconnected because cac"
- RunConsoleCommand"disconnect"
- end]]
- --print(hooktype)
- local hooktype = hooktype or 1
- if _G.ch and _G.ch.Unload then _G.ch:Unload() end
- local ttt = GAMEMODE.Name:lower():find"terror"
- local murder = GAMEMODE.Name:lower():find"murder"
- local morbus = GAMEMODE.Name == "MORBUS"
- local color_red = Color(255,0,0)
- local color_green = Color(0,255,0)
- local me = LocalPlayer()
- local getinfo
- local getupvalue
- local safehookadd
- local safeconcmdAdd
- --local concommandAdd
- --local concommandRemove
- -- dont ask for it, you're not getting it
- if proxi then
- getupvalue = proxi.getupvalue
- getinfo = proxi.getinfo
- else
- getupvalue = debug.getupvalue
- getinfo = debug.getinfo
- end
- --[[
- concommandAdd = function(name,callback)
- local commandsList = select(2,proxi.getupvalue(concommand.AutoComplete,2))
- commandsList[name] = callback
- end
- concommandRemove = function(name)
- local commandsList = select(2,proxi.getupvalue(concommand.AutoComplete,2))
- commandsList[name] = nil
- end]]
- local cac = getinfo(debug.getinfo).short_src:find"client/vehicle.lua"
- if cac then CAC = getupvalue(debug.getinfo,1) end
- local hookinfo = getinfo(hook.Add)
- local concmdinfo = getinfo(concommand.Add)
- if hookinfo.short_src:find("client/vehicle.lua") then
- safehookadd = select(2,getupvalue(hook.Add,2)) -- work on bypass
- safeconcmdAdd = concommand.Add
- elseif concmdinfo.short_src:find"client/!cl_adminmod" then -- compactGamers thing
- safehookadd = select(2,getupvalue(hook.Add,3))
- safeconcmdAdd = select(2,getupvalue(concommand.Add,3))
- else
- safeconcmdAdd = concommand.Add
- safehookadd = hook.Add
- end
- --[[
- plugins ?:
- - modularity
- - URL to code to update/run?
- - local copy in data?
- todo:
- first time help:
- - popup menu so people learn functionality of cheat
- - button on main tab to open help menu again
- free aim:
- - currently doesnt do SHIT
- - calcview hook to allow "free aim"
- - createmove hook to set player aim
- ]]
- local default = {
- aimbot = {
- onkey = false,
- enabled = false,
- dist = 1000,
- drawfov = false,
- fov = 45,
- freeaim = false,
- key = KEY_N,
- los = false,
- smooth = false,
- smoothstep = 1,
- --stick = false,
- type = 1
- },
- bhop = false,
- lazyguns = false,
- cams = {
- enabled = false,
- freecam = false,
- freespeed = 5
- },
- crosshair = {
- type = 1,
- enabled = false,
- color = color_white,
- size = 3,
- },
- esp = {
- armor = false,
- box = false,
- boxcol = Color(255,0,0),
- boxcoltype = 1,
- boxtype = 1,
- chams = false,
- color = Color(255,0,255),
- chamtype = 1,
- customcolor = false,
- dist = 4500,
- drpmon = false,
- friends = false,
- friendcol = Color(0,255,0),
- enabled = false,
- fade = false,
- halo = false,
- halocol = Color(255,0,255,255),
- halocoltype = 1,
- health = false,
- morbus = false,
- murroles = false,
- name = false,
- radar = {
- enabled = false,
- bgcol = Color(0,255,0),
- maxdist = 500,
- padding = 10,
- size = 300,
- type = 2,
- cardinals = true,
- },
- rank = false,
- showdist = false,
- sname = false,
- trace = false,
- traitors = false,
- weapon = false
- },
- entesp = {
- box = false,
- boxcol = Color(0,255,0),
- boxcoltype = 1,
- boxtype = 1,
- dist = 4500,
- enabled = false,
- fade = false,
- info = false,
- halo = false,
- halocol = Color(0,255,0,255),
- halocoltype= 1,
- },
- ents = {},
- friends = {},
- fullbright = false,
- keypad = false,
- net = {
- ["fpp_touchabilitydata"] = true,
- ["acrashscreen_ping"] = true,
- ["updatebuffs"] = true,
- ["chatbubbles"] = true,
- ["simfphys_*"] = true,
- ["darkrp_*"] = true,
- ["urpc"] = true,
- ["afk"] = true,
- },
- npcesp = {
- box = false,
- boxcol = Color(255,0,0),
- boxcoltype = 1,
- boxtype = 1,
- chams = false,
- color = Color(0,255,0),
- chamtype = 1,
- dist = 4500,
- enabled = false,
- fade = false,
- halo = false,
- halocol = Color(0,255,0,255),
- halocoltype= 1,
- health = false,
- name = false,
- showdist = false,
- weapon = false,
- },
- panic = false,
- player_die = false,
- spectators = false,
- triggerbot = false,
- }
- local ch = _G.ch or {} _G.ch = ch
- ch.derma = ch.derma or {}
- ch.restores = ch.restores or {}
- ch.exploits = ch.exploits or {}
- ch.hooks = ch.hooks or {}
- ch.knownents = {}
- ch.vars = default
- ch.tips = {
- "Share with your friends ❤",
- "Made with love, 2017-2018 ❤",
- "This cheat was made with 256MB of VRAM!",
- "Certain entities have extra information on them!",
- "You can go up and down in freecam with SPACE and ALT!",
- "Close all menus with SHIFT+ESCAPE!",
- "Close the most recent popup with ESCAPE!",
- "You can make presets to save your settings!",
- "Setting friends blacklists them from the aimbot!",
- "You can right click on certain buttons to open an editor!",
- "Keypads are part of the ent esp too! ;D",
- }
- local function unload()
- for k, v in next, ch.restores do
- ch:Restore(k)
- end
- if IsValid(ch.derma.frame) then
- for k, v in next, ch.derma.frame.submenus do
- local pan = v
- if pan:IsValid() then
- pan:Close()
- end
- ch.derma.frame.submenus[k] = nil
- end
- ch.derma.frame:Close()
- ch.derma.frame:Remove()
- ch.derma.prop:Remove()
- end
- for k, v in next, ch.hooks do
- ch:RemoveHook(k)
- end
- concommand.Remove("hn_menu")
- concommand.Remove("+hn_menu")
- concommand.Remove("-hn_menu")
- concommand.Remove("hn_panic")
- concommand.Remove("hn_toggle")
- concommand.Remove("hn_exploit")
- ch:Msg"successfully unloaded"
- _G.ch = nil
- end
- local function reload()
- for k, v in next, ch.hooks do
- for k2, v2 in next, v do
- safehookadd(k,k2,v2)
- end
- end
- ch.vars.ents = {}
- ch.vars.friends = {}
- ch.vars = default
- end
- local function showmenu()
- ch.derma.frame:SetVisible(true)
- ch.derma.frame:MakePopup()
- ch.derma.frame:SetTitle("honocheat - " .. table.Random(ch.tips))
- end
- -- cheat functions
- do
- function ch:AddExploit(id, name, info, func)
- if not id or not name or not func then return end
- self.exploits[id:lower()] = {
- name = name,
- info = info,
- func = func
- }
- self.derma:AddButton(self.derma.exploits,name,info,func)
- end
- function ch:Exploit(name)
- self.exploits[name].func()
- end
- function ch:AddHook(hookn, name, func, hookt)
- if not hookn or not name or not func then return end
- hookt = hookt or hooktype or 1
- if hookt == 1 then -- hook.Add
- self.hooks[hookn] = self.hooks[hookn] or {}
- if self.hooks[hookn][name] then
- safehookadd(hookn, self.hooks[hookn][name].id,func)
- return
- end
- local ran = ""
- for i=3, math.random(4, 16) do
- ran = ran..string.char(math.random(32,126))
- end
- self.hooks[hookn][name] = {
- id = ran,
- func = func,
- type = 1
- }
- safehookadd(hookn, ran, func)
- elseif hookt == 2 then -- """"random"""" hooks
- local n,ofunc
- if hook.GetTable()[hookn] then
- n,ofunc = next(hook.GetTable()[hookn])
- end
- if not n and not ofunc then
- --print(hookn,name,func)
- self:AddHook(hookn,name,func,1)
- else
- self.hooks[hookn][name] = {
- id = n,
- func = ofunc,
- type = 2
- }
- hooks[hookn][n] = function(...)
- func(unpack(...))
- ofunc(unpack(...))
- end
- end
- elseif hookt == 3 then -- gamemode func
- local ofunc = GAMEMODE[hookn]
- self:Msg(hookn,ofunc)
- self.hooks[hookn][name] = {
- func = ofunc,
- type = 3
- }
- GAMEMODE[hookn] = function(...)
- func(unpack({...},2))
- ofunc(unpack({...}))
- end
- end
- end
- function ch:RemoveHook(hookn, name)
- if not name then
- for k,v in next, self.hooks[hookn] do
- if v.type == 1 then
- hook.Remove(hookn,v.id)
- elseif v.type == 2 then -- random hook
- hook.GetTable()[hookn][v.id] = v.func
- elseif v.type == 3 then -- gamemode
- GAMEMODE[hookn] = v.func
- end
- self:Msg("removed hook "..(hookn.."."..k))
- end
- return
- end
- local tab = self.hooks[hookn][name]
- if v.type == 1 then
- hook.Remove(hookn, tab.id)
- elseif v.type == 2 then -- random hook
- hook.GetTable()[hookn][tab.id] = tab.func
- elseif v.type == 3 then -- gamemode
- GAMEMODE[hookn] = tab.func
- end
- self:Msg("removed hook "..(hookn.."."..name))
- end
- function ch:AddRestore(name, data, func)
- if not name or not data or not func then return end
- self.restores[name] = {
- func = func,
- data = data
- }
- end
- function ch:Restore(name)
- if not name then return end
- local t = self.restores[name]
- t.func(t.data)
- self:Msg("restored "..name)
- end
- function ch:AddESPEnt(find, usepatterns, func)
- if not find or not usepatterns then return end
- if isfunction(usepatterns) and not func then
- func = usepatterns
- usepatterns = false
- end
- ch.knownents[find] = {
- find = func,
- usepatterns = usepatterns
- }
- end
- function ch:ESPEnt(ent)
- if not ent or not isentity(ent) then return end
- local class = ent:GetClass()
- local tab = {}
- for k, v in next, self.knownents do
- if v.usepatterns and class:find(k) then
- tab = v.find(ent)
- elseif not v.usepatterns and class == k then
- tab = v.find(ent)
- end
- end
- tab = tab or {}
- tab.name = tab.name or ent:GetClass()
- tab.extra = tab.extra or "ent not known to esp"
- tab.color = tab.color or color_white
- return tab
- end
- function ch:AddConCommand(name, cb, ac)
- safeconcmdAdd(name,cb,ac)
- end
- end
- -- misc bypasses
- do
- -- deagleLogs
- if util.NetworkStringToID("deaglelogs_sendcommanddata") ~= 0 then
- ch:AddRestore("deagleLogs", {
- cmdRun = concommand.Run
- },
- function(data)
- concommand.Run = data.cmdRun
- end)
- concommand.Run = select(2,getupvalue(concommand.Run,5))
- end
- -- qac
- -- fuck you qac, you're annoying; i can't restore you
- if util.NetworkStringToID("quack") ~= 0 and getinfo(concommand.Add).short_src:find"!!_cl_qac.lua" then
- local qac = select(2,getupvalue(concommand.Add,1))
- --[[ch:AddRestore("qac",{
- scan_func = qac.scan_func,
- validate_src = qac.validate_src
- },function(data)
- qac.scan_func = data.scan_func
- qac.validate_src = data.validate_src
- end)]]
- function qac.scan_func() end
- function qac.validate_src() end
- for k, v in next, qac.scanf do
- local tab = v[1]
- local name = v[2]
- tab[name] = select(2,getupvalue(tab[name],2))
- end
- end
- -- vac anticheat
- --
- if util.NetworkStringToID("vac.clsv") ~= 0 then
- local vac = select(2,getupvalue(hook.Add,1))
- local g = select(2,getupvalue(hook.Add,2))
- ch:AddRestore("vac",{
- bad = vac.bad
- },
- function(data)
- vac.bad = data.bad
- end)
- -- sends to server cheat info
- vac.bad = function() end
- safehookadd = g.hook.Add
- safeconcmdAdd = g.concommand.Add
- end
- -- DBugR
- if DBugR then
- ch:AddRestore("DBugR",{
- netStart = net.Start
- }, function(data)
- net.Start = netStart
- end)
- local safehookadd = select(2,debug.getupvalue(hook.Add,1))
- local safeconcmdAdd = select(2,debug.getupvalue(concommand.Add,1))
- net.Start = select(2,debug.getupvalue(net.Start,2))
- end
- end
- local cwitems = {
- weapons = Color(255,95,0),
- ammunition = Color(95,196,95),
- medical = Color(0,255,0),
- consumables = Color(95, 255, 95),
- reusables = Color(95, 0, 255),
- identification = Color(95, 0, 255),
- other = Color(128,128,128),
- junk = Color(128,128,128),
- miscellaneous = Color(128,128,128),
- }
- local function isprinter(v)
- if not v:IsEntity() then return end
- for k,v in next, v:GetTable() do
- if k:lower():find("") then
- if isfunction(v) then
- return true, v
- elseif isnumber(v) then
- return true, v
- end
- end
- end
- return false
- end
- -- esp ents
- do
- ch:AddESPEnt("coin",function(v)
- return {extra="$"..v:GetRealValue()}
- end)
- ch:AddESPEnt("cw_(.+)", true, function(v)
- local etype = v:GetClass():gsub("cw_(.-)","")
- local tab = {}
- tab.name = etype
- if etype == "item" and Clockwork.entity:HasFetchedItemData(v) then
- tab.extra = ((v.cwItemTable and v.cwItemTable("name")).. " - " ..(v.cwItemTable and v.cwItemTable("itemID")) or v:GetModel())
- tab.color = cwitems[v.cwItemTable("category"):lower():gsub("uu - ","")] or Color(255,255,255)
- elseif etype == "cash" then
- tab.extra = "$"..v:GetDTInt(0)
- elseif etype == "salesman" then
- tab.extra = v:GetNWString("name","salesman")
- elseif etype == "shipment" then
- tab.extra = v.GetItemTable and v:GetItemTable()("name") or "unknown"
- tab.color = cwitems[v.GetItemTable and v:GetItemTable()("category"):lower():gsub("uu - ","")] or Color(255,255,255)
- elseif etype == "radio" then
- tab.extra = v:GetNWString("frequency", "???")
- tab.color = v:IsOff() and color_red or color_green
- end
- return tab
- end)
- ch:AddESPEnt("bb_(.+)", true, function(v)
- local etype = v:GetClass():gsub("bb_(.-)","")
- local tab = {}
- tab.name = etype
- if etype == "item" then
- local index = v:GetSharedVar"sh_Index"
- if index == 0 then return end
- local itemtable = blackbox.item.Get(index)
- if not itemtable then return end
- tab.extra = itemtable.name
- tab.color = cwitems[itemtable.category:lower()] or Color(255,255,255)
- elseif etype == "cash" then
- tab.extra = "$"..v:GetSharedVar"sh_Amount"
- elseif etype == "salesman" then
- tab.extra = "asshole"
- elseif etype == "shipment" then
- local index = v:GetSharedVar"sh_Index"
- if index == 0 then return end
- local itemtable = blackbox.item.Get(index)
- if not itemtable then return end
- tab.extra = itemtable.name
- tab.color = cwitems[itemtable.category:lower()] or Color(255,255,255)
- end
- return tab
- end)
- ch:AddESPEnt("nut_(.+)", true, function(v)
- local etype = v:GetClass():gsub("nut_(.-)","")
- local tab = {}
- if etype == "item" then
- tab.name = "item"
- tab.extra = (v.getItemTable and v:getItemTable().name).. " - " ..v:getNetVar("id",v:GetModel())
- elseif etype == "money" then
- tab.name = "money"
- tab.extra = "$"..v:getAmount()
- elseif etype == "vendor" then
- tab.extra = v:getNetVar("name","")
- end
- return tab
- end)
- ch:AddESPEnt("spawned_(.+)", true, function(v)
- local class = v:GetClass()
- local tab = {}
- if class == "spawned_weapon" then
- local type = v:GetWeaponClass() or v:GetModel()
- local amount = v.dt.amount
- tab.extra = amount.." "..type..(amount > 1 and "s" or "")
- elseif class == "spawned_shipment" then
- local type = CustomShipments[v:Getcontents()].name
- local amount = v:Getcount()
- tab.extra = amount.." "..type..(amount > 1 and "s" or "")
- elseif class == "spawned_money" then
- tab.name = "money"
- tab.extra = DarkRP.formatMoney(v:Getamount())
- end
- return tab
- end)
- ch:AddESPEnt("Keypad", function(v)
- return {
- extra = v.code and "code: "..v.code or "no code",
- color = v.code and color_green or color_white
- }
- end)
- ch.knownents.Keypad_Wire = ch.knownents.Keypad
- ch:AddESPEnt("ttt_(.+)", true, function(v)
- local class = v:GetClass()
- local tab = {}
- if class == "ttt_c4" then
- tab.name = "c4"
- tab.extra = util.SimpleTime(v:GetExplodeTime() - CurTime(), "%02i:%02i:%02i")
- elseif class == "ttt_health_station" then
- tab.name = "health station"
- tab.extra = (v:GetStoredHealth() or 0).. " heals"
- end
- return tab
- end)
- ch:AddESPEnt("prop_ragdoll", function(v)
- if ttt and CORPSE.GetPlayerNick(v,false) ~= false then
- local nick = (CORPSE.GetPlayer(v) and CORPSE.GetPlayer(v):IsValid()) and CORPSE.GetPlayer(v):Nick() or CORPSE.GetPlayerNick(v,"unknown")
- local found = CORPSE.GetFound(v,false)
- return {
- name = (found and "" or "un").. "identified corpse",
- extra = nick.. "'s body"
- }
- end
- end)
- ch:AddESPEnt("ration", function(v)
- if not v.StoredMoney then return end
- local val = v.StoredMoney
- return {
- name = "printer",
- extra = DarkRP.formatMoney(val),
- color = val > 1000 and color_green or color_white
- }
- end)
- ch:AddESPEnt("metaprinter", function(v)
- local val = v:GetStoredMoney()
- drawinfo.name = "printer"
- drawinfo.extra = DarkRP.formatMoney(val)
- drawinfo.color = val > 1000 and color_green or color_white
- end)
- ch.knownents.gamma_printer = ch.knownents.metaprinter
- ch:AddESPEnt("circl_printer", true, function(v)
- return {
- name = "printer",
- extra = DarkRP.formatMoney(v.Money),
- color = v.Money > 1000 and color_green or color_white
- }
- end)
- ch:AddESPEnt("bit_miner", true, function(v)
- return {
- name = "bit miner",
- extra = v:GetMinedCoins().. " bitcoins"
- }
- end)
- ch:AddESPEnt("money_clicker", function(v)
- local val = v:GetMoney()
- return {
- name = v:GetClickerName(),
- extra = DarkRP.formatMoney(val),
- color = val > 1000 and color_green or color_white
- }
- end)
- ch:AddESPEnt("tierp_printer", function(v)
- local val = v:GetMoney()
- drawinfo.name = v.GetTier and "printer t".. v:GetTier() or "printer"
- drawinfo.extra = DarkRP.formatMoney(val).. " - " ..math.ceil(math.max(v:GetPrintFinishTime()-CurTime(),0)).."s"
- drawinfo.color = val > 1000 and color_green or color_white
- end)
- ch.knownents["sapphire_printer[_p]?"] = ch.knownents.tierp_printer
- ch.knownents["sapphire_printer[_p]?"].usepatterns = true
- ch:AddESPEnt("^g_(.+)_printer", true, function(v)
- local val = v:Getstoredmoney()
- return {
- name = "printer",
- extra = DarkRP.formatMoney(val),
- color = val > 1000 and color_green or color_white
- }
- end)
- ch.knownents.mini_printer = ch.knownents["^g_(.+)_printer"]
- ch.knownents.mini_printer.usepatterns = false
- ch.knownents.standard_printer = ch.knownents.mini_printer
- ch:AddESPEnt("boost_printer", true, function(v)
- local val = v.PrintedMoney
- return {
- name = "printer",
- extra = DarkRP.formatMoney(val),
- color = val > 1000 and color_green or color_white
- }
- end)
- ch:AddESPEnt("commercial_printer", function(v)
- return {
- name = "printer",
- extra = DarkRP.formatMoney(v:Getprintamount()).. " - " ..string.format("%.0f",v:Gettimein()/v:Gettimereq()*100).. "%"
- }
- end)
- ch.knownents.portable_printer = ch.knownents.commercial_printer
- ch:AddESPEnt("bm2_bitminer_(.+)", true, function(v)
- local val = math.floor(v.GetBitcoinAmount and v:GetBitcoinAmount() * BM2CONFIG.BitcoinValue or -1)
- return {
- name = "bit miner",
- extra = DarkRP.formatMoney(val),
- color = val > 1000 and color_green or color_white
- }
- end)
- ch:AddESPEnt("vrondakis_printer", function(v)
- local val = v:GetNWInt("MoneyAmount", -1)
- return {
- name = v:GetNWString("PrinterName","printer"),
- extra = DarkRP.formatMoney(val),
- color = val > 1000 and color_green or color_white
- }
- end)
- ch:AddESPEnt("lp2_printer", true, function(v)
- local val = v.data.storageCur or -1
- return {
- name = "printer",
- extra = DarkRP.formatMoney(val),
- color = val > 1000 and color_green or color_white
- }
- end)
- ch:AddESPEnt("gstandard_printer",function(v)
- local val = v:Getstoredmoney()
- return {
- name = v.data.name,
- extra = DarkRP.formatMoney(val),
- color = val > 1000 and color_green or color_white
- }
- end)
- ch.knownents.gvip_printer = ch.knownents.gstandard_printer
- ch.knownents["gvip+_printer"] = ch.knownents.gstandard_printer
- ch.knownents.gdiamond_printer = ch.knownents.gstandard_printer
- ch.knownents.gextended_printer = ch.knownents.gstandard_printer
- ch:AddESPEnt("printr", function(v)
- local charge = v:GetPower()
- return {
- name = v.DisplayName.. " printer",
- extra = charge.. "% - " ..DarkRP.formatMoney(v.MoneyCount)
- }
- end)
- ch.knownents["printr(.+)"] = ch.knownents.printr
- ch.knownents["printr(.+)"].usepatterns = true
- end
- ch.Unload = unload
- ch.Reload = reload
- ch.ShowMenu = showmenu
- function ch:Msg(...)
- local msg = {...}
- if not msg then return end
- MsgC(Color(32,196,256), "[HNC] ", color_white, unpack(msg), "\n")
- end
- function ch:DoPanic(...)
- self.vars.panic = true
- self.derma.frame:Close()
- self:Msg(...)
- end
- -- menu
- do
- if not file.Exists("hnc", "DATA") then
- ch:Msg"creating directory hnc/ in data"
- file.CreateDir("hnc/cheat")
- file.CreateDir("hnc/friends")
- file.CreateDir("hnc/ents")
- file.CreateDir("hnc/net")
- end
- function ch.derma:AddGroup(parent,txt, icon)
- local grp = vgui.Create( "DCollapsibleCategory" )
- grp:Dock(TOP)
- grp:DockMargin(0,0,0,0)
- grp:SetExpanded(false)
- grp:SetLabel(txt)
- grp.Header:SetIcon(icon)
- grp.list = vgui.Create( "DPanelList", grp )
- grp.list:SetSpacing(0)
- grp.list:SetPadding(0)
- grp.list:EnableHorizontal(false)
- grp.list:EnableVerticalScrollbar(true)
- grp:SetContents(grp.list)
- parent:AddItem(grp)
- return grp.list
- end
- function ch.derma:AddOption(parent, txt, var, tooltip, cb)
- local opt = vgui.Create("DMenuOptionCVar")
- opt.OnCursorEntered = function() return end
- opt:SetText(tostring(txt))
- opt:SetToolTip(tooltip)
- opt:SizeToContents()
- opt.DoRightClick = ((cb and isfunction(cb)) and function(but) cb(but) end or function() end)
- if istable(var) then
- opt.OnChecked = function(but, b)
- ch.vars[var[1]][var[2]] = b
- end
- opt.Think = function(but)
- but:SetChecked(ch.vars[var[1]][var[2]])
- end
- else
- opt.OnChecked = function(but, b)
- ch.vars[var] = b
- end
- opt.Think = function(but)
- but:SetChecked(ch.vars[var])
- end
- end
- parent:AddItem(opt)
- return opt
- end
- function ch.derma:AddSpacer(parent)
- local pnl = vgui.Create( "DPanel", parent )
- pnl.Paint = function() return true end
- pnl:SetTall(12)
- parent:AddItem(pnl)
- return pnl
- end
- function ch.derma:AddSlider(parent, txt, tooltip, var, decplace, def, min, max)
- local sld = vgui.Create("DNumSlider")
- sld:SetText(tostring(txt))
- sld:SetToolTip(tooltip)
- sld:SetMin(tonumber(min))
- sld:SetMax(tonumber(max))
- sld:SetDecimals(tonumber(decplace))
- sld:SetValue(def)
- sld:SetTall(32)
- sld:SetDark(true)
- sld:SizeToContents()
- if istable(var) then
- sld.OnValueChanged = function(sli, val)
- ch.vars[var[1]][var[2]] = val
- end
- sld.Think = function(sli)
- sli:SetValue(ch.vars[var[1]][var[2]])
- end
- else
- sld.OnValueChanged = function(sli, val)
- ch.vars[var] = val
- end
- sld.Think = function(sli)
- sli:SetValue(ch.vars[var])
- end
- end
- parent:AddItem(sld)
- return sld
- end
- function ch.derma:AddButton(parent, txt, tooltip, cb)
- local opt = vgui.Create("DMenuOption")
- opt.OnCursorEntered = function() return end
- opt.DoClick = ((cb and isfunction(cb)) and function(but) cb(but) end or function() end)
- opt.m_Image = vgui.Create("DImage", opt)
- opt.m_Image:SetImage("icon16/bullet_black.png")
- opt.m_Image:SizeToContents()
- opt:SetText(tostring(txt))
- opt:SetToolTip(tooltip)
- opt:SizeToContents()
- if parent.AddItem then
- parent:AddItem(opt)
- else
- opt:SetParent(parent)
- opt:Dock(TOP)
- end
- return opt
- end
- function ch.derma:AddCombo(parent, txt, tooltip, var, options)
- local pan = vgui.Create("DPanel", parent)
- pan:SetToolTip(tooltip)
- local label = vgui.Create("DLabel", pan)
- label:SetDark(true)
- label:SetText(txt)
- label:Dock(LEFT)
- label:SizeToContents()
- label:SetContentAlignment(5) -- no enum :(
- local cmb = vgui.Create("DComboBox", pan)
- cmb:Dock(FILL)
- for k, v in next, options do
- cmb:AddChoice(v)
- end
- if istable(var) then
- cmb.OnSelect = function(cmbo, i, b)
- ch.vars[var[1]][var[2]] = i
- end
- cmb:ChooseOptionID(ch.vars[var[1]][var[2]])
- else
- cmb.OnSelect = function(cmbo, i, b)
- ch.vars[var] = i
- end
- cmb:ChooseOptionID(ch.vars[var])
- end
- parent:AddItem(pan)
- return cmb
- end
- local f = vgui.Create("DFrame")
- ch.derma.frame = f
- f:SetSize(600,400)
- f:SetTitle("honocheat - " .. table.Random(ch.tips))
- f:Center()
- f:SetMinWidth(600)
- f:SetMinHeight(400)
- f:SetSizable(true)
- f:SetDeleteOnClose(false)
- f:SetScreenLock(true)
- f:MakePopup()
- f.submenus = {}
- local press = false
- local ot = f.Think
- f.Think = function(self)
- ot(self)
- if math.Round(math.Round(RealTime(),2) % 5,2) == 0 then
- self:SetTitle("honocheat - " .. table.Random(ch.tips))
- end
- if press then
- if input.IsKeyDown(KEY_ESCAPE) then return end
- press = false
- return
- end
- if input.IsKeyDown(KEY_ESCAPE) then
- gui.HideGameUI()
- press = true
- if input.IsKeyDown(KEY_LSHIFT) or input.IsKeyDown(KEY_RSHIFT) then
- for k, v in next, self.submenus do
- local pan = v
- if pan:IsValid() then
- pan:Close()
- end
- self.submenus[k] = nil
- end
- self:Close()
- else
- local pan = self.submenus[#self.submenus]
- if pan and pan:IsValid() and pan:IsVisible() then
- if pan:IsValid() then
- pan:Close()
- end
- self.submenus[#self.submenus] = nil
- else
- self:Close()
- end
- end
- end
- end
- local p = vgui.Create("DPropertySheet", f)
- ch.derma.prop = p
- p:Dock(FILL)
- local main = vgui.Create("DPanel", p)
- main:Dock(FILL)
- local mainl = vgui.Create("DCategoryList", main)
- mainl:Dock(FILL)
- mainl:DockPadding(0,0,0,0)
- local first = ch.derma:AddGroup(mainl, "main", "icon16/wrench.png")
- first:GetParent():SetExpanded(true)
- ch.derma:AddOption(first, "panic", "panic", "PANIC!! DISABLE EVERYTHING!!")
- ch.derma:AddSpacer(first)
- ch.derma:AddSpacer(first)
- ch.derma:AddButton(first, "reload honocheat", "completely unload the cheat", reload)
- ch.derma:AddButton(first, "unload honocheat", "completely unload the cheat", unload)
- ch.derma:AddButton(first, "delete save files", "delete ALL presets you have made", function()
- Derma_Query("Are you sure you want to delete ALL your configuration files? This cannot be undone.","Are you sure?","delete them",function()
- local cheat = file.Find("hnc/cheat/*", "DATA")
- local ent = file.Find("hnc/ents/*", "DATA")
- local friends = file.Find("hnc/friends/*", "DATA")
- for k, v in next, cheat do
- file.Delete("hnc/cheat/"..v)
- end
- for k, v in next, ent do
- file.Delete("hnc/ents/"..v)
- end
- for k, v in next, friends do
- file.Delete("hnc/friends/"..v)
- end
- end, "no wait")
- end)
- local aimbot = vgui.Create("DPanel", p)
- aimbot:Dock(FILL)
- local aimbotl = vgui.Create("DCategoryList", aimbot)
- aimbotl:Dock(FILL)
- aimbotl:DockPadding(0,0,0,0)
- local aim = ch.derma:AddGroup(aimbotl, "aimbot", "icon16/user.png")
- ch.derma:AddOption(aim, "aimbot", {"aimbot","enabled"}, "who needs manual aiming lol")
- ch.derma:AddSpacer(aim)
- ch.derma:AddOption(aim, "aim on key", {"aimbot","onkey"}, "does the aimbot aim when you're pressing a key?")
- ch.derma:AddButton(aim, "aimbot key", "set which key you'll press to activate aimbot", function()
- local fr = vgui.Create("DFrame")
- fr:SetTitle("aimbot key binding")
- fr:SetSize(150,75)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local kb = vgui.Create("DBinder", fr)
- kb:Dock(TOP)
- kb:SetValue(ch.vars.aimbot.key)
- kb.OnChange = function(_,key)
- ch.vars.aimbot.key = key
- end
- end)
- ch.derma:AddSpacer(aim)
- ch.derma:AddOption(aim, "stick to target", {"aimbot","stick"}, "dont switch targets until they're dead")
- ch.derma:AddOption(aim, "smooth aim", {"aimbot","smooth"}, "should the aimbot smooth your aim?\n(no snap, it's smooth)")
- ch.derma:AddOption(aim, "line of sight", {"aimbot","los"}, "do a line of sight check before aiming")
- ch.derma:AddOption(aim, "free aim", {"aimbot","freeaim"}, "move your camera while aimbot is working")
- ch.derma:AddOption(aim, "draw fov", {"aimbot","drawfov"}, "show your set fov value")
- ch.derma:AddCombo(aim, "aimbot type", "what type of aimbot you want", {"aimbot","type"}, {"distance", "fov"})
- ch.derma:AddSlider(aim, "aimbot smoothing", "the amount the aimbot smooths your aim for you", {"aimbot","smoothstep"}, 2, .5, 0, 1)
- ch.derma:AddSlider(aim, "aimbot distance", "how far players must be before they're targeted for aimbot", {"aimbot","dist"}, 0, 400, 0, 8000)
- ch.derma:AddSlider(aim, "aimbot fov", "how close players must be to your crosshair before targeting", {"aimbot","fov"}, 0, 90, 1, ScrW()/2)
- local esp = vgui.Create("DPanel", p)
- esp:Dock(FILL)
- local espl = vgui.Create("DCategoryList", esp)
- espl:Dock(FILL)
- espl:DockPadding(0,0,0,0)
- local players = ch.derma:AddGroup(espl, "Player ESP", "icon16/group.png")
- ch.derma:AddOption(players, "esp", {"esp","enabled"}, "enable esp overall")
- ch.derma:AddSpacer(players)
- ch.derma:AddOption(players, "chams", {"esp","chams"}, "see player models through walls as a single color\nright click to edit", function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize chams")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.esp.color)
- cm.ValueChanged = function(self, col)
- ch.vars.esp.color = col
- end
- local co = vgui.Create("DComboBox", fr)
- co:Dock(BOTTOM)
- co:AddChoice("solid", 1)
- co:AddChoice("rainbow", 2)
- co:AddChoice("team", 3)
- co:ChooseOptionID(ch.vars.esp.chamtype)
- co.OnSelect = function(self,val,d)
- ch.vars.esp.chamtype = val
- end
- end)
- ch.derma:AddOption(players, "trace", {"esp","trace"}, "see where players are looking")
- ch.derma:AddOption(players, "halo outline", {"esp","halo"}, "glow around players\nright click to edit", function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize halo")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.esp.halocol)
- cm.ValueChanged = function(self, col)
- ch.vars.esp.halocol = col
- end
- local bco = vgui.Create("DComboBox", fr)
- bco:Dock(BOTTOM)
- bco:AddChoice("solid", 1)
- bco:AddChoice("rainbow", 2)
- bco:AddChoice("team", 3)
- bco:ChooseOptionID(ch.vars.esp.halocoltype)
- bco.OnSelect = function(self,val,d)
- ch.vars.esp.halocoltype = val
- end
- end)
- ch.derma:AddOption(players, "distance fade", {"esp","fade"}, "fade text the further they are from you")
- ch.derma:AddOption(players, "bounding box", {"esp","box"}, "see dimensions of players\nright click to edit", function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize bounding box")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.esp.boxcol)
- cm.ValueChanged = function(self, col)
- ch.vars.esp.boxcol = col
- end
- local bco = vgui.Create("DComboBox", fr)
- bco:Dock(BOTTOM)
- bco:AddChoice("solid", 1)
- bco:AddChoice("rainbow", 2)
- bco:AddChoice("team", 3)
- bco:ChooseOptionID(ch.vars.esp.boxcoltype)
- bco.OnSelect = function(self,val,d)
- ch.vars.esp.boxcoltype = val
- end
- local co = vgui.Create("DComboBox", fr)
- co:Dock(BOTTOM)
- co:AddChoice("2d", 1)
- co:AddChoice("3d", 2)
- co:ChooseOptionID(ch.vars.esp.boxtype)
- co.OnSelect = function(self,val,d)
- ch.vars.esp.boxtype = val
- end
- end)
- ch.derma:AddSpacer(players)
- if ttt then ch.derma:AddOption(players, "TTT - find traitors", {"esp","traitors"}, "mark any idiot who buys t weapons as ts") end
- if morbus then ch.derma:AddOption(players, "MORBUS - find aliens", {"esp","morbus"}, "mark any alien as an alien") end
- if murder then ch.derma:AddOption(players, "Murder - find roles", {"esp","murroles"}, "mark all those idiots as their roles") end
- ch.derma:AddOption(players, "name", {"esp","name"}, "show name of players")
- ch.derma:AddOption(players, "mark friends", {"esp","friends"}, "see dimensions of players\nright click to edit", function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize color")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.esp.friendcol)
- cm.ValueChanged = function(self, col)
- ch.vars.esp.friendcol = col
- end
- end)
- ch.derma:AddOption(players, "steam name", {"esp","sname"}, "show steam name of players")
- ch.derma:AddOption(players, "rank", {"esp","rank"}, "show the user group of players")
- ch.derma:AddOption(players, "weapon", {"esp","weapon"}, "show current weapon of players")
- ch.derma:AddOption(players, "health", {"esp","health"}, "show current health of players")
- ch.derma:AddOption(players, "armor", {"esp","armor"}, "show current armor of players")
- if DarkRP then ch.derma:AddOption(players, "money", {"esp","drpmon"}, "show how much money a person has") end
- if Clockwork or blackbox then ch.derma:AddOption(players, "talk distance", {"esp","cwtalk"}, "show talk distance from players in clockwork") end
- ch.derma:AddOption(players, "distance", {"esp","showdist"}, "show distance from you")
- ch.derma:AddSpacer(players)
- ch.derma:AddSlider(players, "esp distance", "how far players must be before they're culled out", {"esp","dist"}, 1, 4500, 0, 16000)
- local ent = ch.derma:AddGroup(espl, "Entity ESP", "icon16/brick.png")
- ch.derma:AddOption(ent, "ent esp", {"entesp","enabled"}, "enable entity esp")
- ch.derma:AddSpacer(ent)
- ch.derma:AddButton(ent, "add entities", "add entities that you want to find to the whitelist", function()
- local fr = vgui.Create("DFrame")
- fr:SetTitle("double click to swap")
- fr:SetSize(500,300)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local olist = vgui.Create( "DListView", fr )
- olist:SetPos(0,20)
- olist:SetSize(250,280)
- olist:SetMultiSelect( false )
- olist:AddColumn( "Off ESP" )
- local elist = vgui.Create( "DListView", fr )
- elist:SetPos(250,20)
- elist:SetSize(250,280)
- elist:SetMultiSelect( false )
- elist:AddColumn( "On ESP" )
- local function refresh()
- local dupes = {} -- duplicate entries
- elist:Clear()
- olist:Clear()
- for k, v in next, ents.GetAll() do
- if ch.vars.ents[v:GetClass()] or v:IsPlayer() or dupes[v:GetClass()] then continue end
- dupes[v:GetClass()] = true
- olist:AddLine(v:GetClass())
- end
- for k, v in next, ch.vars.ents do
- elist:AddLine(k)
- end
- end
- refresh()
- olist.DoDoubleClick = function(self, id, line )
- ch.vars.ents[line:GetColumnText(1)] = true
- refresh()
- end
- elist.DoDoubleClick = function(self, id, line )
- ch.vars.ents[line:GetColumnText(1)] = nil
- refresh()
- end
- end)
- if ttt then
- local known = {
- ttt_c4 = true,
- ttt_health_station = true,
- }
- ch.derma:AddButton(ent, "TTT- find ents", "find any known ttt related entity and mark it\nif you have suggestions, tell us", function()
- for k, v in next, known do
- ch.vars.ents[k] = true
- end
- end)
- ch.derma:AddButton(ent, "TTT- find ragdolls", "mark ragdolls", function()
- ch.vars.ents.prop_ragdoll = true
- end)
- end
- ch.derma:AddSpacer(ent)
- ch.derma:AddOption(ent, "halo outline", {"entesp","halo"}, "glow around entities\nright click to edit",function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize halo")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.entesp.halocol)
- cm.ValueChanged = function(self, col)
- ch.vars.entesp.halocol = col
- end
- local bco = vgui.Create("DComboBox", fr)
- bco:Dock(BOTTOM)
- bco:AddChoice("solid", 1)
- bco:AddChoice("rainbow", 2)
- bco:ChooseOptionID(ch.vars.entesp.halocoltype)
- bco.OnSelect = function(self,val,d)
- ch.vars.entesp.halocoltype = val
- end
- end)
- ch.derma:AddOption(ent, "distance fade", {"entesp","fade"}, "fade text the further ents are from you")
- ch.derma:AddOption(ent, "bounding box", {"entesp","box"}, "see dimensions of entities\nright click to edit", function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize bounding box")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.entesp.boxcol)
- cm.ValueChanged = function(self, col)
- ch.vars.entesp.boxcol = col
- end
- local bco = vgui.Create("DComboBox", fr)
- bco:Dock(BOTTOM)
- bco:AddChoice("solid", 1)
- bco:AddChoice("rainbow", 2)
- bco:ChooseOptionID(ch.vars.entesp.boxcoltype)
- bco.OnSelect = function(self,val,d)
- ch.vars.entesp.boxcoltype = val
- end
- local co = vgui.Create("DComboBox", fr)
- co:Dock(BOTTOM)
- co:AddChoice("2d", 1)
- co:AddChoice("3d", 2)
- co:ChooseOptionID(ch.vars.entesp.boxtype)
- co.OnSelect = function(self,val,d)
- ch.vars.entesp.boxtype = val
- end
- end)
- ch.derma:AddSpacer(ent)
- ch.derma:AddSlider(ent, "ent esp distance", "how far entities must be before they're culled out", {"entesp","dist"}, 1, 4500, 0, 16000)
- local npc = ch.derma:AddGroup(espl, "NPC ESP", "icon16/user_gray.png")
- ch.derma:AddOption(npc, "npc esp", {"npcesp", "enabled"}, "enable npc esp")
- ch.derma:AddSpacer(npc)
- ch.derma:AddOption(npc, "chams", {"npcesp", "chams"}, "see npcs through walls as a single color\nright click to edit", function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize chams")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.npcesp.color)
- cm.ValueChanged = function(self, col)
- ch.vars.npcesp.color = col
- end
- local co = vgui.Create("DComboBox", fr)
- co:Dock(BOTTOM)
- co:AddChoice("solid", 1)
- co:AddChoice("rainbow", 2)
- co:ChooseOptionID(ch.vars.npcesp.chamtype)
- co.OnSelect = function(self,val,d)
- ch.vars.npcesp.chamtype = val
- end
- end)
- ch.derma:AddOption(npc, "halo outline", {"npcesp", "halo"}, "glow around npcs\nright click to edit",function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize halo")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.npcesp.halocol)
- cm.ValueChanged = function(self, col)
- ch.vars.npcesp.halocol = col
- end
- local bco = vgui.Create("DComboBox", fr)
- bco:Dock(BOTTOM)
- bco:AddChoice("solid", 1)
- bco:AddChoice("rainbow", 2)
- bco:ChooseOptionID(ch.vars.npcesp.halocoltype)
- bco.OnSelect = function(self,val,d)
- ch.vars.npcesp.halocoltype = val
- end
- end)
- ch.derma:AddOption(npc, "distance fade", {"npcesp", "fade"}, "fade text the further npcs are from you")
- ch.derma:AddOption(npc, "bounding box", {"npcesp", "box"}, "see dimensions of npcs\nright click to edit", function(but)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("customize bounding box")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.npcesp.boxcol)
- cm.ValueChanged = function(self, col)
- ch.vars.npcesp.boxcol = col
- end
- local bco = vgui.Create("DComboBox", fr)
- bco:Dock(BOTTOM)
- bco:AddChoice("solid", 1)
- bco:AddChoice("rainbow", 2)
- bco:ChooseOptionID(ch.vars.npcesp.boxcoltype)
- bco.OnSelect = function(self,val,d)
- ch.vars.npcesp.boxcoltype = val
- end
- local co = vgui.Create("DComboBox", fr)
- co:Dock(BOTTOM)
- co:AddChoice("2d", 1)
- co:AddChoice("3d", 2)
- co:ChooseOptionID(ch.vars.npcesp.boxtype)
- co.OnSelect = function(self,val,d)
- ch.vars.npcesp.boxtype = val
- end
- end)
- ch.derma:AddSpacer(npc)
- ch.derma:AddOption(npc, "name", {"npcesp","name"}, "show class of npcs")
- ch.derma:AddOption(npc, "weapon", {"npcesp","weapon"}, "show current weapon of npcs")
- ch.derma:AddOption(npc, "health", {"npcesp","health"}, "show current health of npcs")
- ch.derma:AddOption(npc, "distance", {"npcesp","showdist"}, "show distance from you")
- ch.derma:AddSpacer(npc)
- ch.derma:AddSlider(npc, "ent esp distance", "how far entities must be before they're culled out", {"npcesp","dist"}, 1, 4500, 0, 16000)
- local misc = vgui.Create("DPanel", p)
- misc:Dock(FILL)
- local miscl = vgui.Create("DCategoryList", misc)
- miscl:Dock(FILL)
- miscl:DockPadding(0,0,0,0)
- local friend = ch.derma:AddGroup(miscl, "friends", "icon16/group.png")
- ch.derma:AddButton(friend, "manage friends", [[set players as friends or not for the cheat to recognise]], function()
- local fr = vgui.Create("DFrame")
- fr:SetTitle("double click to swap (drag between steam id and name to resize)")
- fr:SetSize(500,300)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local olist = vgui.Create( "DListView", fr )
- olist:SetPos(0,20)
- olist:SetSize(250,254)
- olist:SetMultiSelect( false )
- olist:AddColumn("STEAMID")
- olist:AddColumn("Enemies")
- local ilist = vgui.Create( "DListView", fr )
- ilist:SetPos(250,20)
- ilist:SetSize(250,254)
- ilist:SetMultiSelect( false )
- ilist:AddColumn("STEAMID")
- ilist:AddColumn("Friends")
- local function refresh()
- olist:Clear()
- ilist:Clear()
- for k, v in next, ents.GetAll() do
- if not v:IsPlayer() then continue end
- if ch.vars.friends[v:SteamID()] then continue end
- if v == me then continue end
- olist:AddLine(v:SteamID(),(UndecorateNick and UndecorateNick(v:Nick()) or v:Nick()))
- end
- for k, v in next, ch.vars.friends do
- local ply = player.GetBySteamID(k)
- ilist:AddLine(k,(ply and UndecorateNick and UndecorateNick(ply:Nick()) or ply:Nick()))
- end
- end
- refresh()
- olist.DoDoubleClick = function(self,id,line)
- ch.vars.friends[line:GetColumnText(1)] = true
- refresh()
- end
- ilist.DoDoubleClick = function(self,id,line)
- ch.vars.friends[line:GetColumnText(1)] = nil
- refresh()
- end
- local addsteam = vgui.Create("DButton", fr)
- addsteam:Dock(BOTTOM)
- addsteam:SetText("steam friends as friends")
- addsteam.DoClick = function(self,a,b)
- for k, v in next, ents.GetAll() do
- if not v:IsPlayer() then continue end
- if ch.vars.friends[v:SteamID()] then continue end
- if v:GetFriendStatus() == "friend" then
- ch.vars.friends[v:SteamID()] = true
- end
- end
- refresh()
- end
- end)
- local mi = ch.derma:AddGroup(miscl, "misc", "icon16/text_align_center.png")
- ch.derma:AddOption(mi, "lazy guns", "lazyguns", "automatically shoot and reload weapons while holding keys")
- ch.derma:AddOption(mi, "triggerbot", "triggerbot", "automatically shoot your gun when aiming at something")
- ch.derma:AddSpacer(mi)
- ch.derma:AddOption(mi, "bhop", "bhop", "jump automatically while holding space")
- ch.derma:AddSpacer(mi)
- ch.derma:AddOption(mi, "spectators", "spectators", "see who's spectating you, if anyone")
- ch.derma:AddOption(mi, "death notifications", "player_die", "notify you when a player dies")
- ch.derma:AddSpacer(mi)
- ch.derma:AddOption(mi, "crosshair", {"crosshair","enabled"}, "custom crosshair, because why not")
- ch.derma:AddButton(mi, "customize crosshair", "customize colors or size of crosshairs", function()
- local fr = vgui.Create("DFrame")
- fr:SetTitle("crosshair customizer")
- fr:SetSize(400,400)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local cm = vgui.Create("DColorMixer", fr)
- cm:Dock(FILL)
- cm:SetColor(ch.vars.crosshair.color)
- cm.ValueChanged = function(self, col)
- ch.vars.crosshair.color = col
- end
- local co = vgui.Create("DComboBox", fr)
- co:Dock(BOTTOM)
- co:AddChoice("square", 1)
- co:AddChoice("cross", 2)
- co:ChooseOptionID(ch.vars.crosshair.type)
- co.OnSelect = function(self,val,d)
- ch.vars.crosshair.type = isnumber(val) and val or 1
- end
- local ss = vgui.Create("DNumSlider", fr)
- ss:Dock(BOTTOM)
- ss:SetText("crosshair size")
- ss:SetMin(1)
- ss:SetMax(64)
- ss:SetDecimals(0)
- ss:SetValue(ch.vars.crosshair.size)
- ss.OnValueChanged = function(self, v)
- ch.vars.crosshair.size = v
- end
- end)
- local netmeme = vgui.Create("DPanel", p)
- netmeme:Dock(FILL)
- netmeme:SetBackgroundColor(Color(0,0,0,0))
- local nettext = vgui.Create("RichText", netmeme)
- nettext:Dock(FILL)
- local netblock = vgui.Create("DButton", netmeme)
- netblock:Dock(TOP)
- netblock:SetText("filter net messages")
- netblock.DoClick = function(self)
- local fr = vgui.Create("DFrame")
- fr:SetTitle("filter net messages")
- fr:SetSize(500,300)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetScreenLock(true)
- fr:MakePopup()
- f.submenus[#f.submenus + 1] = fr
- local olist = vgui.Create( "DListView", fr )
- olist:SetPos(0,20)
- olist:SetSize(250,280)
- olist:SetMultiSelect( false )
- olist:AddColumn( "Not Filtering" )
- local elist = vgui.Create( "DListView", fr )
- elist:SetPos(250,20)
- elist:SetSize(250,280)
- elist:SetMultiSelect( false )
- elist:AddColumn( "Filtering Out" )
- local function refresh()
- olist:Clear()
- elist:Clear()
- for k, v in next, net.Receivers do
- if ch.vars.net[k] then continue end
- olist:AddLine(k)
- end
- for k, v in next, ch.vars.net do
- elist:AddLine(k)
- end
- end
- refresh()
- olist.DoDoubleClick = function(_, id, line )
- ch.vars.net[line:GetColumnText(1)] = true
- refresh()
- end
- elist.DoDoubleClick = function(_, id, line )
- ch.vars.net[line:GetColumnText(1)] = nil
- refresh()
- end
- end
- local cams = ch.derma:AddGroup(miscl, "cams", "icon16/camera.png")
- ch.derma:AddOption(cams, "cam cheats", {"cams","enabled"})
- ch.derma:AddOption(cams, "freecam", {"cams","freecam"}, "client side noclip, your character stays in place")
- ch.derma:AddSlider(cams, "freecam speed", "how fast you fly around while freecaming", {"cams","freespeed"}, 1, 5, 1, 30)
- ch.derma:AddSpacer(cams)
- ch.derma:AddOption(cams, "fullbright", "fullbright", "like mat_fullbright 1, except it doesnt force cvars")
- local exploits = vgui.Create("DPanel", p)
- ch.derma.exploits = exploits
- exploits:Dock(FILL)
- local preset = vgui.Create("DPanel", p)
- preset:Dock(FILL)
- local prel = vgui.Create("DCategoryList", preset)
- prel:Dock(FILL)
- prel:DockPadding(0,0,0,0)
- local pre = ch.derma:AddGroup(prel, "Presets", "icon16/page.png")
- ch.derma:AddButton(pre, "preset loader", "open preset loader", function(self)
- local fr = vgui.Create("DFrame")
- fr:SetSize(310,340)
- fr:SetPos(ch.derma.frame:GetPos())
- fr:SetTitle("")
- fr:MakePopup()
- fr:SetScreenLock(true)
- f.submenus[#f.submenus + 1] = fr
- local tree = vgui.Create("DTree", fr)
- tree:Dock(FILL)
- local l = tree:AddNode("configs")
- l:MakeFolder("data/hnc","GAME",true)
- l:SetExpanded(true,true)
- tree.OnNodeSelected = function(_, node)
- if node:GetFileName() then
- local tab = util.JSONToTable(file.Read((node:GetFileName():gsub("data/(.-)",""))))
- local dir = node:GetFileName():gsub("data/hnc/(.-)",""):gsub("/(.+)%.txt","")
- if dir == "cheat" then
- for k, v in next, tab do
- if istable(v) then
- ch.vars[k] = table.Merge(ch.vars[k],v)
- else
- ch.vars[k] = v
- end
- end
- elseif dir == "ents" or dir == "friends" or dir == "net" then
- ch.vars[dir] = table.Merge(ch.vars[dir],tab)
- end
- fr:Close()
- end
- end
- end)
- ch.derma:AddButton(pre, "save current setup", "save the current cheat setup as a preset for later", function()
- local tab = table.Copy(ch.vars)
- local ent = table.Copy(ch.vars.ents)
- local friend = table.Copy(ch.vars.friends)
- local xnet = table.Copy(ch.vars.netblock)
- tab.panic = nil tab.friends = nil tab.ents = nil
- Derma_StringRequest("File Name", "Enter the desired preset name", "", function(nam)
- if not nam or nam == "" then
- nam = tostring(math.random(0, 9999))
- end
- file.Write("hnc/cheat/"..nam..".txt", util.TableToJSON(tab, false))
- file.Write("hnc/ents/"..nam..".txt", util.TableToJSON(ent, false))
- file.Write("hnc/friends/"..nam..".txt", util.TableToJSON(friend, false))
- file.Write("hnc/net/"..nam..".txt", util.TableToJSON(xnet, false))
- end)
- end)
- ch.derma:AddSpacer(pre)
- ch.derma:AddButton(pre, "esp presets", "browse cheat presets")
- ch.derma:AddButton(pre, "friends presets", "browse friends presets")
- ch.derma:AddButton(pre, "ents presets", "browse entity presets")
- p:AddSheet("main", main)
- p:AddSheet("aimbot", aimbot)
- p:AddSheet("esp", esp)
- p:AddSheet("misc", misc)
- p:AddSheet("net", netmeme)
- p:AddSheet("exploits", exploits)
- p:AddSheet("presets", preset)
- end
- -- serious roleplay gamemodes exploits
- do
- if Clockwork then
- ch:AddExploit("pickupinradius", "Clockwork - Pick up in radius", "Pick up Clockwork items in a radius around you regardless of walls", function()
- for k,v in next, ents.FindInSphere(me:GetPos(), 256) do
- if v:IsValid() then
- if v:GetClass() == "cw_item" then
- Clockwork.datastream:Start("EntityMenuOption", {v, "cwItemTake", "cwItemTake"})
- elseif v:GetClass() == "cw_cash" then
- Clockwork.datastream:Start("EntityMenuOption", {v, "cwCashTake", "cwCashTake"})
- elseif v:GetClass() == "cw_shipment" then
- Clockwork.datastream:Start("EntityMenuOption", {v, "cwShipmentOpen", "cwShipmentOpen"})
- elseif v:GetClass() == "cw_belongings" then
- Clockwork.datastream:Start("EntityMenuOption", {v, "Open", "cwBelongingsOpen"})
- elseif v:GetClass() == "prop_physics" then
- Clockwork.datastream:Start("EntityMenuOption", {v, "cwContainerOpen", "cwContainerOpen"})
- elseif v:GetClass() == "prop_ragdoll" then
- Clockwork.datastream:Start("EntityMenuOption", {v, "cwContainerOpen", "cwContainerOpen"})
- end
- end
- end
- end)
- ch:AddExploit("dupeinradius", "Clockwork - Dupe in radius", "Duplicate Clockwork items in a radius around you regardless of walls", function()
- for k, v in next, ents.FindInSphere(me:GetPos(), 256) do
- if v:IsValid() then
- if v:GetClass() == "cw_item" then
- for i=1,3 do
- Clockwork.datastream:Start("EntityMenuOption", {v, "cwItemTake", "cwItemTake"})
- end
- elseif v:GetClass() == "cw_cash" then
- for i=1,3 do
- Clockwork.datastream:Start("EntityMenuOption", {v, "cwCashTake", "cwCashTake"})
- end
- end
- end
- end
- end)
- elseif blackbox then
- ch:AddExploit("pickupinradius", "Blackbox - Pick up in radius", "Pick up Blackbox items in a radius around you regardless of walls", function()
- for k, v in next, ents.FindInSphere(me:GetPos(), 256) do
- if v:IsValid() then
- if v:GetClass() == "bb_item" then
- BLACKBOX:SendNetStream("EntityMenuOption", {v, "bb_itemTake", "bb_itemTake"})
- elseif v:GetClass() == "bb_cash" then
- BLACKBOX:SendNetStream("EntityMenuOption", {v, "bb_cashTake", "bb_cashTake"})
- elseif v:GetClass() == "bb_shipment" then
- BLACKBOX:SendNetStream("EntityMenuOption", {v, "bb_shipmentOpen", "bb_shipmentOpen"})
- --[[elseif v:GetClass() == "bb_belongings" then
- BLACKBOX:SendNetStream("EntityMenuOption", {v, "Open", "cwBelongingsOpen"})]]
- elseif v:GetClass() == "prop_physics" then
- BLACKBOX:SendNetStream("EntityMenuOption", {v, "bb_itemTake", "bb_itemTake"})
- elseif v:GetClass() == "prop_ragdoll" then
- BLACKBOX:SendNetStream("EntityMenuOption", {v, "bb_itemTake", "bb_itemTake"})
- end
- end
- end
- end)
- ch:AddExploit("dupeinradius", "Blackbox - Dupe in radius", "Duplicate Blackbox items in a radius around you regardless of walls", function()
- for k, v in next, ents.FindInSphere(me:GetPos(), 256) do
- if v:IsValid() then
- if v:GetClass() == "bb_item" then
- for i=1,3 do
- BLACKBOX:SendNetStream("EntityMenuOption", {v, "bb_itemTake", "bb_itemTake"})
- end
- elseif v:GetClass() == "bb_cash" then
- for i=1,3 do
- BLACKBOX:SendNetStream("EntityMenuOption", {v, "bb_cashTake", "bb_cashTake"})
- end
- end
- end
- end
- end)
- elseif nut then
- ch:AddExploit("pickupinradius", "NutScript - Pick up in radius", "Pick up NutScript items in a radius around you", function()
- for k, v in next, ents.FindInSphere(me:GetPos(), 95) do
- if v:GetClass() == "nut_item" then
- netstream.Start("invAct","take",v)
- end
- end
- end)
- ch:AddExploit("dupeupinradius", "NutScript - Dupe in radius", "Duplicate NutScript items in a radius around you", function()
- for k, v in next, ents.FindInSphere(me:GetPos(), 95) do
- if v:GetClass() == "nut_item" then
- for i=0,2 do
- netstream.Start("invAct","take",v)
- end
- end
- end
- end)
- end
- end
- -- net lib overrides
- -- do early to try and catch things like cac before we get BANNI
- do
- ch:AddRestore("net",{
- Incoming = net.Incoming,
- Start = net.Start,
- SendToServer = net.SendToServer,
- },function(data)
- for k, v in next, data do
- _G.net[k] = v
- end
- end)
- local richtext
- for k, v in next, ch.derma.prop.Items do
- if v.Name == "net" then
- richtext = v.Panel:GetChildren()[1]
- end
- end
- function richtext:Log(...)
- local tab = {...}
- self:InsertColorChange(255,255,255,255)
- for k, v in next, tab do
- if IsColor(v) then
- self:InsertColorChange(v.r,v.g,v.b,v.a)
- elseif istable(v) and not IsColor(v) then
- self:AppendText(tostring(v))
- else
- self:AppendText(tostring(v or "nil"))
- end
- end
- self:AppendText("\n")
- end
- -- test
- local blacklist = {
- ["cac_banme"] = true,
- }
- local function shouldlog(name)
- for k, v in next, ch.vars.net do
- if name:find(k) then
- return false
- end
- end
- return true
- end
- local lastrec = {}
- function net.Incoming(len, client)
- local origlen = len
- local i = net.ReadHeader()
- local strName = util.NetworkIDToString( i )
- if not strName then return end
- if shouldlog(strName:lower()) then
- richtext:Log("Started ", Color(0,255,255), "incoming ", color_white, "net message ",
- Color(129,255,62), "\""..strName.."\" ", color_white, "of length ", Color(255,129,0), origlen, ".")
- end
- lastrec[#lastrec] = {
- name = strName
- }
- local func = net.Receivers[ strName:lower() ]
- if not func then return end
- --
- -- len includes the 16 bit int which told us the message name
- --
- len = len - 16
- func( len, client )
- if shouldlog(strName:lower()) then
- richtext:Log("Ended ", Color(0,255,255), "incoming ", color_white, "net message ",
- Color(129,255,62), "\""..strName.."\" ", color_white, "of length ", Color(255,129,0), origlen, ".")
- end
- lastrec[#lastrec] = nil
- end
- local _netStart = net.Start
- local lastwrite = {}
- function net.Start(name, unreliable)
- if shouldlog(name:lower()) then
- richtext:Log("Started ", Color(0,255,255), "outgoing ", color_white, "net message ",
- Color(129,255,62), "\""..name.."\" ", ".")
- end
- lastwrite[#lastwrite + 1] = {
- name = name
- }
- if blacklist[lastwrite[#lastwrite].name:lower()] then
- print("cac prolly i hope lol", lastwrite[#lastwrite].name)
- return
- end
- _netStart(name,unreliable)
- end
- local _netSendToServer = net.SendToServer
- function net.SendToServer()
- local message = lastwrite[#lastwrite]
- if shouldlog(message.name:lower()) then
- richtext:Log("Ended ", Color(0,255,255), "outgoing ", color_white, "net message ",
- Color(129,255,62), "\""..message.name.."\" ", color_white, "of length ", Color(255,129,0), message.length,
- color_white, ". Total size: ", Color(255,129,0), net.BytesWritten())
- end
- local name = lastwrite[#lastwrite].name:lower()
- lastwrite[#lastwrite] = nil
- if blacklist[name] then return end
- _netSendToServer()
- end
- for k, v in next, net do
- if k:find"Read" and not k:find"Header" then
- if isfunction(v) then
- ch.restores.net.data[k] = v
- local vartype = k:gsub("Read","")
- net[k] = function(a)
- local ret = v(a)
- if shouldlog(lastrec[#lastrec].name:lower()) then
- if a then
- richtext:Log("\tRead ", Color(0,255,255), vartype, color_white, " of value ", Color(129,255,62), "\'"..tostring(ret).."\'",
- color_white, " with parameters ", Color(0,255,255), "{"..tostring(a).."}", color_white, ".")
- else
- richtext:Log("\tRead ", Color(0,255,255), vartype, color_white, " of value ", Color(129,255,62), "\'"..tostring(ret).."\'",
- color_white, ".")
- end
- end
- return ret
- end
- end
- elseif k:find"Write" then
- if isfunction(v) then
- ch.restores.net.data[k] = v
- local vartype = k:gsub("Write","")
- net[k] = function(a,b)
- if shouldlog(lastwrite[#lastwrite].name:lower()) then
- if b then
- richtext:Log("\tWrote ", Color(0,255,255), vartype, color_white, " of value ", Color(129,255,62), "\'"..tostring(a).."\'",
- color_white, " with parameters ", Color(0,255,255), "{"..tostring(a).."}", color_white, ".")
- else
- richtext:Log("\tWrote ", Color(0,255,255), vartype, color_white, " of value ", Color(129,255,62), "\'"..tostring(a).."\'",
- color_white, ".")
- end
- end
- if blacklist[lastwrite[#lastwrite].name:lower()] then return end
- v(a,b)
- end
- end
- end
- end
- end
- -- HOOKS.
- do
- -- so i dont have to copypaste the same code
- local function bbox(ent, type, col, alpha)
- local min = ent:OBBMins()
- local max = ent:OBBMaxs()
- local points = {
- top = {Vector(min.x,min.y,max.z),
- Vector(min.x,max.y,max.z),
- Vector(max.x,max.y,max.z),
- Vector(max.x,min.y,max.z),},
- bottom = {Vector(min.x,min.y,min.z),
- Vector(min.x,max.y,min.z),
- Vector(max.x,max.y,min.z),
- Vector(max.x,min.y,min.z)}
- }
- if type == 1 then -- 2d
- local mins, maxs
- for _, t in next, points do
- for k2, v2 in next, t do
- local s = ent:LocalToWorld(v2):ToScreen()
- if maxs == nil then
- maxs = {x=s.x,y=s.y}
- mins = {x=s.x,y=s.y}
- else
- maxs.x = math.max(maxs.x, s.x)
- maxs.y = math.max(maxs.y, s.y)
- mins.x = math.min(mins.x, s.x)
- mins.y = math.min(mins.y, s.y)
- end
- end
- end
- cam.Start2D()
- surface.SetDrawColor(col.r, col.g, col.b, alpha)
- surface.DrawLine(mins.x,mins.y,mins.x,maxs.y)
- surface.DrawLine(mins.x,maxs.y,maxs.x,maxs.y)
- surface.DrawLine(maxs.x,maxs.y,maxs.x,mins.y)
- surface.DrawLine(maxs.x,mins.y,mins.x,mins.y)
- cam.End2D()
- elseif type == 2 then -- 3d
- cam.Start3D()
- for _, t in next, points do
- for k2, v2 in next, t do
- local s = ent:LocalToWorld(v2)
- local e = ent:LocalToWorld(t[k2==#t and 1 or k2+1])
- local bcol = Color(col.r,col.g,col.b,alpha)
- render.DrawLine(s,e,bcol,false)
- if _ == "top" then
- e = ent:LocalToWorld(points.bottom[k2])
- render.DrawLine(s,e,bcol,false)
- end
- end
- end
- cam.End3D()
- end
- end
- local function rainbow()
- return HSVToColor(math.sin(CurTime())*360,1,1)
- end
- local function espcolor(ent, ctype, defcol)
- if ctype == 1 then
- return defcol
- elseif ctype == 2 then
- return rainbow()
- elseif ctype == 3 then
- if ttt then
- return ent:IsTraitor() and color_red or ent:IsDetective() and Color(0,0,255) or color_green
- elseif murder then
- return ent.Murderer and color_red or ent.Cop and Color(0,0,255) or color_green
- elseif morbus then
- return ent:IsPlayer() and ent:GetAlien() and Color(255,0,0) or color_green
- else
- return team.GetColor(ent:Team())
- end
- else
- return color_white
- end
- end
- local function plyesp(v,dist,override_ent)
- if v == me then return end
- local a = ch.vars.esp.fade and 255 - (255*(dist/ch.vars.esp.dist)) or 255
- if ch.vars.esp.trace then -- eyetrace
- local e = override_ent or v
- if e.GetShootPos and e.GetEyeTrace then
- cam.Start3D()
- local sp = e:GetShootPos() or 0
- local et = e:GetEyeTrace().HitPos or 0
- if (sp ~= 0 and et ~= 0) then
- render.SetMaterial(Material("models/wireframe"))
- render.DrawBeam(sp, et, 2, 1, 1,Color(255,255,0,a))
- end
- cam.End3D()
- end
- end
- if ch.vars.esp.chams then-- chams
- local col = espcolor(v, ch.vars.esp.chamtype, ch.vars.esp.color)
- local e = override_ent or v
- cam.Start3D()
- render.SuppressEngineLighting(true)
- render.SetColorModulation(col.r/255, col.g/255, col.b/255)
- render.MaterialOverride(Material("models/debug/debugwhite"))
- e:DrawModel()
- cam.End3D()
- end
- if ch.vars.esp.box then-- bounding box
- local col = espcolor(v, ch.vars.esp.boxcoltype, ch.vars.esp.boxcol)
- local e = override_ent or v
- bbox(e,ch.vars.esp.boxtype,col,a)
- end
- render.SuppressEngineLighting(false)
- render.SetColorModulation(1, 1, 1)
- render.MaterialOverride()
- -- ply info
- local e = override_ent or v
- local spos = (e:GetPos() + Vector(0,0,e:OBBMaxs().z)):ToScreen()
- local tpos = spos.y
- if ch.vars.esp.name then
- local n = (UndecorateNick and UndecorateNick(v:GetName()) or v:GetName()) or ""
- local col = (ch.vars.esp.friends and ch.vars.friends[v:SteamID()]) and ch.vars.esp.friendcol or Color(255,255,255,a)
- draw.SimpleTextOutlined("N: "..n, nil, spos.x, tpos, col, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.sname then
- local n = steamworks.GetPlayerName(v:SteamID64() or "") or ""
- draw.SimpleTextOutlined("S: "..n, nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.rank then
- local g = v:GetUserGroup() or ""
- draw.SimpleTextOutlined("G: "..g, nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.traitors and ttt then
- local g = v:IsTraitor() and "Traitor" or v:IsDetective() and "Detective" or "Innocent"
- draw.SimpleTextOutlined("R: "..g, nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.murroles and murder then
- local g = v.Murderer and "Murderer" or v.Cop and "Detective" or "Bystander"
- draw.SimpleTextOutlined("R: "..g, nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.morbus and morbus then
- local g = v:GetAlien() and "Alien" or "Human"
- draw.SimpleTextOutlined("R: "..g, nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.weapon then
- local w = v:GetActiveWeapon():IsValid() and v:GetActiveWeapon():GetPrintName() or ""
- draw.SimpleTextOutlined("W: "..language.GetPhrase(w), nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.health then
- local h = v:Health() or 0
- local r = math.Clamp(2550/h,0,255)
- local g = h*2.5
- draw.SimpleTextOutlined("H: "..h, nil, spos.x, tpos, Color(r,g,0,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.armor then
- local ar = v:Armor() or 0
- local r = math.Clamp(2550/ar,0,255)
- local b = ar*2.5
- draw.SimpleTextOutlined("A: "..ar, nil, spos.x, tpos, Color(r,0,b,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.drpmon and DarkRP then
- draw.SimpleTextOutlined(DarkRP.formatMoney(v.DarkRPVars and v.DarkRPVars.money or 0), nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.esp.cwtalk and (Clockwork or blackbox) then
- local talkrange
- if Clockwork then
- talkrange = Clockwork.config:Get("talk_radius"):Get()
- elseif blackbox then
- talkrange = blackbox.config.Get("talk_radius"):Get()
- end
- local whisperrange = math.min( talkrange / 3, 80 )
- local yellrange = talkrange * 2
- if dist <= whisperrange then
- draw.SimpleTextOutlined("Whisper Range", nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- elseif dist <= talkrange then
- draw.SimpleTextOutlined("Talk Range", nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- elseif dist <= yellrange then
- draw.SimpleTextOutlined("Yell Range", nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- else
- draw.SimpleTextOutlined("Outside Range", nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- end
- tpos = tpos + 15
- end
- if ch.vars.esp.showdist then
- draw.SimpleTextOutlined("D: "..math.floor(dist), nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- end
- local function entesp(v,dist)
- local spos = (v:GetPos() + Vector(0,0,v:OBBMaxs().z)):ToScreen()
- local tpos = spos.y
- local a = ch.vars.entesp.fade and 255 - (255*(dist/ch.vars.entesp.dist)) or 255
- if ch.vars.entesp.box then-- bounding box
- local col
- if ch.vars.entesp.boxcoltype == 2 then
- col = rainbow()
- else
- col = ch.vars.entesp.boxcol
- end
- bbox(v,ch.vars.entesp.boxtype,col,a)
- end
- local drawinfo = ch:ESPEnt(v)
- drawinfo.color.a = a
- draw.SimpleTextOutlined("["..drawinfo.name.."] - "..math.floor(dist), nil, spos.x, tpos+45, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- draw.SimpleTextOutlined("["..drawinfo.extra.."]", nil, spos.x, tpos+60, drawinfo.color, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- end
- local function npcesp(v,dist)
- local a = ch.vars.npcesp.fade and 255 - (255*(dist/ch.vars.npcesp.dist)) or 255
- if ch.vars.npcesp.chams then-- chams
- local col
- if ch.vars.npcesp.chamtype == 2 then
- col = rainbow()
- else
- col = ch.vars.npcesp.color
- end
- cam.Start3D()
- render.SuppressEngineLighting(true)
- render.SetColorModulation(col.r/255, col.g/255, col.b/255)
- render.MaterialOverride(Material("models/debug/debugwhite"))
- v:DrawModel()
- cam.End3D()
- end
- if ch.vars.npcesp.box then-- bounding box
- local col
- if ch.vars.npcesp.boxcoltype == 2 then
- col = rainbow()
- else
- col = ch.vars.npcesp.boxcol
- end
- bbox(v,ch.vars.npcesp.boxtype,col,a)
- end
- render.SuppressEngineLighting(false)
- render.SetColorModulation(1, 1, 1)
- render.MaterialOverride()
- -- npc info
- local spos = (v:GetPos() + Vector(0,0,v:OBBMaxs().z)):ToScreen()
- local tpos = spos.y
- if ch.vars.npcesp.name then
- local n = v:GetClass()
- draw.SimpleTextOutlined("N: "..n, nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.npcesp.weapon then
- local w = v:GetActiveWeapon():IsValid() and v:GetActiveWeapon():GetPrintName() or ""
- draw.SimpleTextOutlined("w: "..language.GetPhrase(w), nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.npcesp.health then
- local h = v:Health()
- local r = math.Clamp(2550/h,0,255)
- local g = h*2.5
- draw.SimpleTextOutlined("H: "..h, nil, spos.x, tpos, Color(r,g,0,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- if ch.vars.npcesp.showdist then
- draw.SimpleTextOutlined("D: "..math.floor(dist), nil, spos.x, tpos, Color(255,255,255,a), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0,a))
- tpos = tpos + 15
- end
- end
- local modechange = false
- ch:AddHook( "PreRender", "fullbright", function()
- if ch.vars.panic or not (ch.vars.cams.enabled and ch.vars.fullbright) then
- modechange = false
- render.SetLightingMode(0)
- return
- end
- render.SetLightingMode(1)
- modechange = true
- end )
- local function EndOfLightingMod()
- if modechange then
- render.SetLightingMode(0)
- modechange = false
- end
- end
- ch:AddHook( "PostRender", "fullbright", EndOfLightingMod )
- ch:AddHook( "PreDrawHUD", "fullbright", EndOfLightingMod )
- ch:AddHook("HUDPaint","esp",function()
- if ch.vars.panic or not (ch.vars.esp.enabled or ch.vars.entesp.enabled or ch.vars.npcesp.enabled) then return end
- for k, v in next, ents.GetAll() do
- if not v:IsValid() then continue end
- local dist = me:GetPos():Distance(v:GetPos())
- if v:IsPlayer() and ch.vars.esp.enabled then
- if not v:Alive() or v:IsDormant() or v == me or dist > ch.vars.esp.dist then continue end
- if me:GetObserverTarget() == v and me:GetObserverMode() == OBS_MODE_IN_EYE then continue end
- plyesp(v,dist)
- elseif ch.vars.ents[v:GetClass()] and ch.vars.entesp.enabled then
- if dist > ch.vars.entesp.dist then continue end
- entesp(v,dist)
- elseif v:IsNPC() and ch.vars.npcesp.enabled then
- if v:Health() < 1 or v:IsDormant() or dist > ch.vars.npcesp.dist then continue end
- if Clockwork and IsValid(v:GetNetworkedEntity("Player",NULL)) then
- plyesp(v:GetNetworkedEntity("Player",NULL),dist,v)
- continue
- end
- npcesp(v,dist)
- end
- end
- end)
- ch:AddHook("PreDrawHalos","esp",function()
- if ch.vars.panic then return end
- for k, v in next, ents.GetAll() do
- if v:IsPlayer() then
- if me:GetPos():Distance(v:GetPos()) > ch.vars.esp.dist then continue end
- if v == me then continue end
- if not v:Alive() then continue end
- if ch.vars.esp.enabled and ch.vars.esp.halo then
- halo.Add({v}, espcolor(v, ch.vars.esp.halocoltype, ch.vars.esp.halocol), 2, 2, 1, true, true)
- end
- elseif ch.vars.ents[v:GetClass()] then
- if me:GetPos():Distance(v:GetPos()) > ch.vars.entesp.dist then continue end
- if ch.vars.entesp.enbaled and ch.vars.entesp.halo then
- halo.Add({v}, espcolor(v, ch.vars.entesp.halocoltype, ch.vars.entesp.halocol), 2, 2, 1, true, true)
- end
- elseif v:IsNPC() then
- if me:GetPos():Distance(v:GetPos()) > ch.vars.npcesp.dist then continue end
- if ch.vars.npcesp.enabled and ch.vars.npcesp.halo then
- halo.Add({v}, espcolor(v, ch.vars.npcesp.halocoltype, ch.vars.npcesp.halocol), 2, 2, 1, true, true)
- end
- end
- end
- end)
- local specs = {}
- local posy = 20
- ch:AddHook("HUDPaint","spectators",function()
- if ch.vars.panic or not ch.vars.spectators then return end
- posy = 20
- for k, v in next, specs do
- if not player.GetBySteamID(k) then
- specs[k] = false
- end
- end
- for k, v in next, ents.GetAll() do
- if not v:IsPlayer() then continue end
- if v:GetObserverTarget() == me then
- specs[v:SteamID()] = true
- else
- specs[v:SteamID()] = false
- end
- end
- for k, v in next, specs do
- if v then
- local fh = draw.GetFontHeight("DermaDefault")
- draw.SimpleTextOutlined(player.GetBySteamID(k) and player.GetBySteamID(k):Nick() or "someone", "DermaDefault", 20, posy, nil, nil, nil, 1, color_black)
- posy = posy + fh
- end
- end
- end)
- ch:AddHook("HUDPaint","crosshair",function()
- if ch.vars.panic or not ch.vars.crosshair.enabled then return end
- local tr = me:GetEyeTrace()
- local p = tr.HitPos:ToScreen()
- local col = ch.vars.crosshair.color
- local size = ch.vars.crosshair.size
- if ch.vars.crosshair.type == 1 then -- square
- surface.SetDrawColor(col.r,col.g,col.b,col.a)
- surface.DrawRect(p.x-size,p.y-size,size*2,size*2)
- surface.SetDrawColor(128,128,128,255)
- surface.DrawRect(p.x-(math.ceil(size/2)),p.y-(math.ceil(size/2)),size,size)
- elseif ch.vars.crosshair.type == 2 then -- cross
- surface.SetDrawColor(col.r,col.g,col.b,col.a)
- surface.DrawLine(p.x-size,p.y,p.x+size,p.y)
- surface.DrawLine(p.x,p.y-size,p.x,p.y+size)
- end
- end)
- local wasonground=0
- ch:AddHook("CreateMove","bhop",function(cmd)
- if ch.vars.panic or not ch.vars.bhop then return end
- if me:GetMoveType() ~= MOVETYPE_WALK or me:WaterLevel()~=0 then return end
- if bit.band(cmd:GetButtons() , IN_JUMP) ~= 0 then
- if me:IsOnGround() then
- if wasonground > 100 then
- wasonground=0
- cmd:SetButtons(cmd:GetButtons() - IN_JUMP)
- else
- wasonground=wasonground+1
- cmd:SetButtons(bit.bor(cmd:GetButtons() , IN_JUMP))
- end
- else
- wasonground=0
- cmd:SetButtons(cmd:GetButtons() - IN_JUMP)
- end
- end
- end)
- local function aimbotvalid(target)
- if not target or not IsValid(target) then return false end
- if not target:Alive() or target:Health() <= 0 then return false end
- if ch.vars.aimbot.type == 1 and me:GetPos():Distance(target:GetPos()) > ch.vars.aimbot.dist then return false end
- if ch.vars.aimbot.type == 2 then
- local eyes = target:GetAttachment(target:LookupAttachment("eyes"))
- if not eyes then
- eyes = target:GetBonePosition(target:LookupBone("ValveBiped.Bip01_Head1"))
- end
- local pos
- if not eyes then
- pos = target:GetPos() + (target:Crouching() and Vector(0,0,30) or Vector(0,0,60))
- else
- pos = eyes.Pos
- end
- if not (((pos.x - ScrW()/2)^2 + (pos.y - ScrH()/2)^2) < ch.vars.aimbot.fov^2) then
- return false
- end
- end
- return true
- end
- local function norm(ang)
- return Angle(math.NormalizeAngle(ang.p),math.NormalizeAngle(ang.y),math.NormalizeAngle(ang.r))
- end
- local function smoothangle(start, target, add)
- if not start or not target or not add then return target end
- local diff = norm(target - start)
- local vec = Vector(diff.p, diff.y, diff.r)
- local len = vec:Length()
- vec = vec:GetNormal() * math.min(add, len)
- return start + Angle(vec.x, vec.y, vec.z)
- end
- local aimv = {
- origin = me:GetShootPos(),
- drawviewer = false
- }
- local aimang
- local target
- ch:AddHook("CreateMove","aimbot",function(cmd,a,b,c)
- if ch.vars.panic or not ch.vars.aimbot.enabled then
- aimang = me:EyeAngles()
- aimv.angles = aimang
- return
- end
- -- clear the target if invalid
- if not aimbotvalid(target) then
- target = nil
- end
- if ch.vars.aimbot.type == 1 then -- distance
- for k, v in next, ents.FindInSphere(me:GetPos(), ch.vars.aimbot.dist) do
- if v == me or not v:IsPlayer() or not v:Alive() then continue end
- if v:Team() == TEAM_SPECTATOR or v:Team() == TEAM_CONNECTING then continue end
- if ch.vars.friends[v:SteamID()] then continue end
- if ch.vars.aimbot.los and not me:IsLineOfSightClear(v) then continue end
- if not target then target = v end
- if me:GetPos():Distance(v:GetPos()) < me:GetPos():Distance(target:GetPos()) then
- target = v
- end
- end
- elseif ch.vars.aimbot.type == 2 then -- fov
- local potentials = {}
- for k, v in next, ents.GetAll() do
- if v == me or not v:IsPlayer() or not v:Alive() then continue end
- if v:Team() == TEAM_SPECTATOR or v:Team() == TEAM_CONNECTING then continue end
- if ch.vars.friends[v:SteamID()] then continue end
- if me:GetPos():Distance(v:GetPos()) > ch.vars.aimbot.dist then continue end
- if ch.vars.aimbot.los and not me:IsLineOfSightClear(v) then continue end
- local eye = v:LookupAttachment("eyes")
- local eyes
- if eye then
- eyes = v:GetAttachment(eye)
- end
- if not eyes then
- local b = v:LookupBone("ValveBiped.Bip01_Head1")
- if not b then continue end
- eyes = v:GetBonePosition(b)
- end
- if not eyes then
- eyes = v:LocalToWorld(v:OBBCenter())
- else
- eyes = eyes.Pos
- end
- local pos = eyes:ToScreen()
- -- check they're in fov
- if ((pos.x - ScrW()/2)^2 + (pos.y - ScrH()/2)^2) < ch.vars.aimbot.fov^2 then
- table.insert(potentials, v)
- end
- end
- -- closest first
- table.sort(potentials, function(a,b) return a:GetPos():Distance(me:GetPos()) < b:GetPos():Distance(me:GetPos()) end)
- target = potentials[1] or nil
- end
- --[[if ch.vars.aimbot.stick then
- target = oldtarget
- end]]
- --[[if ch.vars.aimbot.freeaim then
- local angx = math.NormalizeAngle(aimv.angles.y + (cmd:GetMouseX()/-50))
- local angy = math.Clamp(aimv.angles.x + (cmd:GetMouseY()/50),-89,89)
- local ang = Angle(angy,angx,0)
- aimv.angles = ang
- end]]
- -- should we aim?
- -- line of sight check
- if ch.vars.aimbot.los and target and not me:IsLineOfSightClear(target) then
- return end
- -- aim on key checks
- if ch.vars.aimbot.onkey then
- if not input.IsKeyDown(ch.vars.aimbot.key) then
- return end
- if vgui.GetKeyboardFocus() or gui.IsGameUIVisible() then
- return end
- end
- if target and target:IsValid() then -- aim
- local worldpos
- local head = target:LookupBone("ValveBiped.Bip01_Head1")
- local eyes = target:LookupAttachment("eyes")
- if not (eyes or head) then
- worldpos = target:LocalToWorld(target:OBBCenter())
- elseif not eyes then
- worldpos = target:GetBonePosition(head)
- else
- worldpos = target:GetAttachment(eyes).Pos
- end
- if not worldpos then
- worldpos = target:GetPos() + (target:Crouching() and Vector(0,0,30) or Vector(0,0,60))
- end
- cmd:SetViewAngles(
- smoothangle(me:EyeAngles(),(worldpos - me:GetShootPos()):Angle(), ch.vars.aimbot.smooth and ch.vars.aimbot.smoothstep)
- )
- end
- end)
- --[[ ch:AddHook("CalcView","freeaimbot",function(ply,pos,ang,fov)
- if ch.vars.panic or not (ch.vars.aimbot.enabled and ch.vars.aimbot.type == 2) or
- (ch.vars.cams.enabled and ch.vars.cams.freecam) then return end
- aimv.fov = fov
- return aimv
- end) ]]
- local altx = true
- ch:AddHook("CreateMove","triggerbot",function(cmd)
- if ch.vars.panic or not ch.vars.triggerbot then return end
- if altx then
- local tr = me:GetEyeTraceNoCursor()
- local ent = tr.Entity
- if not ent or not ent:IsValid() then return end
- if ent:IsPlayer() and ch.vars.friends[ent:SteamID()] then return end
- if ent:IsNPC() or ent:IsPlayer() then
- cmd:SetButtons(bit.bor(cmd:GetButtons(),IN_ATTACK))
- elseif ent:IsVehicle() then
- for k, v in next, ents.FindInSphere(ent:GetPos(), 50) do
- if v:IsPlayer() and v:InVehicle() and v ~= me then
- cmd:SetButtons(bit.bor(cmd:GetButtons(),IN_ATTACK))
- end
- end
- end
- else
- if cmd:KeyDown(IN_ATTACK) then
- cmd:SetButtons(cmd:GetButtons() - IN_ATTACK)
- end
- end
- altx = not altx
- end)
- local alt = true
- ch:AddHook("CreateMove","lazyguns",function(cmd)
- if ch.vars.panic or not ch.vars.lazyguns then return end
- local wep = me:GetActiveWeapon()
- if not wep or not wep:IsValid() then return end
- if wep.GetMaxClip1 and wep:GetMaxClip1() > 0 and wep:Clip1() <= 0 then
- if cmd:KeyDown(IN_ATTACK) or cmd:KeyDown(IN_ATTACK2) then
- cmd:RemoveKey(IN_ATTACK)
- end
- cmd:SetButtons(bit.bor(cmd:GetButtons(),IN_RELOAD))
- end
- if (wep.Primary and not wep.Primary.Automatic) or wep:GetClass() == "weapon_pistol" then
- if cmd:KeyDown(IN_ATTACK)then
- if alt then
- cmd:SetButtons(bit.bor(cmd:GetButtons(),IN_ATTACK))
- else
- cmd:SetButtons(cmd:GetButtons() - IN_ATTACK)
- end
- end
- end
- alt = not alt
- end)
- local function PointOnCircle( ang, radius, offX, offY )
- ang = math.rad( ang )
- local x = math.cos( ang ) * radius + offX
- local y = math.sin( ang ) * radius + offY
- return x, y
- end
- ch:AddHook("HUDPaint","drawfov",function()
- if ch.vars.panic then return end
- if not ch.vars.aimbot.drawfov then return end
- for degrees = 1, 360, (360/12) do
- local x, y = PointOnCircle( degrees, ch.vars.aimbot.fov, ScrW()/2, ScrH()/2 )
- surface.SetDrawColor(255, 255, 255, 255)
- surface.DrawRect(x, y, 3, 3)
- end
- end)
- local viewOrigin
- local viewAngles
- local on = false
- local eyeAng
- local moveVelocity=Vector(0,0,0)
- ch:AddHook("CreateMove","freecam",function(cmd)
- if ch.vars.panic or not (ch.vars.cams.enabled and ch.vars.cams.freecam) then
- viewOrigin = me:GetShootPos()
- on = false
- return
- end
- if ch.vars.cams.enabled and ch.vars.cams.freecam then
- if not on then
- eyeAng = me:EyeAngles()
- viewAngles = eyeAng
- viewOrigin = me:GetShootPos()
- on = true
- end
- if not viewOrigin then return end
- local buttons = cmd:GetButtons()
- local fast = bit.band(buttons,IN_SPEED) ~= 0
- local slow = bit.band(buttons,IN_DUCK) ~= 0
- local speed = ch.vars.cams.freespeed or 2.5
- local acc = 5*(speed and 4 or 1)*(slow and 0.1 or 1)
- local angx = math.NormalizeAngle(viewAngles.y + (cmd:GetMouseX()/-50))
- local angy = math.Clamp(viewAngles.x + (cmd:GetMouseY()/50),-89,89)
- viewAngles = Angle(angy,angx,0)
- local up = 0
- local right = 0
- local forward = 0
- local maxspeed = 10000
- if cmd:KeyDown( IN_FORWARD ) then forward = forward + maxspeed end
- if cmd:KeyDown( IN_BACK ) then forward = forward - maxspeed end
- if cmd:KeyDown( IN_JUMP ) then cmd:RemoveKey(IN_JUMP) up = up + maxspeed end
- if cmd:KeyDown( IN_WALK ) then cmd:RemoveKey(IN_WALK) up = up - maxspeed end
- if cmd:KeyDown( IN_MOVERIGHT ) then right = right + maxspeed end
- if cmd:KeyDown( IN_MOVELEFT ) then right = right - maxspeed end
- if cmd:KeyDown( IN_DUCK ) then cmd:RemoveKey(IN_DUCK) end
- if cmd:KeyDown( IN_SPEED ) then cmd:RemoveKey(IN_SPEED) end
- cmd:ClearMovement()
- cmd:SetViewAngles(eyeAng)
- local ang = viewAngles
- local deltaTime = FrameTime()
- local acceleration = ( ang:Forward() * forward ) + ( ang:Right() * right ) + ( vector_up * up )
- local accelSpeed = math.min( acceleration:Length(), 250 )
- local accelDir = acceleration:GetNormal()
- acceleration = accelDir * accelSpeed * speed
- local newVelocity = moveVelocity + acceleration * deltaTime * acc
- newVelocity = newVelocity * ( 0.95 - deltaTime * 4 )
- moveVelocity = newVelocity
- local newOrigin = viewOrigin + newVelocity * deltaTime
- viewOrigin = newOrigin
- end
- end)
- ch:AddHook("CalcView","freecam",function(ply,origin,angle,fov)
- if ch.vars.panic or not (ch.vars.cams.enabled and ch.vars.cams.freecam) then return end
- if not viewOrigin then
- viewOrigin=origin
- end
- return {
- origin = viewOrigin,
- drawviewer = (ch.vars.cams.enabled and ch.vars.cams.freecam) and true or false,
- angles = viewAngles
- }
- end)
- local hide = {
- CHudDamageIndicator = true
- }
- ch:AddHook("HUDShouldDraw","hide",function(name)
- if hide[name] then return false end
- end)
- -- literally fuckin ripped from the keypad code
- local elements = {}
- -- Create numbers
- do
- for i = 1, 9 do
- local column = (i - 1) % 3
- local row = math.floor((i - 1) / 3)
- local element = {
- x = 0.075 + (0.3 * column),
- y = 0.175 + 0.25 + 0.05 + ((0.5 / 3) * row),
- w = 0.25,
- h = 0.13,
- text = tostring(i)
- }
- table.insert(elements, element)
- end
- table.insert(elements,{x = 0.075,y = 0.04 + 0.25 + 0.03,w = 0.85 / 2 - 0.04 / 2 + 0.05,h = 0.125,text = "ABORT"})
- table.insert(elements,{x = 0.5 + 0.04 / 2 + 0.05,y = 0.04 + 0.25 + 0.03,w = 0.85 / 2 - 0.04 / 2 - 0.05,h = 0.125,text = "OK"})
- end
- local function CalculateCursorPos(self,ply)
- if not IsValid(ply) then
- return 0, 0
- end
- local tr = util.TraceLine({
- start = ply:EyePos(),
- endpos = ply:EyePos() + ply:GetAimVector() * 65,
- filter = ply
- })
- if tr.Entity ~= self then
- return 0, 0
- end
- local scale = self.Scale
- local pos, ang = self:CalculateRenderPos(), self:CalculateRenderAng()
- local normal = self:GetForward()
- local intersection = util.IntersectRayWithPlane(ply:EyePos(), ply:GetAimVector(), pos, normal)
- if not intersection then
- return 0, 0
- end
- local diff = pos - intersection
- local x = diff:Dot(-ang:Forward()) / scale
- local y = diff:Dot(-ang:Right()) / scale
- return x, y
- end
- local function highlightedkey(self,ply)
- local w, h = self.Width2D, self.Height2D
- local x, y = CalculateCursorPos(self,ply)
- for _, element in ipairs(elements) do
- local element_x = w * element.x
- local element_y = h * element.y
- local element_w = w * element.w
- local element_h = h * element.h
- if element_x < x and element_x + element_w > x and
- element_y < y and element_y + element_h > y
- then
- return element
- end
- end
- end
- ch:AddHook("Tick","keypad",function()
- if ch.vars.panic then return end
- for k, v in next, player.GetHumans() do
- local tr = v:GetEyeTrace()
- if tr.Entity and tr.Entity:IsValid() then
- local ent = tr.Entity
- if ent:GetClass() == "Keypad" or ent:GetClass() == "Keypad_Wire" then
- ent.tempCode = ent.tempCode or ""
- ent.tempText = ent.tempText or ""
- ent.tempStatus = ent.tempStatus or 0
- if ent:GetText() ~= ent.tempText or ent:GetStatus() ~= ent.tempStatus then
- ent.tempText = ent:GetText()
- timer.Simple(0,function()
- ent.tempStatus = ent:GetStatus()
- if ent:GetStatus() == 2 then
- ent.tempCode = ""
- ent.tempText = ""
- elseif ent:GetStatus() == 1 then
- if ent:GetOwner() ~= v and v:GetActiveWeapon():GetClass() == "keypad_cracker" then return end
- if not ent.code or ent.code ~= ent.tempCode then
- ent.code = ent.tempCode ~= "" and ent.tempCode:Right(4) or ent.code
- ent.tempCode = ""
- ent.tempText = ""
- end
- end
- end)
- local element = highlightedkey(ent,v)
- if element then
- if element.text ~= "OK" and element.text ~= "ABORT" then
- ent.tempCode = ent.tempCode .. element.text
- elseif element.text == "ABORT" then
- ent.tempCode = ""
- end
- end
- end
- end
- end
- end
- end)
- ch:AddHook("Tick","player_death",function()
- if ch.vars.panic or not ch.vars.player_die then return end
- for k, v in next, ents.GetAll() do
- if not v:IsPlayer() then continue end
- if v:Alive() or v:Health() > 0 then
- v.hnAlive = true
- elseif v.hnAlive then
- if ttt then v:SetNWBool("body_found", true) end
- chat.AddText(v:Nick().. " has died.")
- v.hnAlive = false
- end
- end
- end)
- end
- if ttt then
- ch:AddRestore("ttt", {
- IsTraitor = me.IsTraitor
- }, function(data)
- FindMetaTable"Player".IsTraitor = data.IsTraitor
- end)
- local PLAYER = FindMetaTable"Player"
- local _IsTraitor = PLAYER.IsTraitor
- function PLAYER:IsTraitor()
- if self.hnTraitor then
- return true
- end
- return _IsTraitor(self)
- end
- local getweps
- local tweps = {}
- if tonumber(GAMEMODE.Version:Split"-"[1]) < 2016 then
- getweps = select(2,getupvalue(me.GetWeapons, 1))
- else
- getweps = select(2,getupvalue(me.GetWeapons, 2))
- end
- for k, v in next, weapons.GetList() do
- local wep = weapons.GetStored(v.ClassName)
- -- if the swep is set up right, it'll have this
- if wep.CanBuy and istable(wep.CanBuy) then
- for _, v2 in next, wep.CanBuy do
- if v2 == ROLE_TRAITOR then
- tweps[v.ClassName] = true
- end
- end
- end
- end
- ch:AddHook("TTTPrepareRound", "traitor", function()
- for k, v in next, ents.GetAll() do
- if not v:IsPlayer() then continue end
- v.hnTraitor = false
- end
- end)
- ch:AddHook("Tick", "traitor", function()
- if ch.vars.panic or not ch.vars.esp.traitors then return end
- for k, v in next, ents.GetAll() do
- if not v:IsPlayer() then continue end
- if v == me then continue end
- if v:IsTraitor() then continue end
- for k2, v2 in next, getweps(v) do
- if tweps[v2:GetClass()] and not v2.alreadyOwned then
- v2.alreadyOwned = true
- if not v:IsDetective() then
- chat.AddText(v:Nick().. " is a traitor! " .. v2:GetPrintName())
- v.hnTraitor = true
- end
- end
- end
- end
- end)
- elseif murder then
- ch:AddRestore("murder", {
- tk = net.Receivers.mu_tker
- }, function(data)
- net.Receive("mu_tker", data.tk)
- end)
- net.Receive("mu_tker", function() end) -- lol
- local round = GAMEMODE:GetRound()
- ch:AddHook("Tick", "roles", function()
- if ch.vars.panic or not ch.vars.esp.murroles then return end
- if round ~= GAMEMODE:GetRound() then
- round = GAMEMODE:GetRound()
- for k, v in next, ents.GetAll() do
- if not v:IsPlayer() then continue end
- if v == me then continue end
- v.Murderer = false
- v.Cop = false
- end
- end
- for k, v in next, ents.GetAll() do
- if not v:IsPlayer() then continue end
- if v == me then continue end
- if v.Murderer then continue end
- if v.Cop then continue end
- for k2, v2 in next, v:GetWeapons() do
- if v2:GetClass() == "weapon_mu_knife" then
- v.Murderer = true
- elseif v2:GetClass() == "weapon_mu_magnum" then
- v.Cop = true
- end
- end
- end
- end)
- end
- -- screencap bypasses
- do
- -- generic
- ch:AddRestore("capture",{
- Capture = render.Capture,
- CapturePixels = render.CapturePixels
- }, function(data)
- render.Capture = data.Capture
- render.CapturePixels = data.CapturePixels
- end)
- -- some of them kick you if you deny it, like leys lol
- local CapturePixels = render.CapturePixels
- local Capture = render.Capture
- local function capture(tab)
- ch:DoPanic"disabled for your protection. something tried to screencap you"
- local cap = Capture(tab)
- return cap
- end
- local function pix()
- ch:DoPanic"disabled for your protection. something tried to screencap you"
- CapturePixels()
- end
- render.CapturePixels = pix
- render.Capture = capture
- -- LeyScreenCap, not 100% tested
- -- i couldnt get it setup right lol
- if LeyScreenCap then
- if LeyScreenCap.Tick then
- ch:AddRestore("ley",{
- Tick = LeyScreenCap.Tick
- },function(data)
- safehookadd("Tick", "LeyScreenCap",data.Tick)
- end)
- safehookadd("Tick", "LeyScreenCap", function()
- if(LeyScreenCap.repeatfunc) then
- if(skipticks > 0) then
- skipticks = skipticks - 1
- return
- end
- if(RealFrameTime()>0.1) then
- print("lag; skip cap")
- skipticks = 3
- return
- end
- local linesatonce = 20
- for i=1, linesatonce do
- if(LeyScreenCap.repeatfunc) then
- LeyScreenCap.repeatfunc()
- end
- end
- end
- if(not LeyScreenCap.shouldcap) then return end
- ch:DoPanic"disabled for your protection. something tried to screencap you"
- LeyScreenCap.Screenshot(LeyScreenCap.shouldcap, LeyScreenCap.quality)
- LeyScreenCap.shouldcap = nil
- end)
- end
- if LeyScreenCap.PostRender then
- ch:AddRestore("ley",{
- PostRender = LeyScreenCap.PostRender
- },function(data)
- safehookadd("PostRender", "LeyScreenCap",data.PostRender)
- end)
- local called = 0
- safehookadd("PostRender","LeyScreenCap", function()
- if called < 1 then
- called = called + 1
- ch:DoPanic("disabled for your protection. something tried to screencap you")
- return
- end
- if(LeyScreenCap.repeatfunc) then
- if(skipticks > 0) then
- skipticks = skipticks - 1
- return
- end
- if(RealFrameTime()>0.1) then
- print("lag; skip cap")
- skipticks = 3
- return
- end
- local linesatonce = 20
- for i=1, linesatonce do
- if(LeyScreenCap.repeatfunc) then
- LeyScreenCap.repeatfunc()
- end
- end
- end
- if(not LeyScreenCap.shouldcap) then return end
- ch:DoPanic"disabled for your protection. something tried to screencap you"
- LeyScreenCap.Screenshot(LeyScreenCap.shouldcap, LeyScreenCap.quality)
- LeyScreenCap.shouldcap = nil
- end)
- end
- end
- -- Screengrab
- if util.NetworkStringToID("rtxappend2") ~= 0 then
- ch:AddRestore("Screengrab",{
- netstartscreengrab = net.Receivers.startscreengrab,
- PostRender = hook.GetTable().PostRender.Screengrab
- }, function(data)
- net.Receive("StartScreengrab",data.netstartscreengrab)
- safehookadd("PostRender","Screengrab",data.PostRender)
- end)
- local sg = {}
- sg.white = color_white
- sg.black = color_black
- sg.red = Color( 255, 0, 0 )
- sg.green = Color( 0, 255, 0 )
- sg.orange = Color( 255, 100, 0 )
- sg.yellow = Color( 255, 255, 0 )
- sg.blue = Color( 0, 200, 255 )
- local function cl_rtxappend2( color, text, ply )
- net.Start( "rtxappend2" )
- net.WriteColor( color )
- net.WriteString( text )
- net.WriteEntity( ply )
- net.SendToServer()
- end
- local shouldScreengrab = false
- local quality
- local _ply
- local called = 0
- net.Receive( "StartScreengrab", function()
- shouldScreengrab = true
- quality = net.ReadUInt(32)
- _ply = net.ReadEntity()
- end)
- safehookadd("PostRender", "Screengrab", function()
- if not shouldScreengrab then return end
- if called < 1 then
- called = called + 1
- ch:DoPanic("disabled for your protection. ".. (_ply.Nick and _ply:Nick() or "something") .." tried to screencap you")
- return
- end
- called = 0
- shouldScreengrab = false
- cl_rtxappend2( sg.green, "Initializing", _ply )
- local function capture( q )
- local tab = {
- format = "jpeg",
- h = ScrH(),
- w = ScrW(),
- quality = q,
- x = 0,
- y = 0
- }
- local split = 20000
- local _data = util.Base64Encode( render.Capture( tab ) )
- local data = util.Compress( _data )
- local len = string.len( data )
- cl_rtxappend2( color_white, "Captured " .. len .. " bytes", _ply )
- local parts = math.ceil( len / split )
- cl_rtxappend2( color_white, parts .. " parts", _ply )
- local partstab = {}
- for i = 1, parts do
- local min
- local max
- if i == 1 then
- min = i
- max = split
- elseif i > 1 and i ~= parts then
- min = ( i - 1 ) * split + 1
- max = min + split - 1
- elseif i > 1 and i == parts then
- min = ( i - 1 ) * split + 1
- max = len
- end
- local str = string.sub( data, min, max )
- partstab[ i ] = str
- end
- local amt = table.getn( partstab )
- net.Start( "ScreengrabInitCallback" )
- net.WriteEntity( _ply )
- net.WriteUInt( amt, 32 )
- net.WriteUInt( len, 32 )
- net.WriteFloat( CurTime(), 32 )
- net.SendToServer()
- cl_rtxappend2( Color( 0, 255, 0 ), "Preparing to send data", _ply )
- local i = 1
- timer.Create( "ScreengrabSendParts", 0.1, amt, function()
- net.Start( "ScreengrabSendPart" )
- local l = partstab[ i ]:len()
- net.WriteUInt( l, 32 )
- net.WriteData( partstab[ i ], l )
- net.SendToServer()
- cl_rtxappend2( Color( 255, 255, 0 ), "Sent " .. i .. STNDRD( i ) .. " part", _ply )
- net.Start( "Progress" )
- net.WriteEntity( _ply )
- net.WriteFloat( ( i / amt ) / 2 )
- net.SendToServer()
- i = i + 1
- end )
- end
- capture( quality )
- end )
- end
- -- they just gutted leyscreencap and added one thing
- if ZARP then
- --
- end
- end
- ch:AddConCommand("hn_menu", showmenu)
- ch:AddConCommand("+hn_menu", showmenu)
- ch:AddConCommand("-hn_menu", function() ch.derma.frame:Close() end)
- ch:AddConCommand("hn_toggle", function(ply,cmd,args)
- print(ply,cmd,args)
- end, function(cmd,argstring)
- local auto = {}
- local args = argstring:lower():Trim():Split(" ")
- for k, v in next, ch.vars do
- if k:find(args[1]) then
- table.insert(auto, cmd.. " " ..k)
- print(k, argstring)
- end
- end
- return auto
- end)
- ch:AddConCommand("hn_exploit", function(ply,cmd,args)
- if not ch.exploits[args[1]:lower()] then return end
- ch:Exploit(args[1]:lower())
- end,function(cmd,argstring)
- local auto = {}
- local args = argstring:lower():Trim():Split(" ")
- for k, v in next, ch.exploits do
- if k:find(args[1]) then
- table.insert(auto, cmd.." "..k)
- end
- end
- return auto
- end)
- ch:AddConCommand("hn_panic", function()
- ch.vars.panic = not ch.vars.panic
- end)
Add Comment
Please, Sign In to add comment