Darkwater

Untitled

Sep 18th, 2011
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. local drawInfo = CreateClientConVar("at_info", "0", true, false)
  2. local drawWallhack = CreateClientConVar("at_wallhack", "0", true, false)
  3. local propShow = CreateClientConVar("at_props", "0", true, false)
  4. local propClass = CreateClientConVar("at_props_class", "prop_physics", true, false)
  5. local propDist = CreateClientConVar("at_props_dist", "1024", true, false)
  6. local lp = LocalPlayer()
  7. local er = {}
  8.  
  9. hook.Add("PostDrawOpaqueRenderables", "Tools", function ()
  10. local tr = lp:GetEyeTrace()
  11.  
  12. if not tr.Hit or tr.HitWorld then return end
  13.  
  14. local e = tr.Entity
  15.  
  16. if drawInfo:GetBool() then
  17. if drawInfo:GetInt() == 1 then
  18. local ang = tr.HitNormal:Angle()
  19. ang:RotateAroundAxis(ang:Forward(), 90)
  20. ang:RotateAroundAxis(ang:Right(), -90)
  21.  
  22. cam.Start3D2D(tr.HitPos + tr.HitNormal*10, ang, 0.2)
  23. surface.SetDrawColor(0, 0, 0, 220)
  24. surface.SetFont("ChatFont")
  25. local size = surface.GetTextSize(e:GetModel())
  26. size = size + 40
  27. surface.DrawRect(-size/2, -40, size, 80)
  28. draw.SimpleText(e:GetClass(), "ChatFont", 0, -30, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  29. draw.SimpleText(e:GetModel(), "ChatFont", 0, 0, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  30. cam.End3D2D()
  31. elseif drawInfo:GetInt() == 2 then
  32. local ang = lp:EyeAngles()
  33. ang:RotateAroundAxis(ang:Forward(), 90)
  34. ang:RotateAroundAxis(ang:Right(), 90)
  35.  
  36. cam.Start3D2D(e:GetPos() + Vector(0, 0, e:BoundingRadius() + 10), ang, 0.2)
  37. surface.SetDrawColor(0, 0, 0, 220)
  38. surface.SetFont("ChatFont")
  39. local size = surface.GetTextSize(e:GetModel())
  40. size = size + 40
  41. surface.DrawRect(-size/2, -40, size, 80)
  42. draw.SimpleText(e:GetClass(), "ChatFont", 0, -30, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  43. draw.SimpleText(e:GetModel(), "ChatFont", 0, 0, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  44. cam.End3D2D()
  45. end
  46.  
  47. end
  48. end)
  49.  
  50. hook.Add("HUDPaint", "Tools", function ()
  51. local tr = lp:GetEyeTrace()
  52.  
  53. if drawInfo:GetBool() then
  54. local s = tr.HitPos:ToScreen()
  55. local n = (tr.HitPos+tr.HitNormal*20):ToScreen()
  56. local x = (tr.HitPos+Vector(20, 0, 0)):ToScreen()
  57. local y = (tr.HitPos+Vector(0, 20, 0)):ToScreen()
  58. local z = (tr.HitPos+Vector(0, 0, 20)):ToScreen()
  59. surface.SetDrawColor(255, 255, 255, 255)
  60. surface.SetTexture(surface.GetTextureID("gui/silkicons/check_off"))
  61. surface.DrawTexturedRect(s.x-8, s.y-8, 16, 16)
  62. 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)
  63. surface.SetDrawColor(255, 255, 255, 255)
  64. surface.DrawLine(s.x, s.y, n.x, n.y)
  65. surface.SetDrawColor(255, 0, 0, 255)
  66. surface.DrawLine(s.x, s.y, x.x, x.y)
  67. surface.SetDrawColor(0, 255, 0, 255)
  68. surface.DrawLine(s.x, s.y, y.x, y.y)
  69. surface.SetDrawColor(0, 0, 255, 255)
  70. surface.DrawLine(s.x, s.y, z.x, z.y)
  71. end
  72.  
  73. if drawWallhack:GetBool() then
  74. for k,v in pairs(player.GetAll()) do
  75. if v ~= lp then
  76. local p = v:GetShootPos()
  77. local s = p:ToScreen()
  78.  
  79. local w,h = surface.GetTextSize(v:GetName())
  80. w = w + 40
  81. h = h + 8
  82. surface.SetDrawColor(0, 0, 0, 240)
  83. surface.DrawRect(s.x+(-w/2), s.y-2, w, h)
  84. surface.SetDrawColor(255, 255, 255, 255)
  85. surface.SetTexture(surface.GetTextureID("gui/silkicons/"..(v:IsAdmin() and "shield" or "user")))
  86. surface.DrawTexturedRect(s.x-(w/2)+8, s.y+4, 16, 16)
  87. draw.SimpleText(v:GetName(), "ChatFont", s.x+8, s.y, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  88. local health = math.Clamp(v:Health() / 100, 0, 1)
  89. health = w * health
  90. surface.SetDrawColor(200, 0, 0, 255)
  91. surface.DrawRect(s.x+(-w/2), s.y-2+h, health, 2)
  92. end
  93. end
  94. end
  95.  
  96. if propShow:GetInt() > 0 then
  97. if math.floor(CurTime()*10) % 20 == 1 then
  98. er = ents.FindByClass(propClass:GetString())
  99. end
  100.  
  101. for k,v in pairs(er) do
  102. if v and v:IsValid() then
  103. local p = v:GetPos()
  104. local dist = p:Distance(lp:GetShootPos())
  105. if dist < propDist:GetInt() then
  106. local s = p:ToScreen()
  107.  
  108. surface.SetDrawColor(0, 0, 0, 240)
  109. surface.DrawRect(s.x-10, s.y-10, 20, 20)
  110. surface.SetDrawColor(255, 255, 255, 255)
  111. surface.SetTexture(surface.GetTextureID("gui/silkicons/check_off"))
  112. surface.DrawTexturedRect(s.x-7, s.y-8, 16, 16)
  113. end
  114. end
  115. end
  116. end
  117. end)
Advertisement
Add Comment
Please, Sign In to add comment