Configuration

This section includes all configurable files for the selected script. Most settings are configured automatically, but each config.lua file contains a header comment explaining the purpose and usage of every configuration type. Be sure to read the header of each file carefully to fully understand how to customize and adapt the system for QBCORE, ESX, or standalone environments, ensuring seamless integration with your server.


qs-gym/shared/config.lua
function debugPrint(message)
    if Config and Config.Debug then
        print("[Quasar Gym]: " .. message)
    end
end

function checkDependencies(resourceTable)
    for resourceName, frameworkId in pairs(resourceTable) do
        local state = GetResourceState(resourceName)
        if state:find('started') ~= nil then
            debugPrint("Found matching dependency: " .. resourceName .. " with ID: " .. frameworkId)
            return frameworkId
        end
    end
    debugPrint("No matching dependencies found")
    return false
end

local frameworks = {
    ['es_extended'] = 'esx',
    ['qb-core'] = 'qbcore',
    ['qbx_core'] = 'qbox'
}

local targets = {
    ['ox_target'] = 'ox_target',
    ['qb-target'] = 'qb-target',
    ['qs-textui'] = 'qs-textui'
}

Config = {}

Config.Debug = false

Config.Framework = checkDependencies(frameworks) or 'standalone'

Config.UseTarget = true -- qs-textui will be seen as a targetsystem
Config.Target = checkDependencies(targets) or 'standalone'

Locales = Locales or {}

