Advertisement
quintosh

headlaser

May 9th, 2013
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. local neededAngles = Angle(-90, 0, 0)
  2.  
  3.  
  4. HeadLinesActive = true
  5.  
  6. function HeadLines2()
  7. cam.Start3D(EyePos(), EyeAngles())
  8. for k,ply in pairs(player.GetAll()) do
  9. if ply != LocalPlayer() && ply:Alive() then
  10. local shootPos = ply:GetShootPos()
  11. local data = {}
  12. data.start = shootPos
  13. data.endpos = shootPos + neededAngles:Forward() * 10000
  14. data.filter = ply
  15. local tr = util.TraceLine(data)
  16. cam.Start3D2D(shootPos, neededAngles, 1)
  17. if IsValid(tr.Entity) then
  18. surface.SetDrawColor(255, 140, 0, 255)
  19. else
  20. surface.SetDrawColor(0, 0, 255, 255)
  21. end
  22. surface.DrawLine(0, 0, tr.HitPos:Distance(shootPos), 0)
  23. cam.End3D2D()
  24. end
  25. end
  26. cam.End3D()
  27. end
  28.  
  29. hook.Add("HUDPaint", "HeadLines2", HeadLines2)
  30.  
  31.  
  32. concommand.Add("suckmydick", function()
  33. if toggleLinesHead then
  34. hook.Remove("HUDPaint", "HeadLines2")
  35. toggleLinesHead = false
  36. HeadLinesActive = false
  37. else
  38. hook.Add("HUDPaint", "HeadLines2", HeadLines2)
  39. toggleLinesHead = true
  40. HeadLinesActive = true
  41. end
  42. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement