Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- timer.Simple(5, function()
- local hwid = [[342387F8D6C0201A069D989008002700C49A{846ee340-7039-11de-9d20-806e6f6e6963}]];
- local steamip = [[]];
- print('***[M] - Loading');
- print("***[D] - DEV");
- dismay = dismay or {};
- dismay.version = 8;
- dismay.rversion = 8;
- dismay.link = "";
- dismay.private = dismay.private or {};
- local function ReplaceG(index)
- dismay[index] = _G[index];
- _G[index] = nil;
- end
- local function ReplaceUN(index)
- dismay.private[index] = _G[index];
- _G[index] = nil;
- end
- ReplaceG ("SetIGN");
- ReplaceG ("OpenClient");
- ReplaceG ("RunMenu");
- ReplaceG ("OpenMenu");
- ReplaceG ("RemoveMenuItem");
- ReplaceG ("SetItemCallback");
- ReplaceG ("SetItemName");
- ReplaceG ("LoadWebScript");
- dismay.SpeedNum = 0;
- dismay.SpeedKey = false;
- dismay.SKey = cookie.GetNumber("__skey", KEY_G);
- dismay.AddHook = hook.Add;
- local a = vgui.Create("DFrame");
- hook.Add("DrawOverlay", "SpeedKey", function()
- draw.DrawText("Open Menu! (esc key)", "BudgetLabel", 2, 3, Color(255,0,255,255));
- end)
- function a:OnKeyCodePressed(key)
- dismay.SKey = key;
- cookie.Set("__skey", key);
- self:Remove();
- a:SetIsMenu(false);
- end
- function a:Think()
- self:RequestFocus();
- end
- a:SetSize(ScrW(), ScrH());
- a:MakePopup();
- a.self = self;
- function a:OnRemove()
- hook.Remove("DrawOverlay", "SpeedKey");
- end
- dismay.real_g = {};
- dismay.metas = {};
- local fetch = http.Fetch;
- local abort = abort;
- dismay.metas._G = {
- __index = function(self, k)
- if dismay.real_g[k] then return dismay.real_g[k]; end
- end;
- __newindex = function(self, k, v)
- if (string.find(string.lower(k), "g_")) then
- if (v == "") then
- return;
- end
- dismay.real_g[k] = v;
- return;
- end
- end;
- };
- setmetatable(_G, dismay.metas._G);
- g_ServerName = nil;
- g_MapName = nil;
- g_ServerURL = nil;
- g_MaxPlayers = nil;
- g_SteamID = nil;
- dismay.adrsrvlist = {};
- local adrsrvlist = dismay.adrsrvlist;
- dismay.gmsrvlist = {};
- local gmsrvlist = dismay.gmsrvlist;
- dismay.nmsrvlist = {};
- local nmsrvlist = dismay.nmsrvlist;
- function GetServers(type, id)
- local data =
- {
- Finished = function()
- end,
- Callback = function( ping , name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid )
- nmsrvlist[name] = {
- ping = ping;
- desc = desc;
- map = map;
- players = players;
- maxplayers = maxplayers;
- botplayers = botplayers;
- pass = pass and "true" or "false";
- lastplayed = lastplayed;
- address = address;
- gamemode = gamemode;
- workshopid = workshopid;
- }
- adrsrvlist[address] = {
- ping = ping;
- name = name;
- desc = desc;
- map = map;
- players = players;
- maxplayers = maxplayers;
- botplayers = botplayers;
- pass = pass and "true" or "false";
- lastplayed = lastplayed;
- address = address;
- gamemode = gamemode;
- workshopid = workshopid;
- }
- gmsrvlist[gamemode] = gmsrvlist or {};
- gmsrvlist[gamemode][address] = {
- ping = ping;
- name = name;
- desc = desc;
- map = map;
- players = players;
- maxplayers = maxplayers;
- botplayers = botplayers;
- pass = pass and "true" or "false";
- lastplayed = lastplayed;
- address = address;
- workshopid = workshopid;
- }
- name = string.JavascriptSafe( name );
- desc = string.JavascriptSafe( desc );
- map = string.JavascriptSafe( map );
- address = string.JavascriptSafe( address );
- gamemode = string.JavascriptSafe( gamemode );
- workshopid = string.JavascriptSafe( workshopid );
- if (pass) then pass = "true" else pass = "false" end
- pnlMainMenu:Call("AddServer( '"..type.."', '"..id.."', "..ping..", \""..name.."\", \""..desc.."\", \""..map.."\", "..players..", "..maxplayers..", "..botplayers..", "..pass..", "..lastplayed..", \""..address.."\", \""..gamemode.."\", \""..workshopid.."\", 50 )");
- end,
- Type = type,
- GameDir = 'garrysmod',
- AppID = 4000,
- }
- serverlist.Query(data)
- end
- function dismay.GetServersByName(name, bRemoveCurrent)
- local ret = {};
- for n, info in pairs(nmsrvlist) do
- if(string.find(string.lower(n), string.lower(name))) then
- ret[n] = info;
- end
- end
- if(bRemoveCurrent) then
- for k,v in pairs(ret) do
- if(v.address == dismay.LastJoin) then
- ret[k] = nil;
- end
- end
- end
- return ret;
- end
- function dismay.GetServersByGamemode(gm)
- return gmsrvlist[gm];
- end
- local o = JoinServer;
- function JoinServer(ip)
- dismay.LastJoin = ip;
- (dismay.OnJoinServer or function() end)(ip);
- return o(ip);
- end
- dismay.Panel = {};
- function dismay.Panel:OnMousePressed()
- self:SetBeingPressed(true);
- local mx, my = input.GetCursorPos();
- local x, y = self:GetPos();
- self.OffX = mx - x;
- self.OffY = my - y;
- end
- function dismay.Panel:Think()
- if(self:GetDraggable() and self:GetBeingPressed() and not self:GetMinimized()) then
- if(input.IsMouseDown(MOUSE_LEFT)) then
- local mx, my = input.GetCursorPos();
- local rx = math.min(ScrW(), math.max(0, mx - self.OffX) + self:GetWide()) - self:GetWide();
- local ry = math.min(ScrH(), math.max(0, my - self.OffY) + self:GetTall()) - self:GetTall();
- self:SetPos(rx, ry);
- else
- self:SetBeingPressed(false);
- end
- end
- if(self:GetMinimized()) then
- if(not self:GetWasMinimized()) then
- local x, y = self:GetPos();
- local w, h = self:GetWide(), self:GetTall();
- local r = {
- x = x;
- y = y;
- w = w;
- h = h;
- };
- self.oldInfo = r;
- dismay.WindowList:AddPnl(self);
- end
- self.btnMaxim:SetDisabled(false);
- self.btnMinim:SetDisabled(true);
- else
- if(self:GetWasMinimized()) then
- self:SetPos(self.oldInfo.x, self.oldInfo.y);
- self:SetTall(self.oldInfo.h);
- self:SetWide(self.oldInfo.w);
- self.btnMaxim:SetDisabled(true);
- self.btnMinim:SetDisabled(false);
- end
- end
- self:SetWasMinimized(self:GetMinimized());
- end
- dismay.Panel.btnMaxim = {}
- function dismay.Panel.btnMaxim:DoClick()
- self:GetParent():SetMinimized(false);
- dismay.WindowList:RemPnl(self:GetParent())
- end
- dismay.Panel.btnMinim = {}
- function dismay.Panel.btnMinim:DoClick()
- self:GetParent():SetMinimized(true);
- end
- function dismay.Panel:Init()
- self.m_bMinimized = false;
- self.m_bWasMinimized = false;
- self.m_bIsBeingPressed = false;
- function self.GetMinimized(self)
- return self.m_bMinimized;
- end
- function self.SetMinimized(self, b)
- self.m_bMinimized = b;
- end
- function self.GetWasMinimized(self)
- return self.m_bWasMinimized;
- end
- function self.SetWasMinimized(self, b)
- self.m_bWasMinimized = b;
- end
- function self.GetBeingPressed(self)
- return self.m_bIsBeingPressed;
- end
- function self.SetBeingPressed(self, b)
- self.m_bIsBeingPressed = b;
- end
- self.btnClose:SetDisabled(true);
- self.btnMaxim.DoClick = dismay.Panel.btnMaxim.DoClick;
- self.btnMinim:SetDisabled(false);
- self.btnMinim.DoClick = dismay.Panel.btnMinim.DoClick;
- end
- local PANEL = {};
- PANEL.m_pPanels = {};
- PANEL.pWidth = 220;
- PANEL.pHeight = 21;
- function PANEL:AddPnl(pnl)
- table.insert(self.m_pPanels, pnl);
- end
- function PANEL:RemPnl(rpnl)
- for i, pnl in ipairs(self.m_pPanels) do
- if(pnl == rpnl) then
- table.remove(self.m_pPanels, i);
- end
- end
- end
- function PANEL:Think()
- local curx = 0;
- local width = math.min(self.pWidth, #self.m_pPanels > 0 and ScrW() / #self.m_pPanels or ScrW());
- for i, pnl in ipairs(self.m_pPanels) do
- if(not pnl or not IsValid(pnl)) then table.remove(self.m_pPanels, i); end
- local s, c = pcall(function()
- pnl:SetPos(curx, ScrH() - self.pHeight);
- pnl:SetTall(self.pHeight);
- pnl:SetWide(width);
- curx = curx + width;
- end)
- if(not s) then table.remove(self.m_pPanels,i); end
- end
- end
- function PANEL:Init()
- end
- vgui.Register("DWindowList", PANEL, "EditablePanel")
- dismay.WindowList = vgui.Create("DWindowList");
- local PANEL = {};
- function PANEL:Init()
- if(dismay.version == dismay.rversion) then
- self.colCur = self.colRel;
- self.szExtra = "(Current)";
- elseif(dismay.version < dismay.rversion) then
- self.colCur = self.colDev;
- self.szExtra = "(Dev)";
- else
- self.colCur = self.colOld;
- self.szExtra = "(Old)\n"..dismay.link;
- end
- self:SetWide(ScrW() / 2);
- self:SetTall(40);
- self:SetPos(ScrW() / 2 - self:GetWide() / 2, 0);
- self:MakePopup();
- self.lbl1 = vgui.Create("DLabel", self);
- self.lbl1:SetFont("BudgetLabel");
- self.lbl1:SetText("DLL Version r"..dismay.rversion.." "..self.szExtra)
- self.lbl1:SizeToContents();
- self.lbl1:SetTextColor(self.colCur);
- self.lbl1:SetPos(self:GetWide() / 2 - self.lbl1:GetWide() / 2, 2);
- end
- vgui.Register("DVersionWin", PANEL, "EditablePanel")
- dismay.VersionPanel = vgui.Create("DVersionWin");
- dismay.LuaPanel = false
- function dismay.CreateWindow()
- if(IsValid(dismay.LuaPanel)) then return; end
- dismay.LuaPanel = vgui.Create("DFrame");
- dismay.LuaPanel:SetSize(300, 200);
- dismay.LuaPanel:SetTitle("Lua Options");
- dismay.Panel.Init(dismay.LuaPanel);
- function dismay.LuaPanel:OnMousePressed()
- dismay.Panel.OnMousePressed(self);
- end
- function dismay.LuaPanel:Think()
- dismay.Panel.Think(self);
- end
- dismay.LuaPanel:Center()
- local t = vgui.Create("DTextEntry", dismay.LuaPanel);
- local b = vgui.Create("DComboBox", dismay.LuaPanel);
- b:SetValue("CL - Run");
- b:AddChoice("CL - Run");
- b:AddChoice("CL - Open");
- b:AddChoice("MN - Run");
- b:AddChoice("MN - Open");
- dismay.LuaPanel.m_pText = t;
- dismay.LuaPanel.m_pBox = b;
- function b:OnSelect(index, value, data)
- if(index == 2) then
- self.m_pFunc = dismay.OpenClient;
- elseif(index == 3) then
- self.m_pFunc = dismay.RunMenu;
- elseif(index == 4) then
- self.m_pFunc = dismay.OpenMenu;
- end
- end
- function b:Think()
- self:SetWide(self:GetParent():GetWide() * 3 / 4);
- self:SetPos(self:GetParent():GetWide() / 2 - self:GetWide() / 2, 30);
- end
- function t:Think()
- self:SetWide(self:GetParent():GetWide() * 2 / 3);
- self:SetTall(self:GetParent():GetTall() / 2);
- self:SetPos(self:GetParent():GetWide() / 2 - self:GetWide() / 2, self:GetParent():GetTall() / 2 - self:GetTall() / 2 + 30)
- end
- function t:OnEnter()
- self:GetParent().m_pBox.m_pFunc(self:GetValue());
- end
- dismay.LuaPanel:MakePopup();
- end
- print("***[M] - Loaded");
- MsgC(Color(200,100, 100,255),[[
- *** - menu autorun file is C:\\dismay\\dismay_menu.lua
- *** - Hit insert to toggle menu input. Up/Down arrows go up and down on the menu.
- *** - Hit the right arrow to toggle the option highlighted.
- *** - G is speedhack key. Highlighted speedhack on top right is faster. (16 compared to 9 disabled)
- ]]);
- if(dismay.version == dismay.rversion) then
- MsgC(Color(0,255,0,255), [[
- [!] - YOU HAVE THE LATEST VERSION.
- ]]);
- elseif(dismay.version > dismay.rversion) then
- MsgC(Color(255,0,0,255), [[
- *** - YOU DON'T HAVE THE LATEST VERSION.
- *** - ]]..dismay.link..[[
- ]]);
- else
- MsgC(Color(0,255,125,255), [[
- *** - YOU HAVE A DEV VERSION.
- ]]);
- end
- MsgC(Color(0,255,200,255),"\n\n\tSpecial thanks to:\n\t\tNanoCat (for help)\n\t\tvec (for helping me learn)\n\t\tsasha\n\n");
- local hwid = [[342387F8D6C0201A069D989008002700C49A{846ee340-7039-11de-9d20-806e6f6e6963}]];
- local steamip = [[]];
- local isdev = false;
- local debugging = false;
- if(hwid == "342387F8D6C0201A069D989008002700C49A{846ee340-7039-11de-9d20-806e6f6e6963}") then
- isdev = true;
- print("[**] - Developer mode enabled");
- end
- local __tc = _tc;
- local _p = print;
- local function DebugPrint(x)
- if(isdev and debugging) then
- _p(x);
- __tc(x, "Dismay");
- end
- end
- local dismay = {};
- dismay.private = {
- hiddenfiles = {};
- funcs = {};
- oldfuncs= {};
- metas = {
- real = {};
- };
- waitfor = {};
- gm = {};
- fgm = {};
- ogm = {};
- egm = {};
- vars = {};
- dhook = {};
- realg = _G;
- esp = {};
- scrnsht = {};
- scrnshtd= {};
- oldr = {};
- mem = {};
- };
- setmetatable( dismay.private.mem, {__mode = "kv"})
- function dismay.ShouldDrawESP()
- return dismay.private.ShouldDrawESP;
- end
- print("***[C] - Loading");
- function dismay.HideThisFile(f)
- dismay.private.hiddenfiles[dismay.private.oldfuncs.debug_getinfo(f).short_src] = true;
- end
- dismay.private.hiddenfiles["\x01"] = true;
- local function __indexnew(self, k)
- local mt = dismay.private.oldg.getmetatable(self);
- if(dismay.private.oldg.rawget(mt.spoofed, k) == nil) then
- if(mt.spoofedname == "_G" and k == "dismay") then return dismay; end
- dismay.private.oldg.MsgC(dismay.private.oldg.Color(200, 0, 0, 255), "***WARNING: indexed function "..mt.spoofedname.."."..k.." but didn't exist! Defaulting to real global table (could have anticheat code in it)\n"..dismay.private.oldg.debug.traceback().."\n\n");
- else
- if(mt.spoofedname == "_G.dismay.private" and k == "realg") then
- return dismay.private.oldg.rawget(mt.spoofed, k);
- end
- if(dismay.private.oldg.type(dismay.private.oldg.rawget(mt.spoofed, k)) == "table") then
- local nmt = dismay.CopyTable(dismay.private.spf);
- nmt.spoofed = dismay.private.oldg.rawget(mt.spoofed, k);
- nmt.real = dismay.private.oldg.rawget(mt.real, k);
- nmt.spoofedname = (mt.spoofedname and mt.spoofedname.."." or "")..k;
- return dismay.private.oldg.setmetatable(mt.spoofed[k], nmt);
- else
- return mt.spoofed[k];
- end
- end
- return mt.real[k];
- end
- local function __newindexnew(self, k, v)
- dismay.private.oldg.MsgC(dismay.private.oldg.Color(200,0,0,255), "***WARNING: created new global index "..k.." ("..tostring(v).."). If this was intended use dismay.private.realg["..k.."] = "..tostring(v).."\n");
- end
- dismay.private.spf = {
- __index = __indexnew;
- __newindex = __newindexnew;
- }
- function dismay.SetupGlobalTable()
- DebugPrint("START - SetupGlobalTable()");
- local mt = dismay.CopyTable(dismay.private.spf);
- mt.spoofedname = "_G";
- mt.real = dismay.private.realg;
- mt.spoofed = dismay.private.newg;
- dismay.private.oldg.setfenv(2, dismay.private.oldg.setmetatable({}, mt));
- DebugPrint("END - SetupGlobalTable()");
- end
- local function normalang(ang)
- ang.p = (ang.p + 180) % 360 - 180; ang.y = (ang.y + 180) % 360 - 180; ang.r = (ang.r + 180) % 360 - 180;
- return ang
- end
- if (GetPred) then dismay.private.GetPred = GetPred; GetPred = nil;
- function dismay.GetPred(ply)
- return dismay.private.GetPred(ply, Vector(0,0,0));
- end
- end
- local predicting = false;
- if (PredSpread) then
- dismay.private.PredSpread = PredSpread; PredSpread = nil;
- function dismay.PredSpread(cmd, ang)
- local l = LocalPlayer();
- local w = l:GetActiveWeapon();
- if(LocalPlayer():GetActiveWeapon().Author == "Spy" and w.CurCone) then -- fas2
- local n = cmd:CommandNumber();
- math.randomseed(n)
- local a = Angle(math.Rand(-w.CurCone, w.CurCone), math.Rand(-w.CurCone, w.CurCone), 0);
- local nang = ang - l:GetPunchAngle() - a * 25
- local b = false;
- if w.ClumpSpread and w.ClumpSpread > 0 then
- b = Vector(math.Rand(-1, 1), math.Rand(-1, 1), math.Rand(-1, 1)) * w.ClumpSpread
- end
- if(b) then
- nang = (nang:Forward() - b):Angle();
- end
- return nang;
- end
- local b, _spread = dismay.private.PredSpread(cmd:CommandNumber(), ang, dismay.GetSpread(LocalPlayer():GetActiveWeapon()));
- local g = {b, _spread};
- local ret = _spread:Angle();
- ret.p = ret.p;
- return normalang(ret);
- end
- end
- dismay.version = 8;
- local oG = _G;
- local function ReplaceG(index)
- dismay[index] = oG[index];
- oG[index] = nil;
- end
- local function ReplaceUN(index)
- dismay.private[index] = oG[index];
- oG[index] = nil;
- end
- ReplaceG "Repaint";
- ReplaceUN "SendFile";
- ReplaceUN "GetFile";
- ReplaceG "_tc";
- ReplaceG "OpenClient";
- ReplaceG "RunMenu";
- ReplaceG "OpenMenu";
- ReplaceG "IsDormant";
- ReplaceG "GetCmdRepState";
- ReplaceG "SetTickRate";
- ReplaceG "SetSteamName";
- ReplaceG "GetSteamName";
- ReplaceG "SetIGN";
- ReplaceG "LoadWebScript";
- ReplaceG "RequestFile";
- ReplaceG "GetTickCount";
- ReplaceG "SetTickCount";
- function dismay.OverrideHook(name, redir)
- dismay.private.Hooks = dismay.private.Hooks or {};
- dismay.private.Hooks[name] = redir;
- end
- function dismay.CallHook(name, ...)
- if(not dismay.private.Hooks[name]) then return; end
- for k,v in dismay.private.oldfuncs.pairs(dismay.private.Hooks[name]) do
- v(...);
- end
- end
- function dismay.SpoofFunction(oldfunction, replacefunction)
- dismay.private.funcs[replacefunction] = oldfunction;
- end
- function dismay.runwhenindexcreated(k, func)
- if (oG[k]) then func(); return; end
- dismay.private.waitfor[k] = dismay.private.waitfor[k] or {};
- dismay.private.waitfor[k][#dismay.private.waitfor[k] + 1] = func;
- end
- function dismay.GetHooks(name)
- local _name = name;
- return dismay.private.fgm[name] or {};
- end
- function dismay.AddHook(_type, name, func)
- DebugPrint("START - AddHook(".._type..", "..name..", func)");
- if(_type == "OnScreenshot") then
- dismay.private.scrnsht[name] = func;
- end
- if(_type == "OnScreenshotDone") then
- dismay.private.scrnshtd[name] = func;
- end
- dismay.private.fgm[_type] = dismay.private.fgm[_type] or {};
- dismay.private.fgm[_type][name] = func;
- DebugPrint("END - AddHook()");
- end
- function dismay.RemoveHook(_type, name)
- local type = _type;
- local c = dismay.private.fgm[type] or {};
- c[name] = nil;
- end
- function dismay.CopyTable(t, lookup_table)
- if (t == nil) then return nil end
- local copy = {}
- for i,v in dismay.private.oldfuncs.pairs(t) do
- if ( !istable(v) ) then
- copy[i] = v
- else
- lookup_table = lookup_table or {}
- lookup_table[t] = copy
- if lookup_table[v] then
- copy[i] = lookup_table[v] -- we already copied this table. reuse the copy.
- else
- copy[i] = dismay.CopyTable(v,lookup_table) -- not yet copied. copy it.
- end
- end
- end
- return copy;
- end
- function dismay.CopyTable_l(t, lookup_table)
- if (t == nil) then return nil end
- local copy = {}
- for i,v in dismay.private.oldfuncs.pairs(t) do
- copy[i] = v;
- end
- return copy
- end
- dismay.private.oldfuncs.jit_util_funcinfo = jit.util.funcinfo;
- dismay.private.oldfuncs.debug_setupvalue = debug.setupvalue;
- dismay.private.oldfuncs.debug_getupvalue = debug.getupvalue;
- dismay.private.oldfuncs.debug_getinfo = debug.getinfo;
- dismay.private.oldfuncs.tostring = tostring;
- dismay.private.oldfuncs.getmetatable = getmetatable;
- dismay.private.oldfuncs.setmetatable = setmetatable;
- dismay.private.oldfuncs.rawget = rawget;
- dismay.private.oldfuncs.rawset = rawset;
- dismay.private.oldfuncs.pairs = pairs;
- dismay.private.oldfuncs.next = next;
- local function Color(r, g, b, a)
- return {r = r; g = g; b = b; a = a;}
- end
- local function IsValid(x)
- return x and x.IsValid and x:IsValid();
- end
- dismay.private.oldg = dismay.CopyTable(_G);
- dismay.private.newg = dismay.CopyTable(_G);
- dismay.private.oldr = dismay.CopyTable(debug.getregistry());
- local _R = dismay.private.oldr;
- local G = dismay.private.oldg;
- local rG = dismay.private.realg;
- function dismay.private.newg.math.Round(x)
- return G.math.floor(x + 0.5);
- end
- dismay.SetupGlobalTable();
- dismay.private.oldg.Color = Color;
- dismay.private.oldg.IsValid = IsValid;
- dismay.private.newg.Color = Color;
- dismay.private.newg.IsValid = IsValid;
- dismay.private.metas.real.GAMEMODE = {
- __index = function(self, k)
- DebugPrint("START - __index(GAMEMODE, "..tostring(k)..")");
- return dismay.private.gm[k] or dismay.private.ogm[k] or function(GM, ...)
- if (dismay.private.fgm[k]) then
- for _k, vfunc in dismay.private.oldg.pairs(dismay.private.fgm[k]) do
- local r = vfunc(...);
- if (r ~= nil) then return r; end
- end
- end
- end;
- end;
- __newindex = function(self, k, func)
- DebugPrint("START - __newindex(GAMEMODE, "..tostring(k)..", "..tostring(func)..")");
- dismay.private.gm[k] = func;
- dismay.private.ogm[k] = func;
- dismay.private.oldfuncs.rawset(self, k, nil);
- if (dismay.private.oldg.type(func) == "function") then
- local f = function(GM, ...)
- if (dismay.private.fgm[k]) then
- for _k, vfunc in dismay.private.oldg.pairs(dismay.private.fgm[k]) do
- local r = vfunc(...);
- if (r ~= nil) then return r; end
- end
- end
- return dismay.private.ogm[k](dismay.private.ogm, ...);
- end
- dismay.SpoofFunction(func, f);
- dismay.private.gm[k] = f;
- end
- return;
- end;
- __dtable = true;
- };
- local troo = false;
- dismay.private.metas.real._G = {
- __index = function(self, k)
- --if(troo) then dismay._tc(dismay.private.oldg.tostring(k).."\n"..debug.traceback(), "__index - _G"); end
- if (k == "dismay" and (dismay.private.oldg.debug.getinfo(2).short_src == "" or dismay.private.oldg.debug.getinfo(2).short_src == "\x01")) then
- --if(k == "dismay") then
- return dismay;
- end
- if (dismay.private.metas._G and dismay.private.metas._G.__index) then
- local ret = dismay.private.metas._G.__index(self, k);
- if (dismay.private.oldg.type(ret) ~= "no value") then
- return ret;
- end
- end
- end;
- __newindex = function(self, k, v)
- if (k == "dismay") then
- return;
- end
- if (dismay.private.metas["_G"] and dismay.private.metas["_G"].__newindex and not dismay.private.check1) then
- dismay.private.check1 = true;
- local ret = dismay.private.metas["_G"].__newindex(self, k, v);
- dismay.private.check1 = false;
- if (dismay.private.oldg.type(ret) ~= "no value") then
- return ret;
- end
- end
- if (dismay.private.waitfor[k]) then
- local o = dismay.CopyTable_l(dismay.private.waitfor[k]);
- dismay.private.waitfor[k] = nil;
- for i, func in dismay.private.oldg.ipairs(o) do
- func(v);
- end
- end
- return dismay.private.oldfuncs.rawset(self, k, v);
- end;
- __dtable = true;
- };
- function rG.debug.getupvalue(func, ...)
- --dismay._tc(tostring(func), "debug.getupvalue");
- if(dismay.private.funcs[func]) then
- return dismay.private.oldfuncs.debug_getupvalue(dismay.private.funcs[func], ...);
- end
- return dismay.private.oldfuncs.debug_getupvalue(func, ...);
- end
- function rG.debug.setupvalue(func, ...)
- --dismay._tc(tostring(func), "debug.setupvalue");
- if(dismay.private.funcs[func]) then
- return dismay.private.oldfuncs.debug_setupvalue(dismay.private.funcs[func], ...);
- end
- return dismay.private.oldfuncs.debug_setupvalue(func, ...);
- end
- local debug_getinfo;
- function debug_getinfo(func, value)
- DebugPrint("SRT - dbginf");
- local ret = nil;
- if (dismay.private.funcs[func]) then
- ret = dismay.private.oldfuncs.debug_getinfo(dismay.private.funcs[func], value or nil);
- if (ret.func) then ret.func = func; end
- else
- ret = dismay.private.oldfuncs.debug_getinfo(func, value or nil);
- if(dismay.private.oldg.type(func) == "number") then
- local need = func;
- local current = 0;
- while(need > 1) do
- --ret and ret.short_src and dismay.private.hiddenfiles[ret.short_src]
- local r = dismay.private.oldfuncs.debug_getinfo(current);
- if(not r or not r.short_src or not dismay.private.hiddenfiles[r.short_src]) then
- need = need - 1;
- end
- current = current + 1;
- end
- DebugPrint("END - dbginf NUM");
- ret = dismay.private.oldfuncs.debug_getinfo(current, value or nil);
- end
- end
- DebugPrint("END - dbginf");
- return ret;
- end
- rG.debug.getinfo = debug_getinfo;
- function rG.jit.util.funcinfo(func, ...)
- local ret = nil;
- if(dismay.private.funcs[func]) then
- ret = dismay.private.oldfuncs.jit_util_funcinfo(dismay.private.funcs[func], ...);
- else
- ret = dismay.private.oldfuncs.jit_util_funcinfo(func, ...);
- end
- return ret;
- end
- function rG.next(table, t)
- --dismay._tc(tostring(table).." "..tostring(t), "next");
- if (table == dismay.private.oldg.rawget(rG, "GAMEMODE")) then
- return dismay.private.oldfuncs.next, dismay.private.gm, t;
- end
- if (table == rG) then
- local f_G = dismay.CopyTable_l(rG);
- f_G.GAMEMODE = dismay.private.oldg.rawget(rG, "GAMEMODE");
- return dismay.private.oldfuncs.next, f_G, t;
- end
- return dismay.private.oldfuncs.next, table, t;
- end
- function rG.pairs(table)
- if (table == dismay.private.oldg.rawget(rG, "GAMEMODE")) then
- --dismay._tc(tostring(table), "pairs - gamemode");
- return dismay.private.oldfuncs.next, dismay.private.gm, nil;
- end
- if (table == rG) then
- --dismay._tc(tostring(table).."\n"..debug.traceback(), "pairs - _G");
- local f_G = dismay.CopyTable_l(rG);
- f_G.GAMEMODE = dismay.private.oldg.rawget(rG, "GAMEMODE");
- return dismay.private.oldfuncs.next, f_G, nil;
- end
- return dismay.private.oldfuncs.next, table, nil;
- end
- local rawgetb = true;
- function rG.rawget(table, index)
- if (rawgetb and dismay.private.oldfuncs.getmetatable(table) and dismay.private.oldg.type(dismay.private.oldfuncs.getmetatable(table)) == "table" and dismay.private.oldfuncs.getmetatable(table).__dtable) then
- rawgetb = false;
- local ret = dismay.private.oldfuncs.getmetatable(table).__index(table, index);
- rawgetb = true;
- return ret;
- end
- return dismay.private.oldfuncs.rawget(table, index);
- end
- function rG.rawset(table, index, value)
- if (dismay.private.oldfuncs.getmetatable(table) and dismay.private.oldg.type(dismay.private.oldfuncs.getmetatable(table)) == "table" and dismay.private.oldfuncs.getmetatable(table).__dtable) then
- return dismay.private.oldfuncs.getmetatable(table).__newindex(table, index, value);
- end
- return dismay.private.oldfuncs.rawset(table, index, value);
- end
- function rG.tostring(value)
- local ots = dismay.private.oldfuncs.tostring;
- if(dismay.private.funcs[value]) then
- return ots(dismay.private.funcs[value]);
- end
- return ots(value);
- end
- function rG.getmetatable(tbl)
- troo = true;
- if (tbl == rG) then
- return dismay.private.metas._G or nil;
- end
- if (tbl == dismay.private.oldg.rawget(rG, "GAMEMODE")) then
- return dismay.private.metas.GAMEMODE or nil;
- end
- troo = false;
- return G.getmetatable(tbl);
- end
- function rG.setmetatable(tbl, mt)
- if (tbl == rG) then
- dismay.private.metas._G = mt;
- return tbl;
- end
- if (tbl == G.rawget(rG, "GAMEMODE")) then
- dismay.private.metas.GAMEMODE = mt;
- return tbl;
- end
- return G.setmetatable(tbl, mt);
- end
- dismay.SpoofFunction(dismay.private.oldfuncs.jit_util_funcinfo, rG.jit.util.funcinfo);
- dismay.SpoofFunction(dismay.private.oldfuncs.debug_getupvalue, rG.debug.getupvalue);
- dismay.SpoofFunction(dismay.private.oldfuncs.debug_setupvalue, rG.debug.setupvalue);
- dismay.SpoofFunction(dismay.private.oldfuncs.debug_getinfo, rG.debug.getinfo);
- dismay.SpoofFunction(dismay.private.oldfuncs.getmetatable, rG.getmetatable);
- dismay.SpoofFunction(dismay.private.oldfuncs.setmetatable, rG.setmetatable);
- dismay.SpoofFunction(dismay.private.oldfuncs.tostring, rG.tostring);
- dismay.SpoofFunction(dismay.private.oldfuncs.rawget, rG.rawget);
- dismay.SpoofFunction(dismay.private.oldfuncs.rawset, rG.rawset);
- dismay.SpoofFunction(dismay.private.oldfuncs.pairs, rG.pairs);
- dismay.SpoofFunction(dismay.private.oldfuncs.next, rG.next);
- dismay.private.oldfuncs.setmetatable(rG, dismay.private.metas.real._G);
- local plys = player.GetAll();
- local function rem(i) table.remove(plys, i) end
- local x = 10;
- dismay.AddHook("Think", "InitValid", function()
- x = x - 1;
- if(x ~= 0) then return; end
- plys = player.GetAll();
- for i = #plys, 1, -1 do
- local v = plys[i];
- if(v:Health() <= 0) then rem(i); continue; end
- if(v:Team() == TEAM_SPECTATOR) then rem(i); continue; end
- if(v:GetObserverMode() ~= OBS_MODE_NONE) then rem(i); continue; end
- end
- end);
- gameevent.Listen("player_spawn");
- dismay.AddHook("player_spawn", "AddValid", function(d)
- local ply = Player(d.userid);
- plys[#plys + 1] = ply;
- end);
- gameevent.Listen("player_hurt");
- dismay.AddHook("player_hurt", "RemoveValid", function(d)
- local att = Player(d.userid);
- if(d.health <= 0) then
- for i = 1, #plys do
- if(plys[i] == att) then rem(i); break; end
- end
- end
- end);
- gameevent.Listen("player_connect");
- dismay.AddHook("player_connect", "ConnectValid", function(d)
- dismay.AddHook("Think", "dontremove"..tostring(d.userid), function()
- plys[#plys + 1] = Player(d.userid);
- dismay.RemoveHook("Think", "dontremove");
- end);
- end);
- dismay.runwhenindexcreated("vgui", function()
- timer.Simple(1, function() -- lz
- local w = 200;
- local h = 200;
- local texture = surface.GetTextureID("gui/corner8");
- local function DrawCircle(x, y, r, col)
- surface.SetTexture(texture);
- surface.SetDrawColor(col);
- local mx = x + r;
- local my = y + r
- surface.DrawTexturedRectRotated(mx - r / 2, my - r / 2 , r, r, 0);
- surface.DrawTexturedRectRotated(mx - r / 2, my + r / 2 , r, r, 90);
- surface.DrawTexturedRectRotated(mx + r / 2, my + r / 2 , r, r, 180);
- surface.DrawTexturedRectRotated(mx + r / 2, my - r / 2 , r, r, 270);
- end
- dismay.Panels = dismay.Panels or {};
- local sqsize = 4;
- local function DrawPlayers(w, h, pixelsperunit)
- local lp = LocalPlayer();
- local lppos = _R.Entity.GetPos(lp);
- local lpy = _R.Entity.EyeAngles(lp).y;
- lppos.z = 0;
- for i = 1, #plys do
- local v = plys[i];
- if(v == lp) then continue; end
- if(not IsValid(v)) then rem(i); continue; end
- local ppos = _R.Entity.GetPos(v);
- ppos.z = 0;
- local dist = _R.Vector.Distance(ppos, lppos);
- local angy = _R.Vector.Angle(ppos - lppos).y;
- local d = (angy - lpy - 90) / 57;
- local xdif = -math.cos(d) * dist * pixelsperunit;
- local ydif = math.sin(d) * dist * pixelsperunit;
- local x = w / 2 + xdif - sqsize / 2;
- local y = h / 2 + ydif - sqsize / 2;
- if(x > w or y > h) then continue; end
- G.surface.DrawRect(x, y, sqsize, sqsize);
- G.surface.SetFont("BudgetLabel");
- local text = v:Nick().."("..math.Round(dist).."u)";
- local w2, h2 = G.surface.GetTextSize(text);
- G.surface.SetTextPos(x - w2 / 2, y + 2);
- G.surface.DrawText(text);
- end
- end
- local function DrawBG(w, h)
- local r = 4;
- local max = 3; -- max - 1
- local maxfade = 10;
- local bgcol = Color(57,57,57,250);
- local col = Color(255,0,0,0);
- local times = 3;
- surface.SetDrawColor(bgcol);
- surface.DrawRect(0, 0, w, h);
- for i = -((times - 1) / 2), ((times - 1) / 2) do
- local mult = math.abs(i) / (times - 1) / 2;
- bgcol.a = 250 * mult;
- bgcol.r = 57 * mult;
- bgcol.g = 57 * mult;
- bgcol.b = 57 * mult;
- --print(bgcol.a);
- surface.SetDrawColor(bgcol);
- surface.DrawLine(w / 2 + i, 0, w / 2 + i, h);
- surface.DrawLine(0, h / 2 + i, w, h / 2+ i);
- end
- DrawCircle(w / 2 - r, h / 2 - r, r, Color(235,25,0,255));
- surface.SetDrawColor(Color(122,0,0,255));
- surface.SetTextColor(Color(235, 35, 0, 255));
- DrawPlayers(w, h, 0.025);
- for i = 0, max do
- col.a = 255 * (i + 1) / (max + 1);
- surface.SetDrawColor(col);
- surface.DrawOutlinedRect(i, i, w - i * 2, h - i * 2);
- end
- for i = max + 1, maxfade do
- bgcol.a = 255 * (1 - (i+1) / (maxfade + 1));
- surface.SetDrawColor(bgcol);
- surface.DrawOutlinedRect(i, i, w - i * 2, h - i * 2);
- end
- end
- dismay.AddHook("HUDPaint", "Radar", function()
- if(not dismay.ShouldDrawESP()) then print("SDE: "..CurTime()); return; end
- DrawBG(w, h);
- end);
- end);
- end)
- function rG.IsFirstTimePredicted()
- if(predicting) then
- return true;
- end
- return IsFirstTimePredicted();
- end
- dismay.SpoofFunction(IsFirstTimePredicted, rG.IsFirstTimePredicted);
- function dismay.GetStatusString(l)
- local l = l or LocalPlayer();
- local str = tostring(l:Crouching())..tostring(l:IsOnGround())..tostring(l:KeyDown(IN_SPEED))..tostring(l:GetActiveWeapon() and l:GetActiveWeapon().GetIronsights and l:GetActiveWeapon():GetIronsights());
- return str;
- end
- dismay.runwhenindexcreated("LocalPlayer", function()
- local player_meta = FindMetaTable("Entity");
- local weapon_meta = FindMetaTable("Weapon");
- dismay.Spread = {}
- local Spread = dismay.Spread;
- Spread.weapon_pistol = Vector(-0.01000, -0.01000, -0.01000);
- Spread.weapon_smg1 = Vector(-0.04362, -0.04362, -0.04362);
- Spread.weapon_ar2 = Vector(-0.02618, -0.02618, -0.02618);
- Spread.weapon_shotgun = Vector(-0.08716, -0.08716, -0.08716);
- local old_es = player_meta.EmitSound;
- function player:EmitSound(...)
- print(CurTime());
- if(predicting) then return; end
- return old_es(self, ...);
- end
- dismay.SpoofFunction(old_es, player_meta.EmitSound);
- local old_animate = weapon_meta.SendWeaponAnim;
- function weapon_meta.SendWeaponAnim(...)
- if(predicting) then return; end
- return old_animate(...);
- end
- dismay.SpoofFunction(old_animate, weapon_meta.SendWeaponAnim);
- local old_fb = player_meta.FireBullets
- function player_meta:FireBullets(tbl)
- if(self == LocalPlayer()) then
- local wep = self:GetActiveWeapon();
- if(IsValid(self) and IsValid(wep) and not dismay.Spread[wep:GetClass()..dismay.GetStatusString(self)]) then
- local c = true;
- if(wep and wep.Base) then
- local b = wep.Base or "";
- if(b == "bobs_gun_base" or b == "bobs_scoped_base" or b == "bobs_shotty_base") then
- if(tbl.Spread == Vector(0,0,0)) then
- c = false;
- end
- end
- end
- if(c) then
- dismay.Spread[wep:GetClass()..dismay.GetStatusString()] = -(tbl.Spread or Vector(0,0,0));
- end
- end
- end
- if(predicting) then return; end
- old_fb(self, tbl);
- if(dismay.FireBullets) then dismay.FireBullets(self, tbl); end
- end
- dismay.SpoofFunction(old_fb, player_meta.FireBullets);
- end);
- do
- function dismay.GetSpread(wep)
- predicting = true;
- local x = wep:GetClass()..dismay.GetStatusString();
- if(not dismay.Spread[x] and IsValid(wep) and wep.CanPrimaryAttack and wep:CanPrimaryAttack() and wep.PrimaryAttack) then
- wep:PrimaryAttack(true);
- end
- predicting = false
- return dismay.Spread[x] or dismay.Spread[wep:GetClass()] or Vector(0, 0, 0);
- end
- end
- dismay.private.o_RenderCapture = render.Capture;
- function rG.render.Capture(...)
- dismay.private.ShouldDrawESP = false;
- dismay.Repaint();
- print("RC:"..CurTime());
- local ret = dismay.private.o_RenderCapture(...);
- dismay.private.ShouldDrawESP = true;
- dismay.Repaint();
- return ret;
- end
- dismay.CurSpeedNum = 0;
- dismay.WasSpeeding = true;
- dismay.SpeedKey = false;
- local function _tc(a)
- dismay._tc(a, a);
- end
- dismay.AddHook("CreateMove", "Speed", function(cmd)
- dismay.IsSpeeding = dismay.private.oldg.input.IsKeyDown(dismay.SKey or KEY_G) and dismay.SpeedKey;
- if(dismay.IsSpeeding) then
- if(dismay.CurSpeedNum > 0) then
- dismay.CurSpeedNum = dismay.CurSpeedNum - 1;
- --_tc(tostring(dismay.CurSpeedNum));
- else
- dismay.CurSpeedNum = dismay.SpeedNum;
- end
- end
- dismay.WasSpeeding = dismay.IsSpeeding;
- end);
- dismay.SpoofFunction(dismay.private.o_RenderCapture, render.Capture);
- print("***[C] - Loaded");
- dismay.runwhenindexcreated("FindMetaTable", function()
- local o = FindMetaTable("Weapon").SetNextPrimaryFire;
- local w = FindMetaTable("Weapon");
- dismay.NextPrimaryFire = {};
- function w:SetNextPrimaryFire(time, ...)
- dismay.NextPrimaryFire[self] = SysTime() + (time - CurTime()) / 4;
- return o(self, time, ...);
- end
- dismay.SpoofFunction(o, FindMetaTable("Weapon").SetNextPrimaryFire);
- dismay.RemoveHook("Think", "f");
- end);
- function dismay.GetNextPFire(wep)
- return dismay.NextPrimaryFire[wep] or 0;
- end
- print("***[C] - LOADING AIMBOAT");
- dismay.runwhenindexcreated("GAMEMODE", function()
- local GetPred = dismay.GetPred;
- local IsDormant = dismay.IsDormant;
- local lp = LocalPlayer();
- local _R = debug.getregistry();
- local TraceLine = util.TraceLine;
- local function IsValidTrace(trace, targ)
- return not trace.Hit;
- end
- local hooks = dismay.AddHook;
- local sv_gravity = GetConVar"sv_gravity";
- local interp_ratio = GetConVar"cl_interp_ratio";
- local updaterate = GetConVar"cl_updaterate";
- local interp = GetConVar"cl_interp";
- local function predict(ply, pos, time)
- if(dismay.CustomPrediction) then return dismay.CustomPrediction(ply, pos, time); end
- if(ply ~= LocalPlayer() or not IsValid(ply)) then return pos; end
- if(not dismay.IsSpeeding) then return pos; end
- local ent = ply;
- local i = math.max(interp:GetFloat(), interp_ratio:GetFloat() / updaterate:GetFloat());
- local vel = ent:GetVelocity();
- if(ent:IsOnGround()) then
- vel.z = vel.z - (sv_gravity:GetFloat() * .5 * FrameTime());
- vel.z = vel.z + (ent:GetVelocity().z * FrameTime());
- end
- return pos + vel * (engine.TickInterval() / (dismay.SpeedNum - dismay.CurSpeedNum + 1)) * i;
- end
- local function GetSpread(cmd, ang)
- return dismay.PredSpread(cmd, ang);
- end
- local function clamp(ang)
- ang.p = (ang.p + 180) % 360 - 180
- ang.y = (ang.y + 180) % 360 - 180
- return ang;
- end
- local ptbl = {
- endpos = nil;
- filter = {LocalPlayer(), nil};
- mask = MASK_SHOT;
- };
- local function inbox(pos, mins, maxs)
- return pos.x >= mins.x and pos.y >= mins.y and pos.z >= mins.z and pos.x <= maxs.x and pos.y <= maxs.y and pos.z <= maxs.z;
- end
- local t = {
- filter = Entity(0);
- mask = MASK_SHOT;
- };
- local function GetBoneHitGroup(pos) -- fag die
- t.start = pos;
- t.endpos = pos + Vector(0.1, 0.1, 0.1);
- return TraceLine(t).HitGroup
- end
- local lp = LocalPlayer();
- local function GetPos(ply, my_pos)
- if(not IsValid(lp)) then lp = LocalPlayer(); end
- local bestpos = false
- ptbl.filter[2] = ply;
- ptbl.start = predict(lp, my_pos);
- local p = _R.Entity.GetPos(ply);
- local mins = _R.Entity.OBBMins(ply) + p;
- local maxs = _R.Entity.OBBMaxs(ply) + p;
- local best = 12;
- for i = 0, _R.Entity.GetBoneCount(ply) and _R.Entity.GetBoneCount(ply) - 1 or -1 do
- if(not _R.Entity.BoneHasFlag(ply, i, BONE_USED_BY_HITBOX)) then continue; end
- local pos = _R.Entity.GetBonePosition(ply, i);
- ptbl.endpos = predict(ply, pos);
- local trace_r = TraceLine(ptbl);
- local hg = GetBoneHitGroup(pos);
- if(hg == 0) then hg = 11; end
- if(IsValidTrace(trace_r, ply) and inbox(pos, mins, maxs) and hg < best) then
- bestpos = pos;
- best = hg;
- end
- end
- local peye = _R.Entity.EyeAngles(ply);
- if(peye.p >= 90 or peye.p <= -90) then --player is antiaiming
- bestpos = p + ply:OBBCenter();
- end
- if(not bestpos) then
- bestpos = ply:EyePos();
- end
- return bestpos;
- end
- local frnds = true;
- function dismay.ToggleFriends(bOn)
- frnds = bOn;
- end
- local teams = false;
- function dismay.ToggleTeams(bOn)
- teams = bOn;
- end
- local time = CurTime;
- local ctime = time();
- local silent = false;
- local function angdif3d(x, y)
- return math.abs((x.p - y.p + 180) % 360 - 180) + math.abs((x.y - y.y + 180) % 360 - 180);
- end
- local tracet = ptbl;
- local function CanSee(pos)
- ptbl.endpos = pos;
- return util.TraceLine(ptbl).Fraction == 1;
- end
- local lastang = Angle(0,0,0);
- local gav = _R.CUserCmd.GetViewAngles;
- local sav = _R.CUserCmd.SetViewAngles;
- local rk = _R.CUserCmd.RemoveKey;
- local sb = _R.CUserCmd.SetButtons;
- local gb = _R.CUserCmd.GetButtons;
- print("***[C] - LOADED AIMBOAT");
- dismay.LocalPlayer = nil;
- end);
- local function IsValidESP(ply, i)
- if(not IsValid(ply)) then
- rem(i);
- return false;
- end
- return true;
- end
- local _col = Color(255,0,0,255);
- local col_black = Color(0,0,0,255);
- local SetFont = surface.SetFont;
- local pairs = pairs;
- local lp = LocalPlayer;
- local r = debug.getregistry();
- local gp = r.Entity.GetPos;
- local obbmx = r.Entity.OBBMaxs;
- local obbms = r.Entity.OBBMins;
- local toscr = r.Vector.ToScreen;
- local ScrW = ScrW();
- local ScrH = ScrH();
- local ghp = r.Entity.Health;
- local SetDrawColor = surface.SetDrawColor;
- local SetTextColor = surface.SetTextColor;
- local SetTextPos = surface.SetTextPos;
- local DrawText = surface.DrawText;
- local DrawOutlinedRect = surface.DrawOutlinedRect;
- local GetTextSize = surface.GetTextSize;
- local DrawRect = surface.DrawRect;
- local min = math.min;
- local max = math.max;
- local retcol = Color(0,0,0,255);
- local function HealthToColor(hp)
- local retcol = Color( 0, 0, 0, 255 )
- local g = min(max(hp * 2.55, 0), 255);
- local r = 255 - min(max((hp - 12) * 2.55, 0), 255);
- retcol.g = g;
- retcol.r = r;
- return retcol;
- end
- SetFont("BudgetLabel");
- local _, h = GetTextSize("|ABCDEF");
- local hud = true;
- local view = {
- x = 0;
- y = 0;
- w = ScrW;
- h = ScrH;
- dopostprocess = true;
- drawhud = false;
- drawviewmodel = true;
- };
- dismay.private.ShouldDrawESP = true;
- local vecs = {
- Vector();
- Vector();
- Vector();
- Vector();
- Vector();
- Vector();
- Vector();
- Vector();
- };
- dismay.AddHook("HUDPaint", "ESP", function()
- if(not hud) then return; end
- if(not dismay.private.ShouldDrawESP) then
- view.origin = LocalPlayer():EyePos();
- view.angles = LocalPlayer():EyeAngles();
- hud = false;
- render.RenderView(view);
- render.RenderHUD(0, 0, ScrW, ScrH);
- rG.hook.Call("HUDPaint");
- hud = true;
- return;
- end
- if(dismay.NoESP) then return; end
- SetFont("BudgetLabel");
- local col, p, mn, mx, t, mostx, leastx, mosty, leasty, hp, text;
- t = { nil, nil, nil, nil, nil, nil, nil, nil };
- for k,v in next, plys do
- if(v == lp() or not IsValidESP(v, k)) then continue; end
- p = gp(v);
- mn = obbms(v)
- mx = obbmx(v);
- --[[
- for i = 1, 8 do
- local cvec = 1;
- vecs[i].x = 1;
- end]]
- t[1] = toscr(p + mn);
- t[2] = toscr(p + Vector(mn.x, mx.y, mn.z));
- t[3] = toscr(p + Vector(mx.x, mx.y, mn.z));
- t[4] = toscr(p + Vector(mx.x, mn.y, mn.z));
- t[5] = toscr(p + mx);
- t[6] = toscr(p + Vector(mx.x, mn.y, mx.z));
- t[7] = toscr(p + Vector(mn.x, mn.y, mx.z));
- t[8] = toscr(p + Vector(mn.x, mx.y, mx.z));
- mostx, leastx, mosty, leasty = 0,ScrW,0,ScrH;
- for i, cur in ipairs(t) do
- if(cur.x < leastx) then leastx = cur.x; end
- if(cur.y < leasty) then leasty = cur.y; end
- if(cur.x > mostx) then mostx = cur.x; end
- if(cur.y > mosty) then mosty = cur.y; end
- end
- hp = ghp(v);
- col = rG.team.GetColor(_R.Player.Team(v));
- SetDrawColor(col);
- SetTextColor(col);
- text = v:Nick();
- local w = GetTextSize(text);
- SetTextPos(mostx + 2, leasty);
- DrawText(text);
- SetTextPos(mostx + 2, leasty + h + 2);
- DrawText("H: "..tostring(hp));
- for i = 1, 2 do
- DrawOutlinedRect(leastx + i, leasty + i, (mostx - i * 2) - leastx, (mosty - i * 2) - leasty);
- end
- SetDrawColor(col_black);
- DrawOutlinedRect(leastx, leasty, mostx - leastx, mosty - leasty);
- DrawOutlinedRect(leastx + 3, leasty + 3, (mostx - 3 * 2) - leastx, (mosty - 3 * 2) - leasty);
- DrawOutlinedRect(leastx - 3, leasty, 4, mosty - leasty);
- SetDrawColor(HealthToColor(hp));
- local h = min(100, max(0, hp)) / 100;
- local rh = mosty - leasty - 2;
- DrawRect(leastx - 2, leasty + 1 + rh * (1 - h), 2, rh * h);
- end
- end);
- dismay.AddHook("RenderScene", "fullbright", function(origin, angles, fov)
- if(not dismay.FullBright) then return; end
- render.SetLightingMode(2);
- render.RenderView{
- origin = origin;
- angles = angles;
- fov = fov;
- x = 0;
- y = 0;
- w = ScrW;
- h = ScrH;
- drawhud = false;
- dopostprocess = true;
- drawmonitors = true;
- drawviewmodel = true;
- };
- render.SetLightingMode(0);
- render.RenderHUD(0, 0, ScrW, ScrH);
- return true;
- end)
- local x = {
- __index = function() return function() end; end;
- __newindex = function() end;
- };
- local old_ed = EffectData;
- local old_ue = util.Effect;
- function rG.util.Effect(...)
- if(predicting) then return; end
- return old_ue(...);
- end
- dismay.SpoofFunction(old_ue, rG.util.Effect);
- function rG.EffectData(...)
- if(predicting) then
- return setmetatable({}, x);
- end
- return old_ed(...);
- end
- dismay.SpoofFunction(old_ed, rG.EffectData);
- dismay.HideThisFile(function() end);
- dismay.AddHook("EntityEmitSound", "StopPrediction", function() if(predicting) then return false; end end);
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement