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
- Copy
vms_gymout of the[vms_gym]folder into your resources. The[SQL]folder next to it is for you, not the server. - Make sure
mysql-asyncis present.fxmanifest.lualoads@mysql-async/lib/MySQL.luafirst inserver_scripts, and the server code talks to the database throughMySQL.Async. - Run a
cronresource. Membership expiry is scheduled withcron:runAtat 02:00, 04:00 and every second hour through the day; without it, passes never lapse. - Add items, and on ESX the jobs (next section).
- Ensure
vms_gymafter 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.sqland[ESX] jobs.sql. The jobs file createsgym1"Gym Plaza" andgym2"Gym Pump & Run", grades 0 to 3. - QBCore: merge
[QB] items.luaand[QB] jobs.luainto your shared files. - ox_inventory: use
[ox_inventory] items.lua. - Copy
protein.pngandrunbooster.pngfromitems imagesto 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.Coreis filled in by auto-detection:es_extendedgives ESX, elseqb-coregives QB-Core.Config.Menudefaults toesx_context. QBCore servers should pickqb-menuorox_lib;esx_menu_defaultis the other ESX option.Config.UseTargetisfalse. Set ittruewithConfig.TargetResourceasox_targetorqb-targetand the exercise markers disappear; the boss menu marker stays.- Movement modifiers:
Config.EnableStrenghtModifierandConfig.EnableStaminaModifierare on,Config.EnableRunSpeedModifieris 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.EnableSkillDrivingEffectsis on: low driving skill causes slides and random turns aboveConfig.SkillDrivingEffectMinimumSpeed(30.0, in the unit set byConfig.UnitOfSpeed,kmhby default).Config.AutoMembershipForEmployeesis on, so gym staff train free.Config.UseProgressbarandConfig.UseSkillbarare bothfalse. The sample skillbar function callstgiann-skillbar; swap in your own before enabling it.Config.Gymshas two examples.Gym_1(Gym Plaza) hasbusiness = falseandrequiredMembership = 'plaza_gym';Gym_2(Pump & Run) hasbusiness = trueand'pump_and_run'.- The stats menu is
+statisticson G. Its skill keys arestrenght,condition,shooting,drivingandflying; keep the studio's spelling ofstrenghtin anything you add. Config.Languagepicks from seven translations inconfig/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
- vms_gym & skills release thread, Cfx.re forum
- vms_gym changelog, VMS on GitHub
- vms_gym installation, VMS docs
- vames-dev/interact on GitHub
- Our inspection of the vms_gym download:
fxmanifest.lua,config/,client/client.lua,server/server.luaand[SQL]