• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Last Login

Gitu Cropwel

reptera.net
Joined
Dec 7, 2012
Messages
118
Reaction score
4
Hiho,
why this code:
Code:
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSetMounted(cid, mounting, 1)
			--doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit in Reptera: " .. os.date("%a %b %d %X %Y", lastLogin) .. " CET."
		else
			str = str .. " It's your first visit on Reptera. First choose your outfit. Information: if you wanna buy blessings use command !blessing."
			doPlayerSendOutfitWindow(cid)
			setPlayerStorageValue(cid, 2500, 0)
		end

in login.lua, show me in tibia current time, not last login time? When i have last login time 4:00 and current hour is 7:00 it says "Your last visit in Reptera: 7:00 Day XX CET."

Thanks
 
I think we'll need your whole script to see how your log time is saved in the database, this script doesn't give us the info we need, this script only reads what the database gives it
 
I think we'll need your whole script to see how your log time is saved in the database, this script doesn't give us the info we need, this script only reads what the database gives it

sure, but when i use
Code:
local lastLogin = getPlayerLastLoginSaved(cid) 
doPlayerSendTextMessage(cid, 18, "" .. os.date("%a %b %d %X %Y", lastLogin) .. " CET.")
in any other script it works good, only in login.lua bad ;/
 
Maybe when you login lastlogin updates first and then this os.date("%a %b %d %X %Y", lastLogin) pick date from lastlogin form? Maybe try move script before lastlogin update part ? ? :p
 
Maybe when you login lastlogin updates first and then this os.date("%a %b %d %X %Y", lastLogin) pick date from lastlogin form? Maybe try move script before lastlogin update part ? ? :p

i checked it, before this message there isn't any save or update lastLogin
 
it's something with source of latest tfs

here is fix:

Lua:
str = "Your last visit in Reptera: " .. os.date("%a %b %d %X %Y", getPlayerStorageValue(cid, 923848)) .. " CET."
			setPlayerStorageValue(cid, 923848, os.time())

make it in login.lua work, tested
 
Back
Top