kizaru335

Untitled

Jun 17th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. -----------------------------------------------------
  2. surface.CreateFont( "InfoFont", { font = "Trebuchet24", size = 20, weight = 0 } )
  3. surface.CreateFont( "JobFont", { font = "Trebuchet18", size = 18, weight = 0 } )
  4. surface.CreateFont( "WantedFont", { font = "Trebuchet24", size = 23, weight = 0 } )
  5.  
  6. local PlayerIcon = vgui.Create("SpawnIcon")
  7. PlayerIcon:SetPos( 45, ScrH() - 75 )
  8. PlayerIcon:SetSize(70, 70)
  9. PlayerIcon:SetToolTip("Твой персонаж")
  10. function hudpaint()
  11. draw.RoundedBox( 0, 5, ScrH() - 115, 300, 110 , Color( 64, 64, 64, 200 ) )
  12. draw.RoundedBox( 0, 5, ScrH() - 115, 25, 110 , Color( 64, 0, 0, 240 ) )
  13. draw.RoundedBox( 0, 30,ScrH() - 115, 15, 110 , Color( 41, 0, 0, 240 ) )
  14. draw.RoundedBox( 0, 45,ScrH() - 115, 260, 40 , Color( 64, 0, 0, 200 ) )
  15. draw.DrawText( LocalPlayer():Nick(), "Trebuchet24", 55, ScrH() - 114, Color( 0, 0, 0, 200 ) )
  16. draw.DrawText( "Работа:" .. team.GetName(LocalPlayer():Team()), "JobFont", 56, ScrH() - 94, Color( 0, 0, 0, 210 ))
  17. draw.DrawText( "Кошелёк:" .. tostring(LocalPlayer():getDarkRPVar("money")) .. "Р", "InfoFont", 120, ScrH() - 76, Color( 173 , 173, 173, 210 ))
  18. draw.DrawText( "Зарплата:" .. tostring(LocalPlayer():getDarkRPVar("salary")) .. "Р", "InfoFont", 120, ScrH() - 60, Color( 173, 173, 173, 210 ))
  19. draw.DrawText( "Здоровье:" .. LocalPlayer():Health().."%", "InfoFont", 120, ScrH() - 44, Color( 173, 173, 173, 210 ))
  20. draw.DrawText( "Броня:" .. LocalPlayer():Armor().."%", "InfoFont", 120, ScrH() - 28, Color( 173, 173, 173, 210 ))
  21.  
  22. if LocalPlayer():getDarkRPVar("wanted") == true then
  23. local cin = (math.sin(CurTime()) + 1) / 2
  24. text = "В розыске. Причина: " .. tostring(LocalPlayer():getDarkRPVar("wantedReason")) or "Нет"
  25. local TextWidth = surface.GetTextSize(text)
  26. draw.DrawText( text, "WantedFont", TextWidth * 1, ScrH() - 160, Color(cin * 255, 0, 255 - (cin * 255)), TEXT_ALIGN_CENTER )
  27. end
  28.  
  29. local Page = Material("icon16/page_white_text.png")
  30. if LocalPlayer():getDarkRPVar("HasGunlicense") then
  31. surface.SetMaterial(Page)
  32. surface.SetDrawColor(255, 255, 255, 255)
  33. surface.DrawTexturedRect(35 + 240, ScrH() - 38, 32, 32)
  34. end
  35.  
  36. PlayerIcon:SetModel(LocalPlayer():GetModel())
  37. end
  38.  
  39.  
  40.  
  41. function DrawName( ply )
  42.  
  43. if !ply:Alive() then return end
  44.  
  45. local offset = Vector( 0, 0, 85 )
  46. local ang = LocalPlayer():EyeAngles()
  47. local pos = ply:GetPos() + offset + ang:Up()
  48. local plyteam = team.GetName(ply:Team()) or "Неизвестно"
  49. local name = ply:Nick() or "Неизвестно"
  50. local color = team.GetColor(ply:Team()) or Color( 255, 255, 255, 255 )
  51. ang:RotateAroundAxis( ang:Forward(), 90 )
  52. ang:RotateAroundAxis( ang:Right(), 90 )
  53.  
  54. cam.Start3D2D( pos, Angle( 0, ang.y, 90 ), 0.25 )
  55. draw.DrawText( name, "Trebuchet24", 2, 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
  56. draw.DrawText( plyteam, "Trebuchet24", 2, -30, color, TEXT_ALIGN_CENTER )
  57. cam.End3D2D()
  58.  
  59. end
  60.  
  61. hook.Add( "PostPlayerDraw", "DrawName", DrawName )
  62.  
  63. hook.Add( "HUDPaint", "HUDPaint_DrawABox",hudpaint)
Advertisement
Add Comment
Please, Sign In to add comment