Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. --[[ Timer Prison --------------------------------------------------------------------------------------
  2.  
  3. Timer Prison made by Numerix (https://steamcommunity.com/id/numerix/)
  4.  
  5. --------------------------------------------------------------------------------------------------]]
  6.  
  7. local work = "no data"
  8. local duration = 0
  9. local timeleft = 0
  10. local text_timer
  11.  
  12. hook.Add("HUDPaint", "TimerPrison:HUDPaint", function()
  13. if work != "no data" then
  14. timeleft = math.Round(duration - CurTime())
  15.  
  16. if GetGlobalBool("DarkRP_Lockdown") then
  17. text_timer = TimerPrison.GetLanguage("Lockdown ! Go to cells !")
  18. else
  19. text_timer = string.format(TimerPrison.GetLanguage("Current task: %s for %s seconds"), work, timeleft )
  20. end
  21.  
  22. surface.SetFont( "Timer.Text" )
  23. local textlenght = surface.GetTextSize(text_timer)
  24. draw.RoundedBox(13, 7, ScrH() - 225, textlenght + 20, ScrH()/20, Color(62,62,62,180))
  25. surface.SetDrawColor( color_white )
  26. surface.DrawOutlinedRect( 0, 0, 100, 55 )
  27. surface.SetDrawColor(62,62,62,180)
  28. surface.DrawRect( 13, 825, 302, 55 )
  29. surface.SetDrawColor(255, 255, 255)
  30. surface.DrawOutlinedRect( 13, 825, 303, 55 )
  31.  
  32. draw.SimpleText(text_timer, "Timer.Text", ScrW() / 38 - 16, ScrH() - 238.5, Color(255,255,255,255), TEXT_ALIGN_LEFT)
  33.  
  34. end
  35.  
  36.  
  37.  
  38. end)
  39.  
  40. net.Receive("TimerPrison:UpdateInfo", function()
  41. work = net.ReadString()
  42. duration = net.ReadInt(32)
  43.  
  44. if TimerPrison.Settings.SoundFile != "" and !GetGlobalBool("DarkRP_Lockdown") then
  45. surface.PlaySound(TimerPrison.Settings.SoundFile)
  46. end
  47. end)
  48.  
  49. surface.CreateFont( "Timer.Text", {
  50. font = "Roboto",
  51. size = 20,
  52. weight = 700,
  53. } )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement