Advertisement
Guest User

Untitled

a guest
Nov 20th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. local Sourcemod_Material = Material( 'particle/Particle_Ring_Wave_AddNoFog' )
  2. local color = Color( 255, 255, 255, 255 )
  3.  
  4. function GetHealthColor(ply)
  5. if ply:Health() >= 75 then
  6. return Color( 46, 204, 113, 100 )
  7. elseif ply:Health() >= 50 then
  8. return Color( 241, 196, 15, 100 )
  9. elseif ply:Health() >= 25 then
  10. return Color( 243, 156, 18, 100 )
  11. elseif ply:Health() >= 0 then
  12. return Color( 231, 76, 113, 60 )
  13.  
  14. end
  15. end
  16.  
  17.  
  18. hook.Add( 'PostDrawTranslucentRenderables', 'SourceMod Ring', function()
  19.  
  20. for k,v in pairs( player.GetAll() ) do
  21.  
  22. if v:Alive() then
  23.  
  24. cam.Start3D2D( v:GetPos() + Vector( 0, 0, 5 ),Angle( 0, CurTime() * 120, 0 ), 0.30 )
  25.  
  26. local source_width = 100
  27.  
  28. surface.SetMaterial( Sourcemod_Material )
  29.  
  30. surface.SetDrawColor( GetHealthColor(v) )
  31.  
  32. surface.DrawTexturedRect( -source_width, -source_width, source_width*2, source_width*2 )
  33.  
  34. cam.End3D2D()
  35.  
  36. end
  37.  
  38. for k,v in pairs( player.GetAll() ) do
  39.  
  40. if v:Alive() and v:IsAdmin() then
  41.  
  42. cam.Start3D2D( v:GetPos() + Vector( 0, 0, 5 ),Angle( 0, 120, 0 ), 0.30 )
  43.  
  44. local source_width = math.sin( CurTime() + 10 ) * 90
  45.  
  46. surface.SetMaterial( Sourcemod_Material )
  47.  
  48. surface.SetDrawColor( HSVToColor( 10, 5, math.Rand( 1, 2 ) ), 50 )
  49.  
  50. surface.DrawTexturedRect( -source_width, -source_width, source_width*2, source_width*2 )
  51.  
  52. cam.End3D2D()
  53.  
  54. end
  55.  
  56. end
  57.  
  58. end
  59.  
  60. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement