Jump to content

Milliseconds to seconds?


megaman54

Recommended Posts

Posted

Ahh, i dont really understand so i must make a example..

So its like this? :

function calcMsecs(player, command, mSecs) 
seconds = tonumber(mSecs) / 1000 
outputChatBox(seconds, player) 
end 
addCommandHandler("msecs", calcMsecs) 

Posted

or

  
function MsToSeconds( MS ) 
local seconds = tonumber ( MS ) * 1000 
return seconds 
end 
  
setTimer( function, MsToSeconds( 50 ), 1 ) 
  

Ingame nick: Cadu12

Posted

MsToSeconds( 50 ) return 50000

setTimer for i dont have function name, then i can use "function" name

Ingame nick: Cadu12

  • MTA Team
Posted
Why would you even use a function for something simple like this? I'm going to nominate this topic as the longest for a too simple question of 2011 :|

I don't know.. maybe to prevent doing this:

(6000/1000)+(1200/1000)+(201*1000)+ (6120/1000)+(1234/1003)+(291*1000)+2 

when you could do functions to avoid the brackets...but meh D:

eAi - WHO GOD D:

Posted
Why would you even use a function for something simple like this? I'm going to nominate this topic as the longest for a too simple question of 2011 :|

I don't know.. maybe to prevent doing this:

(6000/1000)+(1200/1000)+(201*1000)+ (6120/1000)+(1234/1003)+(291*1000)+2 

when you could do functions to avoid the brackets...but meh D:

eAi - WHO GOD D:

this would look as ugly as now if u would have to call the func for all of them.

Posted
megaman54 : How to covert milliseconds to seconds?

JR10 : ms / 1000.

megaman54 : What function is that?

JR10 : What?

Just divide the milliseconds.

milliseconds / 1000

megaman54 : Yes, but i need the script to calculate it. I mean, i type a command like this: /calc then it outputs that in seconds. What function should i use for this?

JR10 : Dude, I said divide it.

Milliseconds / 1000 

Oh yeah.

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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