Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local NextRound = 0
- usermessage.Hook( "RoundTimeLeft", function ( um )
- NextRound = um:ReadLong()
- end)
- surface.CreateFont( "coolvetica", 45, 500, true, true, "TimerMainFont" )
- surface.CreateFont( "coolvetica", 15, 500, true, true, "TimerTitleFont" )
- function drawclock()
- local TimeLeft = math.Clamp( ( NextRound - CurTime() ), 0, 15 )
- TimeLeft = math.floor( TimeLeft )
- TimeLeft = string.ToMinutesSeconds( TimeLeft )
- draw.RoundedBox( 8, ScrW()/2 - 60, -10, 120, 70, Color( 0, 0, 0, 100 ) )
- if ( GAMEMODE:GetRoundState() == ROUND_PREROUND ) then
- draw.SimpleText( "Round Begins", "TimerTitleFont", ScrW()/2 , 10, Color( 50, 120, 22, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- draw.SimpleText( TimeLeft , "TimerMainFont", ScrW()/2 , 40, Color( 200, 200, 200, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- elseif ( GAMEMODE:GetRoundState() == ROUND_INGAME ) then
- draw.SimpleText( "Round State", "TimerTitleFont", ScrW()/2 , 10, Color( 50, 120, 22, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- draw.SimpleText( "In Game" , "TimerMainFont", ScrW()/2 , 40, Color( 200, 200, 200, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- elseif ( GAMEMODE:GetRoundState() == ROUND_PREGAME ) then
- draw.SimpleText( "Round State", "TimerTitleFont", ScrW()/2 , 10, Color( 50, 120, 22, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- draw.SimpleText( "Pre-Game" , "TimerMainFont", ScrW()/2 , 40, Color( 200, 200, 200, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- end
- end
- hook.Add("HUDPaint", "DrawPrepClock", drawclock)
Add Comment
Please, Sign In to add comment