Database Setup
To store additional data for playtime and last played sessions in your database, follow these steps:
Adding Columns to the players
Table
players
TableOpen your database management tool (e.g., HeidiSQL, phpMyAdmin, DBeaver).
Select your FiveM server database.
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