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) 

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

hm it's funny i used "mapInfo.playedCount" (played times) and it's work fine in this case i hawe more to work :D

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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 ?

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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