Guest User

Untitled

a guest
Jun 25th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. local NextRound = 0
  2. usermessage.Hook( "RoundTimeLeft", function ( um )
  3. NextRound = um:ReadLong()
  4. end)
  5.  
  6. surface.CreateFont( "coolvetica", 45, 500, true, true, "TimerMainFont" )
  7. surface.CreateFont( "coolvetica", 15, 500, true, true, "TimerTitleFont" )
  8.  
  9. function drawclock()
  10.  
  11. local TimeLeft = math.Clamp( ( NextRound - CurTime() ), 0, 15 )
  12. TimeLeft = math.floor( TimeLeft )
  13. TimeLeft = string.ToMinutesSeconds( TimeLeft )
  14.  
  15.  
  16. draw.RoundedBox( 8, ScrW()/2 - 60, -10, 120, 70, Color( 0, 0, 0, 100 ) )
  17.  
  18. if ( GAMEMODE:GetRoundState() == ROUND_PREROUND ) then
  19.  
  20. draw.SimpleText( "Round Begins", "TimerTitleFont", ScrW()/2 , 10, Color( 50, 120, 22, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  21. draw.SimpleText( TimeLeft , "TimerMainFont", ScrW()/2 , 40, Color( 200, 200, 200, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  22.  
  23. elseif ( GAMEMODE:GetRoundState() == ROUND_INGAME ) then
  24.  
  25. draw.SimpleText( "Round State", "TimerTitleFont", ScrW()/2 , 10, Color( 50, 120, 22, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  26. draw.SimpleText( "In Game" , "TimerMainFont", ScrW()/2 , 40, Color( 200, 200, 200, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  27.  
  28. elseif ( GAMEMODE:GetRoundState() == ROUND_PREGAME ) then
  29.  
  30. draw.SimpleText( "Round State", "TimerTitleFont", ScrW()/2 , 10, Color( 50, 120, 22, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  31. draw.SimpleText( "Pre-Game" , "TimerMainFont", ScrW()/2 , 40, Color( 200, 200, 200, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  32.  
  33. end
  34.  
  35. end
  36. hook.Add("HUDPaint", "DrawPrepClock", drawclock)
Add Comment
Please, Sign In to add comment