Gym Creator 2.0 replaces Realistic Gym (qs-gym 1.x). It is a rewrite, not an update: the single gym defined in the old config becomes any number of gyms built in game, and player data moves from the old gym_data table to the new qs_gym_player_data. The queries on this page carry your players' strength and stamina across, so nobody loses their progress.
From 1.x | In 2.0 |
|---|---|
Strength and stamina | Carried over by the migration query. |
Active memberships | Optional — the old system had one global gym, the new one has a membership per gym. See step 5. |
Gym location, reception NPCs and exercise points in | Not carried over. Rebuild them with |
The | Kept untouched until you drop it yourself. |
Upgrading Step by Step#
Stop the server and back up the database
Export the whole database, or at least
gym_data, with HeidiSQL, phpMyAdmin or your panel's backup tool.Remove Realistic Gym
Delete the old
qs-gymfolder from your resources and remove itsensureline fromserver.cfg. Two versions running side by side would both spawn NPCs and write the same native stats.Install Gym Creator
Follow Installation: copy the new folder, add it to
server.cfgafter your framework, and importdatabase/database.sql.Copy strength and stamina
Realistic Gym kept each character in one row of
gym_data: the character id incitizenidand everything else as JSON indata. Run this query in the same database — it reads both stats out of the JSON, rounds them down and keeps them between 0 and 100:sql INSERT IGNORE INTO `qs_gym_player_data` (identifier, strength, stamina, last_decay) SELECT citizenid, LEAST(100, GREATEST(0, FLOOR(CAST(COALESCE(JSON_UNQUOTE(JSON_EXTRACT(`data`, '$.strength')), '0') AS DECIMAL(10,2))))), LEAST(100, GREATEST(0, FLOOR(CAST(COALESCE(JSON_UNQUOTE(JSON_EXTRACT(`data`, '$.stamina')), '0') AS DECIMAL(10,2))))), 0 FROM `gym_data` WHERE citizenid IS NOT NULL AND `data` IS NOT NULL;It is safe to run more than once: players who already have a row are skipped. Both versions identify a character the same way — the ESX
identifier, or the QBCore / Qboxcitizenid— so every row lands on the right character.Optional: keep active memberships
Start the server, build your first gym with
/gymcreatorand note its id — it appears in the editor's title, Edit gym #1. Then run this query with@default_gym_idset to that id. Everybody whose 1.x membership has not expired yet keeps the same expiry date, on that gym:sql SET @default_gym_id = 1; UPDATE `qs_gym_player_data` p INNER JOIN `gym_data` g ON p.identifier = CONVERT(g.citizenid USING utf8mb4) COLLATE utf8mb4_unicode_ci SET p.membership_gym_id = @default_gym_id, p.membership_expiry = CAST(JSON_UNQUOTE(JSON_EXTRACT(g.`data`, '$.membershipExpiry')) AS UNSIGNED) WHERE CAST(COALESCE(JSON_UNQUOTE(JSON_EXTRACT(g.`data`, '$.membershipExpiry')), '0') AS UNSIGNED) > UNIX_TIMESTAMP();Rebuild your gyms
Use
/gymcreatorto place the gyms you had: the blip, the receptionist, a station for each exercise and, if you use no MLO, the benches and weights around them. Usage covers each panel.Drop the old table
Once you have checked a few players in game —
F10shows their stats — remove the old table:sql DROP TABLE gym_data;
Both queries need JSON functions, available in MySQL 5.7+ and MariaDB 10.2+ — every version oxmysql supports. If you get
Unknown column 'identifier', you ran a query written for a different table layout; use the ones on this page.
What Changed for Players#
A gym is now a place on the map with its own receptionist, price and membership length — a server can have a cheap public gym and an expensive premium one.
A membership belongs to one gym. Buying one at another gym moves it there.
Stats still go from 0 to 100 and still feed GTA's native strength and stamina, but each gym decides how much a workout gives and whether its members decay overnight.
A completed set gives a fixed reward, set per exercise or per station, instead of a random range.
The 1.x bench and dumbbells exercises are not in the 2.0 catalogue. Push-ups, sit-ups, chin-ups and barbell curls are, alongside the new boxing bag and treadmill — and you can add your own in
config/exercises.lua(see Usage).F10toggles a small HUD with both stats.



