Installation

1. Download Resource

Download the purchased resource from CFX Portal - the official site of FiveM with purchased resources.


2. Install Required Dependencies

This script needs a few extra resources to work properly. Below you will find a list of things to download - click the link, download and upload to your server just like other resources.

Resource
Download
Note

cron

Required for memberships

Resource
Download Link
Note

recoil

Not required but it is prepared for shooting skill


3. Import Database Tables

This is a very important step - without it, the script will not work properly. Depending on the framework you are using (ESX or QB-Core), select the appropriate section below and paste the SQL code into your database.

Not sure how to do it?

Database for ESX
ALTER TABLE users ADD COLUMN IF NOT EXISTS statistics LONGTEXT DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `gym_memberships` (
  `owner` varchar(70) DEFAULT NULL,
  `name` varchar(80) DEFAULT NULL,
  `time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `vms_business` (
  `id` varchar(50) NOT NULL DEFAULT '',
  `type` varchar(50) NOT NULL DEFAULT '',
  `owner` mediumtext DEFAULT NULL,
  `employees` longtext DEFAULT '{}',
  `stock` longtext DEFAULT '{}',
  `data` longtext DEFAULT '{}',
  `announcements` longtext DEFAULT '{}',
  `orders` longtext DEFAULT '{}',
  `history` longtext DEFAULT '{}'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
Database for QB-Core
ALTER TABLE players ADD COLUMN IF NOT EXISTS statistics LONGTEXT DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `gym_memberships` (
  `owner` varchar(70) DEFAULT NULL,
  `name` varchar(80) DEFAULT NULL,
  `time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `vms_business` (
  `id` varchar(50) NOT NULL DEFAULT '',
  `type` varchar(50) NOT NULL DEFAULT '',
  `owner` mediumtext DEFAULT NULL,
  `employees` longtext DEFAULT '{}',
  `stock` longtext DEFAULT '{}',
  `data` longtext DEFAULT '{}',
  `announcements` longtext DEFAULT '{}',
  `orders` longtext DEFAULT '{}',
  `history` longtext DEFAULT '{}'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

4. Add Required Items

The script uses its own items. Depending on what inventory you are using, select the appropriate section and add these items to either your item file or database.

Items for esx inventory
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
    ("protein", "Protein", 10, 0, 1),
    ("runbooster", "Run-Booster", 10, 0, 1);
Items for ox_inventory
['protein'] = {
    label = 'Protein',
    weight = 1,
    stack = true
},
['runbooster'] = {
    label = 'Run-Booster',
    weight = 1,
    stack = true
},
Items for qb-inventory / qs-inventory / origen_inventory
['protein'] = {
    ["name"] = 'protein',
    ["label"] = "Protein",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "protein.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = false,
    ["combinable"] = nil,
    ["description"] = ""
},
['runbooster'] = {
    ["name"] = 'runbooster',
    ["label"] = "Run-Booster",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "runbooster.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = false,
    ["combinable"] = nil,
    ["description"] = ""
},

5. Register Jobs

Some functions work only if the player has a proper job. In this section, you will find ready-made job that you need to add in your framework (ESX/QB).

Jobs for ESX
INSERT INTO `jobs` (name, label) VALUES
    ('gym1', 'Gym Plaza'),
    ('gym2', 'Gym Pump & Run');

INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
    ('gym1', 0, 'trainee', 'Trainee', 150, '{}', '{}'),
    ('gym1', 1, 'employee', 'Employee', 200, '{}', '{}'),
    ('gym1', 2, 'manager', 'Manager', 300, '{}', '{}'),
    ('gym1', 3, 'boss', 'Boss', 350, '{}', '{}'),
    
    ('gym2', 0, 'trainee', 'Trainee', 150, '{}', '{}'),
    ('gym2', 1, 'employee', 'Employee', 200, '{}', '{}'),
    ('gym2', 2, 'manager', 'Manager', 300, '{}', '{}'),
    ('gym2', 3, 'boss', 'Boss', 350, '{}', '{}')
;
Jobs for QB-Core
['gym1'] = {
    label = 'Gym Plaza',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {name = 'recruit', payment = 50},
        ['1'] = {name = 'employee', payment = 250},
        ['2'] = {name = 'manager', payment = 250},
        ['3'] = {name = 'boss', payment = 250},
    },
},
['gym2'] = {
    label = 'Gym Pump & Run',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {name = 'recruit', payment = 50},
        ['1'] = {name = 'employee', payment = 250},
        ['2'] = {name = 'manager', payment = 250},
        ['3'] = {name = 'boss', payment = 250},
    },
},

6. Start Resource

To start a resource in your server.cfg, ensure that it begins after your framework has been initiated. For instance, if you are using a framework like es_extended, you should start resource after it, like so:

start [core] # For example, here is your framework (esx/qb-core)
start cron

# Here you run your other resources like esx_policejob etc.

# VMS Resources
start vms_gym
start recoil # (Optional)

Ensure there are no syntax errors or incorrect paths in your server.cfg.

Last updated

Was this helpful?