[Open Source] Playtime via txAdmin data

[Repost - now open source, and please read the notes]
Use this if io.open based playtime resources don’t work for you, if they do, great.

Avoid using unnecessary client-sided resources!

With td-playtime, players can run an in-game command to view their txAdmin stored playtime.

I also provide an open-source merging tool if you need to import playtimes to your database!

:white_check_mark: Features

  • Playtime Tracking: Accurately display your txAdmin playtime with in-game commands.
  • Lightweight & Optimized.
  • Easy to Set Up: I provide a tool to merge your playtimes to your database.
  • Creates table if doesn’t exist - both in the script and the resource.
  • Detects notification resources and frameworks.
  • Open source (editable): Modify the script or resource as needed to fit your server’s needs.

:bulb:How Does It Work?

First, you need to merge txAdmin playtime data into your database. This can be done using the free, open-source script provided on GitHub, the optional executable, or by implementing your own method.

The GitHub repository contains the FiveM resource along with the merge tool/script. You can choose to run the script directly (open-source version) or use the pre-packaged executable for convenience (they are the same).

:ledger:Notes/why:
I opted for this method because for me, io.open calls fail when trying to access files outside the server root where the resources folder is. Even if it worked, I would still prefer storing playtimes in SQL rather than reading the file during runtime each command. If anyone else has the same issue and wants to load all playtimes into SQL, this should help! :grin:

:globe_with_meridians: Links

[Link - Github]

Enjoy :slightly_smiling_face:

Code is accessible Yes
Subscription-based No
Lines (approximately) 186
Requirements MySQL
Support Yes
8 Likes

You can just do the same woth discord /info self :thinking:

4 Likes