abu5lf Posted May 13, 2012 Share Posted May 13, 2012 (edited) setTimer( function ( ) local s = getTickCount( )s = ( getTickCount() - s ) / 1000 local string = string.format( "%02d(h)%02d(m)%02d(s)", s/3600, s%3600/60, s%60 ) guiSetText(Label,string) end, 1000, 0 ) It does not do anything ! Edited December 25, 2012 by Guest Link to comment
Stanley Sathler Posted May 13, 2012 Share Posted May 13, 2012 I can't test now, but try this: setTimer( function ( ) local s = getTickCount( ) s = ( getTickCount() - s ) / 1000 local string1 = string.format( "%02d(h)%02d(m)%02d(s)", s/3600, s%3600/60, s%60 ) guiSetText(Label,string1) end, 1000, 0 ) If not work, so try this: setTimer( function ( ) local s = getTickCount( )s = ( getTickCount() - s ) / 1000 local string1 = string.format( "%02d(h)%02d(m)%02d(s)", s/3600, s%3600/60, s%60 ) guiSetText(Label,string1) end, 1000, 0 ) I just renamed the "string" variable to "string1". Link to comment
abu5lf Posted May 13, 2012 Author Share Posted May 13, 2012 I can't test now, but try this: setTimer( function ( ) local s = getTickCount( ) s = ( getTickCount() - s ) / 1000 local string1 = string.format( "%02d(h)%02d(m)%02d(s)", s/3600, s%3600/60, s%60 ) guiSetText(Label,string1) end, 1000, 0 ) If not work, so try this: setTimer( function ( ) local s = getTickCount( )s = ( getTickCount() - s ) / 1000 local string1 = string.format( "%02d(h)%02d(m)%02d(s)", s/3600, s%3600/60, s%60 ) guiSetText(Label,string1) end, 1000, 0 ) I just renamed the "string" variable to "string1". Unfortunately,not work all Link to comment
Castillo Posted May 13, 2012 Share Posted May 13, 2012 Any errors on debugscript? does it return something? have you even tried debugging the script? Link to comment
arezu Posted May 13, 2012 Share Posted May 13, 2012 ofc it doesn't work. What you are trying to do is almost like this: s = getTickCount() - getTickCount() and you are asking why its 0.0000000000001 Link to comment
abu5lf Posted May 13, 2012 Author Share Posted May 13, 2012 Any errors on debugscript? does it return something? have you even tried debugging the script? is not shown any errors Link to comment
Jaysds1 Posted May 13, 2012 Share Posted May 13, 2012 try this: setTimer( function ( ) local s = getTickCount() local s = ( getTickCount() - s )/1000 local string = string.format( "%02d(h)%02d(m)%02d(s)", s/3600, s%3600/60, s%60 ) guiSetText(Label,string) end, 1000, 0 ) If this doesn't work, post the debug error(s). BTW, is Label defined in your script? Link to comment
abu5lf Posted May 13, 2012 Author Share Posted May 13, 2012 try this:setTimer( function ( ) local s = getTickCount() local s = ( getTickCount() - s )/1000 local string = string.format( "%02d(h)%02d(m)%02d(s)", s/3600, s%3600/60, s%60 ) guiSetText(Label,string) end, 1000, 0 ) If this doesn't work, post the debug error(s). BTW, is Label defined in your script? Label = guiCreateLabel(379,300,725,250,"0",false) guiSetFont(Label,"sa-gothic") setTimer( function ( ) local s = getTickCount() local s = ( getTickCount() - s )/1000 local string = string.format( "%02d(h)%02d(m)%02d(s)", s/3600, s%3600/60, s%60 ) guiSetText(Label,string) end, 1000, 0 ) not work Link to comment
Cadu12 Posted May 13, 2012 Share Posted May 13, 2012 local s = getTickCount() local s = ( getTickCount() - s )/1000 It wont will work, becuase it will return 0.00000000000000000000000000000000000000000000000001 Link to comment
Jaysds1 Posted May 13, 2012 Share Posted May 13, 2012 lol, Use getTickCount() to start a tick then create another one and divide it by 1000 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