Database Setup

To store additional data for playtime and last played sessions in your database, follow these steps:

Adding Columns to the players Table

  1. Open your database management tool (e.g., HeidiSQL, phpMyAdmin, DBeaver).

  2. Select your FiveM server database.

  3. Execute the following SQL query:

-- Add a column to track total playtime (in minutes).
-- Updated when a player logs out.
ALTER TABLE `players` ADD `playtime` INT(11) NOT NULL DEFAULT 0;

-- Add a column to track the last played session.
-- Used for the "Highlight Last Played" feature.
ALTER TABLE `players` ADD `last_played` TIMESTAMP NULL DEFAULT NULL;

Last updated