Dekonpriv Posted March 25, 2023 Share Posted March 25, 2023 Procuro algum mod que possa me retornar a data do ultimo login de player, porém não encontro. Como seria possível salvar a data de algum login? Exemplo: a pessoa de ID 10 faz login hoje: 25/03/2023 e isso fica armazenado quando eu mentalizar "/login 10" irá retornar a ultima vez que a pessoa fez login. necessito de ua luz Link to comment
alex17" Posted March 26, 2023 Share Posted March 26, 2023 (edited) 38 minutes ago, Dekonpriv said: Procuro algum mod que possa me retornar a data do ultimo login de player, porém não encontro. Como seria possível salvar a data de algum login? Exemplo: a pessoa de ID 10 faz login hoje: 25/03/2023 e isso fica armazenado quando eu mentalizar "/login 10" irá retornar a ultima vez que a pessoa fez login. necessito de ua luz addEventHandler("onPlayerLogin", root, function(_, account) setAccountData(account, "lastconnection", getRealTime().timestamp) end ) addCommandHandler("login", function(player, _, accountName) if accountName then local account = getAccount(accountName) if account then local lastconnection = getAccountData(account, "lastconnection") if lastconnection then outputChatBox("Last Connection "..formatDate(lastconnection), player) end end end end ) function formatDate ( timestamp ) if ( tonumber ( timestamp ) ) then local time = getRealTime ( timestamp ) return string.format ( "%02d.%02d.%02d", time.monthday, time.month + 1, time.year + 1900, time.hour, time.minute ) end end you can guide yourself from this example Edited March 26, 2023 by alex17" 1 Link to comment
Moderators Vinyard Posted March 26, 2023 Moderators Share Posted March 26, 2023 Hi, Your thread has been moved to the Portuguese section so you can get better assistance in your native language. Make sure you use English when posting outside this language-specific section. Link to comment
Recommended Posts