LukisLT Posted July 1, 2012 Author Share Posted July 1, 2012 As you see, i made labbels for " --/--/-- " and " dd/mm/yy " and kenix's function has label to, but if this helps here is the client code : function GetCurrentDateAndTime ( ) local aRealTime = getRealTime ( ) return string.format ( "%04d/%02d/%02d", aRealTime.year + 1900, aRealTime.month + 1, aRealTime.monthday ), string.format ( "%02d:%02d:%02d", aRealTime.hour, aRealTime.minute, aRealTime.second ) end local sDate, sTime = GetCurrentDateAndTime( ) guiCreateLabel( 0.5, 0.5, 0.5, 0.5, 'Time: ' .. sTime .. ' Date ' .. sDate , true ) --- --- --- --- --- function open() if guiGetVisible ( GUIEditor_Window[1] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) else guiSetVisible ( GUIEditor_Window[1], true ) showCursor(true) guiSetInputEnabled(true) end end bindKey("F2","down",open) function close() if (source == GUIEditor_Button[1]) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) end end addEventHandler("onClientGUIClick",GUIEditor_Button[1],close,false) Link to comment
TAPL Posted July 1, 2012 Share Posted July 1, 2012 function GetCurrentDateAndTime() local aRealTime = getRealTime() return string.format("%04d/%02d/%02d", aRealTime.year + 1900, aRealTime.month + 1, aRealTime.monthday), string.format("%02d:%02d:%02d", aRealTime.hour, aRealTime.minute, aRealTime.second) end setTimer(function() local sDate, sTime = GetCurrentDateAndTime() guiSetText(TimeLabel, sTime) -- change TimeLabel to Your variable guiSetText(DateLabel, sDate) -- change DateLabel to Your variable end,1000,0) Link to comment
myonlake Posted July 1, 2012 Share Posted July 1, 2012 Just show us the script if you don't know how to script. Link to comment
LukisLT Posted July 1, 2012 Author Share Posted July 1, 2012 Got it all working, thank you for you help guys now the clock is ticking like Quartz one.. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now