Jump to content

Map Info lastTimePlayed litel bug


bandi94

Recommended Posts

Posted

i made a mapinfo window what include the lastTimePlayed that map now my problem is that it return's the date no problem whit it but it return's the current date not the lastTime

Client Side

local month ={"January","February","March","April","May","June","Juli","August","September","October","November","December"} 
  
function timestampToDate(stamp) 
    local time = getRealTime(stamp) 
    return string.format("%d %s %02d:%02d",time.monthday,month[time.month+1],time.hour-2,time.minute-2) 
end 
  
  
 function handleMapInfo(mapInfo) 
lastTimePlayed  = timestampToDate(mapInfo.lastTimePlayed) or "Unknown" 
 end 
     
  
addEvent("onClientMapStarting",true) 
addEventHandler("onClientMapStarting",getRootElement(),handleMapInfo) 

Posted

LOL You have to create a function that save's the last time played etc... Then when the map starts it search if the map have last time or not and others things, if yes then load the data.

Posted

Oh, ok. If you need other map info only see registry.db map registry. See the columns, time, name, playedCount and all you can use ( mapInfo.name, mapInfo.time, mapinfo.playerCount ).

Posted

ok thx now i am more confused if the mapInfo. playedCount it's work's why the mapInfo.lastTimePlayed it return the curent date and don't return the last day ?

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