[ASK] Grabbing the TxAdmin Total Playtime

[ASK]

Hey guys,

Is it possible to retrieve the total playtime of a player from txAdmin? It doesn’t matter whether it’s client-side or server-side, but it would be interesting to write some code such that players with more playtime have access to additional features, like promo codes for example.

Thank you for your help.

1 Like

Sorry I read this wrong, no theres not a way to get txAdmin playtime currently, you can make a feature request in the txAdmin discord (or GitHub, I’m not 100% sure where they go)

1 Like

I have never tried interfering with txAdmin data files in any way and don’t know the behaviour of it, but ATM you can use the database file TxAdmin used located at serverRoot/txData/default/data/playersDB.json and open it for reading.


The player objects are saved quite simple so accessing would look like:

const playTimeInSeconds = databaseObject.players[index].playTime

I hope I could help you. And maybe some experienced Tx people could tell us more about how (time spans, server restarts?) the database is saved.

1 Like