Jump to content

Digital time problem (dxDrawText)


VTX

Recommended Posts

Hey guys!

I have this script:

  
function time () 
    local sWidth,sHeight = guiGetScreenSize() 
    local hours = getRealTime().hour 
    local minutes = getRealTime().minute 
    dxDrawText(hours..":"..minutes,sWidth*0.95486, sHeight*0.01112, sWidth*0.00694, sHeight*0.01112,tocolor(160,160,160,255),0.6,"bankgothic","left","top",false,false,false) 
end 
  
addEventHandler ( "onClientRender", getRootElement(), time ) 
  

It works fine, except one thing:

It doesn't put 0 before single numbers.

For example, if it's '01:05' it shows '1:5'.

I'm a beginner in scripting and I have no idea how to fix this, please help. :roll:

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...