abu5lf Posted May 13, 2012 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 ╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗ ║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║ ║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║ ║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║ ╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝ «سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك» M7mdAl7arthy : لتواصل سكايب
Stanley Sathler Posted May 13, 2012 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". Software Engineer & Entrepreneur • Running Lustrel and VilarikA • Highly engaged on open source community
abu5lf Posted May 13, 2012 Author 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 ╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗ ║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║ ║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║ ║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║ ╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝ «سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك» M7mdAl7arthy : لتواصل سكايب
Castillo Posted May 13, 2012 Posted May 13, 2012 Any errors on debugscript? does it return something? have you even tried debugging the script? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
arezu Posted May 13, 2012 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
abu5lf Posted May 13, 2012 Author Posted May 13, 2012 Any errors on debugscript? does it return something? have you even tried debugging the script? is not shown any errors ╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗ ║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║ ║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║ ║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║ ╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝ «سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك» M7mdAl7arthy : لتواصل سكايب
Jaysds1 Posted May 13, 2012 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? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
abu5lf Posted May 13, 2012 Author 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 ╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗ ║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║ ║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║ ║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║ ╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝ «سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك» M7mdAl7arthy : لتواصل سكايب
Cadu12 Posted May 13, 2012 Posted May 13, 2012 local s = getTickCount() local s = ( getTickCount() - s )/1000 It wont will work, becuase it will return 0.00000000000000000000000000000000000000000000000001 Ingame nick: Cadu12
Jaysds1 Posted May 13, 2012 Posted May 13, 2012 lol, Use getTickCount() to start a tick then create another one and divide it by 1000 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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