--[[
    Choose your preferred language!

    In this section, you can select the main language for your asset. We have a wide
    selection of default languages available, located in the locales/* folder.

    If your language is not listed, don't worry! You can easily create a new one
    by adding a new file in the locales folder and customizing it to your needs.

    🌐 Default languages available:
        'ar'     -- Arabic
        'bg'     -- Bulgarian
        'ca'     -- Catalan
        'cs'     -- Czech
        'da'     -- Danish
        'de'     -- German
        'el'     -- Greek
        'en'     -- English
        'es'     -- Spanish
        'fa'     -- Persian
        'fr'     -- French
        'hi'     -- Hindi
        'hu'     -- Hungarian
        'it'     -- Italian
        'ja'     -- Japanese
        'ko'     -- Korean
        'nl'     -- Dutch
        'no'     -- Norwegian
        'pl'     -- Polish
        'pt'     -- Portuguese
        'ro'     -- Romanian
        'ru'     -- Russian
        'sl'     -- Slovenian
        'sv'     -- Swedish
        'th'     -- Thai
        'tr'     -- Turkish
        'zh-CN'  -- Chinese (Simplified)
        'zh-TW'  -- Chinese (Traditional)

    After selecting your preferred language, be sure to save your changes and test
    the asset to ensure everything works as expected!
]]

Config.Language = 'en'

Config.MembershipPrice = 2500

Config.StatsHUDKey = "F10"

Config.ExerciseUIPosition = "left" -- "left" or "right"

Config.StatDecay = {
    enabled = true,         -- Enable/disable daily stat decay
    hour = 22,              -- Hour to run decay (24-hour format, 0-23)
    minute = 0,             -- Minute to run decay (0-59)
    amount = 5              -- Amount to decrease stats by (percentage points)
}

Config.GymBlip = {
    enabled = true,
    coords = vector3(-1201.14, -1565.23, 4.61),
    sprite = 311,
    color = 3,
    scale = 0.8,
    name = "Quasar Gym",
    shortRange = true
}

Config.ReceptionNPC = {
    model = "a_f_y_fitness_01",
    coords = vector4(-1195.32, -1577.64, 4.61, 119.6949),
    label = "LABEL_PURCHASE_MEMBERSHIP"
}

Config.GymObjects = {
    -- ["treadmill"] = {
    --     enabled = true,
    --     model = "add_custom_model_treadmill",
    --     coords = vector3(-1199.6661, -1563.3497, 3.6195),
    --     heading = 125.4344
    -- }
}

Config.Exercises = {
    ["pushups"] = {
        label = "LABEL_PUSHUPS",
        stamina = {min = 1, max = 3},
        strength = {min = 2, max = 4},
        idleDict = "amb@world_human_push_ups@male@idle_a",
        idleAnim = "idle_c",
        actionDict = "amb@world_human_push_ups@male@base",
        actionAnim = "base",
        actionTime = 1100,
        enterDict = "amb@world_human_push_ups@male@enter",
        enterAnim = "enter",
        enterTime = 3050,
        exitDict = "amb@world_human_push_ups@male@exit",
        exitAnim = "exit",
        exitTime = 3400,
        actionProcent = 1,
        actionProcentTimes = 20,
        frozen = false
    },
    ["situps"] = {
        label = "LABEL_SITUPS",
        stamina = {min = 2, max = 4},
        strength = {min = 1, max = 2},
        idleDict = "amb@world_human_sit_ups@male@idle_a",
        idleAnim = "idle_a",
        actionDict = "amb@world_human_sit_ups@male@base",
        actionAnim = "base",
        actionTime = 3400,
        enterDict = "amb@world_human_sit_ups@male@enter",
        enterAnim = "enter",
        enterTime = 4200,
        exitDict = "amb@world_human_sit_ups@male@exit",
        exitAnim = "exit",
        exitTime = 3700,
        actionProcent = 1,
        actionProcentTimes = 20,
        frozen = false
    },
    ["chinups"] = {
        label = "LABEL_CHINUPS",
        stamina = {min = 1, max = 2},
        strength = {min = 3, max = 5},
        idleDict = "amb@prop_human_muscle_chin_ups@male@idle_a",
        idleAnim = "idle_a",
        actionDict = "amb@prop_human_muscle_chin_ups@male@base",
        actionAnim = "base",
        actionTime = 3000,
        enterDict = "amb@prop_human_muscle_chin_ups@male@enter",
        enterAnim = "enter",
        enterTime = 1600,
        exitDict = "amb@prop_human_muscle_chin_ups@male@exit",
        exitAnim = "exit",
        exitTime = 3700,
        actionProcent = 1,
        actionProcentTimes = 20,
        frozen = false
    },
    ["bench"] = {
        label = "LABEL_BENCH",
        stamina = {min = 2, max = 4},
        strength = {min = 3, max = 5},
        idleDict = "amb@prop_human_seat_muscle_bench_press@base",
        idleAnim = "base",
        actionDict = "amb@prop_human_seat_muscle_bench_press@idle_a",
        actionAnim = "idle_a",
        actionTime = 2350,
        enterDict = "amb@prop_human_seat_muscle_bench_press@enter",
        enterAnim = "enter",
        enterTime = 0,
        exitDict = "amb@prop_human_seat_muscle_bench_press@exit",
        exitAnim = "exit",
        exitTime = 2500,
        actionProcent = 1,
        actionProcentTimes = 20,
        prop = "prop_barbell_60kg",
        propAttachment = {
            bone = 28422,
            x = 0.0, y = 0.0, z = 0.0,
            xRot = 0.0, yRot = 0.0, zRot = 0.0
        },
        frozen = false
    },
    ["barbell"] = {
        label = "LABEL_BARBELL",
        stamina = {min = 2, max = 3},
        strength = {min = 2, max = 3},
        idleDict = "amb@world_human_muscle_free_weights@male@barbell@idle_a",
        idleAnim = "idle_a",
        actionDict = "amb@world_human_muscle_free_weights@male@barbell@base",
        actionAnim = "base",
        actionTime = 4500,
        actionProcent = 1,
        actionProcentTimes = 20,
        prop = "prop_curl_bar_01",
        propAttachment = {
            bone = 28422,
            x = 0.0, y = 0.0, z = 0.0,
            xRot = 0.0, yRot = 0.0, zRot = 0.0
        },
        frozen = false
    },
    ["dumbbells"] = {
        label = "LABEL_DUMBBELLS",
        stamina = {min = 1, max = 2},
        strength = {min = 1, max = 2},
        idleDict = "amb@world_human_muscle_free_weights@male@barbell@idle_a",
        idleAnim = "idle_a",
        actionDict = "amb@world_human_muscle_free_weights@male@barbell@base",
        actionAnim = "base",
        actionTime = 4500,
        actionProcent = 1,
        actionProcentTimes = 20,
        prop = "prop_barbell_01",
        propAttachment = {
            bone = 28422,
            x = -0.24, y = 0.0, z = -0.03,
            xRot = 0.0, yRot = -50.0, zRot = 0.0
        },
        prop2 = {
            name = "prop_barbell_01",
            attachBone = 60309,
            placement = {0.05, 0.0, 0.0, 0.0, -90.0, 120.0}
        },
        frozen = false
    },
    -- ["treadmill"] = {
    --     label = "LABEL_TREADMILL",
    --     stamina = {min = 3, max = 5},
    --     strength = {min = 0, max = 1},
    --     idleDict = "move_m@hurry@c",
    --     idleAnim = "walk",
    --     actionDict = "move_m@brave@a",
    --     actionAnim = "run",
    --     actionTime = 4000,
    --     actionProcent = 1,
    --     actionProcentTimes = 20,
    --     frozen = true
    -- },
}

Config.ExerciseLocations = {
    {coords = vector3(-1200.08, -1571.15, 4.5), heading = 214.37, exercise = "chinups"},
    {coords = vector3(-1204.74, -1564.35, 4.5), heading = 38.83, exercise = "chinups"},
    {coords = vector3(-1205.0118408203, -1560.0671386719, 4.5), heading = nil, exercise = "situps"},
    {coords = vector3(-1203.3094482422, -1570.6759033203, 4.5), heading = nil, exercise = "pushups"},

    -- {coords = vector3(-1199.6079, -1563.6073, 4.5), heading = 305.0785, exercise = "treadmill"},

    {coords = vector3(-1201.55, -1562.81, 4.5), heading = 125.29, exercise = "bench", activityCoord = vector4(-1200.64, -1562.11, 3.10, 125.29)},
    {coords = vector3(-1206.53, -1561.62, 4.5), heading = 212.49, exercise = "bench", activityCoord = vector4(-1207.11, -1560.81, 3.10, 212.49)},
    {coords = vector3(-1200.68, -1575.89, 4.5), heading = 216.27, exercise = "bench", activityCoord = vector4(-1201.3, -1575.02, 3.10, 216.27)},
    {coords = vector3(-1197.13, -1567.6, 4.5), heading = 305.69, exercise = "bench", activityCoord = vector4(-1197.96, -1568.22, 3.10, 305.69)},

    {coords = vector3(-1198.97, -1574.5, 4.5), heading = 215.48, exercise = "barbell"},
    {coords = vector3(-1197.01, -1572.9, 4.5), heading = 214.71, exercise = "barbell"},
    {coords = vector3(-1210.31, -1561.34, 4.5), heading = 77.1, exercise = "barbell"},

    {coords = vector3(-1202.6, -1572.78, 4.5), heading = 127.31, exercise = "dumbbells"},
    {coords = vector3(-1209.33, -1559.18, 4.5), heading = 48.95, exercise = "dumbbells"},
    {coords = vector3(-1198.32, -1565.41, 4.5), heading = 240.3, exercise = "dumbbells"}
}