Jump to content

HunterTopTimes Alert


#Paper

Recommended Posts

Posted

How i can convert the time in the hunter alert (in toptimes ) to a real time?

Hunter TopTimes: -M$P-SuN got TopTime Position! | Rank: 1 | Time: 199507

The "Time" field isn't the time, is random numbers... how i can get the time?

Posted

It's not a random number, it's the amount of time in milliseconds:

199507 milliseconds = 3*60*1000 + 19 * 1000 + 507 = 3 minutes + 19 seconds + 507 milliseconds

this function comes from race_toptimes:

function msToTimeStr(ms) 
    if not ms then 
        return '' 
    end 
    local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) 
    if #centiseconds == 1 then 
        centiseconds = '0' .. centiseconds 
    end 
    local s = math.floor(ms / 1000) 
    local seconds = tostring(math.fmod(s, 60)) 
    if #seconds == 1 then 
        seconds = '0' .. seconds 
    end 
    local minutes = tostring(math.floor(s / 60)) 
    return minutes .. ':' .. seconds .. ':' .. centiseconds 
end 

Posted

So, i've that function, how to get the time?

outputChatBox("Hunter TopTimes: "..getPlayerName(source).. ' got TopTime Position! | Rank: ' .. newPos .. " | Time:"..tostring(newTime)) 
end 

Posted
outputChatBox("Hunter TopTimes: "..getPlayerName(source).. ' got TopTime Position! | Rank: ' .. newPos .. " | Time:"..msToTimeStr(newTime)) 

Posted
outputChatBox("Hunter TopTimes: "..getPlayerName(source).. ' got TopTime Position! | Rank: ' .. newPos .. " | Time:"..msToTimeStr(newTime)) 

lol simple xD

Thanks! ;D

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