Jump to content

getTickCount( )


abu5lf

Recommended Posts

Posted (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 by Guest

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted

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

Posted
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 : لتواصل سكايب

Posted

Any errors on debugscript? does it return something? have you even tried debugging the script?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

Posted
Any errors on debugscript? does it return something? have you even tried debugging the script?

is not shown any errors

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted

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/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted
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 : لتواصل سكايب

Posted
local s = getTickCount() 
local s = ( getTickCount() - s )/1000 

It wont will work, becuase it will return 0.00000000000000000000000000000000000000000000000001

Ingame nick: Cadu12

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...