Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local drawInfo = CreateClientConVar("at_info", "0", true, false)
- local drawWallhack = CreateClientConVar("at_wallhack", "0", true, false)
- local propShow = CreateClientConVar("at_props", "0", true, false)
- local propClass = CreateClientConVar("at_props_class", "prop_physics", true, false)
- local propDist = CreateClientConVar("at_props_dist", "1024", true, false)
- local lp = LocalPlayer()
- local er = {}
- hook.Add("PostDrawOpaqueRenderables", "Tools", function ()
- local tr = lp:GetEyeTrace()
- if not tr.Hit or tr.HitWorld then return end
- local e = tr.Entity
- if drawInfo:GetBool() then
- if drawInfo:GetInt() == 1 then
- local ang = tr.HitNormal:Angle()
- ang:RotateAroundAxis(ang:Forward(), 90)
- ang:RotateAroundAxis(ang:Right(), -90)
- cam.Start3D2D(tr.HitPos + tr.HitNormal*10, ang, 0.2)
- surface.SetDrawColor(0, 0, 0, 220)
- surface.SetFont("ChatFont")
- local size = surface.GetTextSize(e:GetModel())
- size = size + 40
- surface.DrawRect(-size/2, -40, size, 80)
- draw.SimpleText(e:GetClass(), "ChatFont", 0, -30, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
- draw.SimpleText(e:GetModel(), "ChatFont", 0, 0, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
- cam.End3D2D()
- elseif drawInfo:GetInt() == 2 then
- local ang = lp:EyeAngles()
- ang:RotateAroundAxis(ang:Forward(), 90)
- ang:RotateAroundAxis(ang:Right(), 90)
- cam.Start3D2D(e:GetPos() + Vector(0, 0, e:BoundingRadius() + 10), ang, 0.2)
- surface.SetDrawColor(0, 0, 0, 220)
- surface.SetFont("ChatFont")
- local size = surface.GetTextSize(e:GetModel())
- size = size + 40
- surface.DrawRect(-size/2, -40, size, 80)
- draw.SimpleText(e:GetClass(), "ChatFont", 0, -30, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
- draw.SimpleText(e:GetModel(), "ChatFont", 0, 0, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
- cam.End3D2D()
- end
- end
- end)
- hook.Add("HUDPaint", "Tools", function ()
- local tr = lp:GetEyeTrace()
- if drawInfo:GetBool() then
- local s = tr.HitPos:ToScreen()
- local n = (tr.HitPos+tr.HitNormal*20):ToScreen()
- local x = (tr.HitPos+Vector(20, 0, 0)):ToScreen()
- local y = (tr.HitPos+Vector(0, 20, 0)):ToScreen()
- local z = (tr.HitPos+Vector(0, 0, 20)):ToScreen()
- surface.SetDrawColor(255, 255, 255, 255)
- surface.SetTexture(surface.GetTextureID("gui/silkicons/check_off"))
- surface.DrawTexturedRect(s.x-8, s.y-8, 16, 16)
- draw.SimpleText(math.Round(tr.HitPos.x) ..", "..math.Round(tr.HitPos.y) ..", "..math.Round(tr.HitPos.z), "ChatFont", s.x, s.y+20, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
- surface.SetDrawColor(255, 255, 255, 255)
- surface.DrawLine(s.x, s.y, n.x, n.y)
- surface.SetDrawColor(255, 0, 0, 255)
- surface.DrawLine(s.x, s.y, x.x, x.y)
- surface.SetDrawColor(0, 255, 0, 255)
- surface.DrawLine(s.x, s.y, y.x, y.y)
- surface.SetDrawColor(0, 0, 255, 255)
- surface.DrawLine(s.x, s.y, z.x, z.y)
- end
- if drawWallhack:GetBool() then
- for k,v in pairs(player.GetAll()) do
- if v ~= lp then
- local p = v:GetShootPos()
- local s = p:ToScreen()
- local w,h = surface.GetTextSize(v:GetName())
- w = w + 40
- h = h + 8
- surface.SetDrawColor(0, 0, 0, 240)
- surface.DrawRect(s.x+(-w/2), s.y-2, w, h)
- surface.SetDrawColor(255, 255, 255, 255)
- surface.SetTexture(surface.GetTextureID("gui/silkicons/"..(v:IsAdmin() and "shield" or "user")))
- surface.DrawTexturedRect(s.x-(w/2)+8, s.y+4, 16, 16)
- draw.SimpleText(v:GetName(), "ChatFont", s.x+8, s.y, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
- local health = math.Clamp(v:Health() / 100, 0, 1)
- health = w * health
- surface.SetDrawColor(200, 0, 0, 255)
- surface.DrawRect(s.x+(-w/2), s.y-2+h, health, 2)
- end
- end
- end
- if propShow:GetInt() > 0 then
- if math.floor(CurTime()*10) % 20 == 1 then
- er = ents.FindByClass(propClass:GetString())
- end
- for k,v in pairs(er) do
- if v and v:IsValid() then
- local p = v:GetPos()
- local dist = p:Distance(lp:GetShootPos())
- if dist < propDist:GetInt() then
- local s = p:ToScreen()
- surface.SetDrawColor(0, 0, 0, 240)
- surface.DrawRect(s.x-10, s.y-10, 20, 20)
- surface.SetDrawColor(255, 255, 255, 255)
- surface.SetTexture(surface.GetTextureID("gui/silkicons/check_off"))
- surface.DrawTexturedRect(s.x-7, s.y-8, 16, 16)
- end
- end
- end
- end
- end)
Add Comment
Please, Sign In to add comment