Short version: start mysql-async, your framework and a cron resource before vms_gym; let the resource create its own tables or run the files in [SQL]; add the protein and runbooster items (and on ESX, the two gym jobs); then set the menu, target and anti-cheat switches in config/config.lua. The rest is gym placement.

This is our own reading of the Gym & Skills download sold on the product page, not a copy of the studio's docs. We inspected the files; we have not run it on a live server. Read it as a guide to what the code asks for, not as a test report.

Install checklist

  1. Copy vms_gym out of the [vms_gym] folder into your resources. The [SQL] folder next to it is for you, not the server.
  2. Make sure mysql-async is present. fxmanifest.lua loads @mysql-async/lib/MySQL.lua first in server_scripts, and the server code talks to the database through MySQL.Async.
  3. Run a cron resource. Membership expiry is scheduled with cron:runAt at 02:00, 04:00 and every second hour through the day; without it, passes never lapse.
  4. Add items, and on ESX the jobs (next section).
  5. Ensure vms_gym after all of the above.

The manifest also carries dependency '/assetpacks', the line FiveM's asset escrow adds; leave it alone. Its escrow_ignore block lists config/.lua, client/.lua and server/*.lua, so the Lua in this build is readable and editable, and only the other files are locked. The manifest version reads 2.0.1; VMS has since released 2.0.2 with a UseEquipment export.

Tables, items and jobs

With Config.AutoExecuteQuery = true (the default), server/server.lua handles the schema on start. It runs ALTER TABLE users (ESX) or ALTER TABLE players (QBCore) to add a statistics LONGTEXT column, then CREATE TABLE IF NOT EXISTS for vms_business and, with memberships on, gym_memberships. Each configured gym without a row gets one inserted in vms_business.

Prefer to run SQL yourself? Set it to false and use gym_memberships.sql (columns owner, name, time), vms_business.sql, and [ESX] statistics.sql or [QB-Core] statistics.sql.

Items and jobs are never inserted by the code:

  • ESX: import [ESX] items.sql and [ESX] jobs.sql. The jobs file creates gym1 "Gym Plaza" and gym2 "Gym Pump & Run", grades 0 to 3.
  • QBCore: merge [QB] items.lua and [QB] jobs.lua into your shared files.
  • ox_inventory: use [ox_inventory] items.lua.
  • Copy protein.png and runbooster.png from items images to your inventory's image folder.

One mismatch to fix on ESX: the jobs SQL names grade 0 trainee, while grades_access for both gyms lists recruit, employee, manager, boss. The QBCore jobs file uses recruit, so only ESX needs the edit, in either file.

config/config.server.lua makes both items usable on ESX and QBCore. Protein fires the strength booster at 3.0x for 360000 ms (six minutes); the run booster fires condition at 4.0x for 300000 ms (five minutes).

Switches in config.lua worth deciding first

  • Config.Core is filled in by auto-detection: es_extended gives ESX, else qb-core gives QB-Core.
  • Config.Menu defaults to esx_context. QBCore servers should pick qb-menu or ox_lib; esx_menu_default is the other ESX option.
  • Config.UseTarget is false. Set it true with Config.TargetResource as ox_target or qb-target and the exercise markers disappear; the boss menu marker stays.
  • Movement modifiers: Config.EnableStrenghtModifier and Config.EnableStaminaModifier are on, Config.EnableRunSpeedModifier is off. The comments above them warn that some anti-cheats flag altered strength or running speed as cheating; check yours before switching anything on.
  • Config.EnableSkillDrivingEffects is on: low driving skill causes slides and random turns above Config.SkillDrivingEffectMinimumSpeed (30.0, in the unit set by Config.UnitOfSpeed, kmh by default).
  • Config.AutoMembershipForEmployees is on, so gym staff train free.
  • Config.UseProgressbar and Config.UseSkillbar are both false. The sample skillbar function calls tgiann-skillbar; swap in your own before enabling it.
  • Config.Gyms has two examples. Gym_1 (Gym Plaza) has business = false and requiredMembership = 'plaza_gym'; Gym_2 (Pump & Run) has business = true and 'pump_and_run'.
  • The stats menu is +statistics on G. Its skill keys are strenght, condition, shooting, driving and flying; keep the studio's spelling of strenght in anything you add.
  • Config.Language picks from seven translations in config/config.translation.lua: EN, CZ, DE, FR, ES, PT, PL.

Notifications, text prompts and business money

config/config.client.lua sends notifications to vms_notify if it is started, else to your framework's own. Text prompts try interact (the studio's free resource), then okokTextUI, then the framework.

Business gyms keep their balance inside vms_business while Config.UseBuildInCompanyBalance in config/config.management.lua is true. Set it to false and the society functions in config/config.server.lua move money through cs_bossmenu, okokBanking, qb-banking, qb-management or esx_addonaccount, whichever is running. The same management file has resume and tax options for servers using vms_cityhall.

SV.Webhooks at the top of config/config.server.lua holds placeholder Discord URLs for bonuses, grade changes, hires, fires, withdrawals, deposits and announcements. Fill in the ones you want.

Hooking your own scripts in

getSkill, addSkill and removeSkill are exported on both sides (the server versions take a player source first), and the client adds openStatisticsMenu. The server also exports getCompanyMoney, addCompanyMoney, removeCompanyMoney and sendAnnouncement. For a working example, the driving effect in config/config.client.lua reads exports['vms_gym']:getSkill('driving').

Once that is done the resource is ready for a first start. The listing is Gym & Skills, and other resources from Vames are on the VMS studio page.

Sources