Skip to content

Configuration

Every Cuxial Gym option: shared/config.lua, the data/ files and what is edited in game.

Cuxial Gym is tuned in three places: shared/config.lua for behaviour, the data/ files for the gym and factory values, and the /gymadmin panel for live balancing. Restart the resource after changing a file.

Fatigue, stats, body parts, streaks, achievements, exercise values, supplements and tutorial are also edited in game with /gymadmin. What you save there is stored in the database and fully replaces that section of the data/ file until you reset it from the panel.

General ​

OptionTypeDefaultWhat it does
debugbooleanfalseConsole traces, SQL detail and the /gymaudio and /gymmap test commands. Also enabled with the cuxial_gym_debug convar set to 1.

Modules · modules ​

OptionTypeDefaultWhat it does
shopbooleantrueDrinks and supplements shop.
helperbooleantrueSpotter: another player can assist a set.
adminbooleantrueStaff settings panel and the /gymadmin command.

Interface · ui ​

OptionTypeDefaultWhat it does
brandstring'IRONPULSE'Brand name shown on the tablet and panels.
logostring'brand/ironpulse.webp'Interface logo, as a path inside web/dist/img/.
accentstring (hex)configurableInterface accent colour.
currency.symbolstring'$'Currency symbol next to amounts.
currency.localestring'es-ES'Number format for amounts, as a language code ('en-US', 'es-ES'...).

To use your own brand, copy your logo into web/dist/img/ and change brand, logo and accent. Nothing else in the interface needs to change.

Interface sounds · sounds ​

Volumes from 0.0 to 1.0.

OptionTypeDefaultWhat it does
masternumber1.0Multiplies all the others.
clicknumber0.35Click.
startnumber0.6Set start.
successnumber0.7Success.
failnumber0.7Failure.

Exercise sounds · audio ​

Native in-world sounds while training. They come from cuxial_gym_assets.

OptionTypeDefaultWhat it does
enabledbooleantruefalse mutes exercise sounds.
networkedbooleanfalsetrue lets nearby players hear the character's impacts and breathing.
volumenumber1.0Factor on the base volume of each sound (0-1).
debugCommandstring'gymaudio'With debug, /gymaudio oneshots or /gymaudio loops plays a whole bank.
breath.everynumber3The character breathes every N reps.
breath.delayMsnumber600Breath delay from the start of the rep (ms).

banks, breath.male, breath.female, rep and loops are the sound names in the assets pack; each exercise picks its own in its file.

Logs · logs ​

OptionTypeDefaultWhat it does
convarstring'cuxial_gym_webhook'Server convar holding the Discord webhook URL.
exercisebooleantrueLogs every finished set.
batchMinutesnumber5Sets are grouped and sent every N minutes.

Staff · admin ​

OptionTypeDefaultWhat it does
permissionstring'admin'Framework permission that opens the settings panel and the staff commands.
auditDaysnumber60Days the staff action log is kept.

Anti-spam limits · rateLimits ​

Each entry is { requests, window_ms }: the maximum requests of that kind a player can make within the window. Above it, the request is rejected.

OptionDefaultAction
default{ 10, 10000 }Any action without its own entry
sync{ 6, 10000 }Request the config or player data
openGym{ 3, 10000 }Open the gym panel
membership{ 5, 10000 }Buy the membership
perk{ 5, 10000 }Unlock a perk
exercise{ 5, 10000 }Start and stop a set
rep{ 20, 10000 }Each rep
phase{ 12, 5000 }Animation phases of each rep
effects{ 3, 10000 }Clear effort effects on going down
help{ 5, 10000 }Start and stop spotting
helpResult{ 20, 10000 }Spotter minigame
supplement{ 5, 10000 }Take a supplement
shopOpen{ 5, 10000 }Open the shop
shopBuy{ 10, 10000 }Buy or pay the cart
admin{ 20, 10000 }Settings panel

Commands · commands ​

Each command has a name. Set another name to rename it, or false to disable it.

OptionDefaultCommand
admin.name'gymadmin'Settings panel
effects.name'gymfx'Effort effects test
level.name'gymnivel'Set level or attribute
max.name'gymmax'Attributes to 100 %

Usage of each one in Commands & permissions.

Keys · keys ​

Default keys. Each player can change them in the FiveM key bindings.

OptionDefaultWhat it does
cancel'X'Leaves the set or stops spotting.
sprint'LSHIFT'Sprint; triggers the Endurance stamina regeneration.
climb'SPACE'Jump; triggers the Speed fast climbing.

Items · items ​

OptionTypeDefaultWhat it does
imageUrlstring'nui://ox_inventory/web/images/%s.webp'Item image in the interface. %s is the item name.

World · world ​

OptionTypeDefaultWhat it does
tickMsnumber1000How often the script checks whether the player is in the gym zone (ms).
mapFindRadiusnumber0.15Radius used to find each map equipment at its position (m).
mapDebugCommandstring'gymmap'With debug, /gymmap lists the equipment found and its offset.
blockScenariosbooleanfalsetrue removes the NPCs working out in the zone.

Panel · panel ​

OptionTypeDefaultWhat it does
maxDistancenumber10.0Maximum distance to the tablet to use the panel (m).
leaderboardSizenumber10Leaderboard rows.
leaderboardSecondsnumber60Seconds the leaderboard is cached.

Tablet · tablet ​

OptionTypeDefaultWhat it does
duibooleantruetrue draws the panel on the glass of the gym screen. false opens it as a full-screen interface.
modelstring'cuxial_gym_screen'Screen prop. Its position is in data/gym.lua.
txd / texturestring'cuxial_gym_screen' / 'cuxial_gym_screen_dui'Glass texture replaced while in use.
offset, yaw, pitch, width, height—fitted to the propCentre, rotation, tilt and size of the glass. Change them only if you use another prop.
maxDistancenumber3.0Maximum distance to keep using the screen (m).
releaseMsnumber10000Wait after leaving the screen before its browser is released (ms).
overlaybooleanfalsetrue draws the screen over the glass without world lighting.
pixelsnumber921600Pixels of the screen browser; width and height follow the glass ratio.
camera.distancenumber1.1Camera distance in front of the glass (m).
camera.frametable{ width = 1.028, height = 0.720 }Camera framing (m).
camera.marginnumber1.05Margin over the framing.
camera.fovnumber | falsefalseFixed FOV; false derives it from the framing.
drawCursorbooleanfalsetrue also draws the pointer inside the screen.
wheelStepnumber120Scroll per wheel notch; a negative value inverts it.
exitKeysstring[]{ 'Escape', 'Backspace' }Keys that close the screen.

Minigame · minigame ​

OptionTypeDefaultWhat it does
ui.positionstring'bottom-right'Minigame corner: 'bottom-right', 'bottom-left', 'top-right', 'top-left' or 'center'.
ui.scalenumber0.8Scale; 1 is natural size.
ui.offsettable{ x = 24, y = 24 }Distance from the edge (px).

Membership · membership ​

OptionTypeDefaultWhat it does
accountstring'cash'Account charged.
pricenumber1000Price before the level discount.
daysnumber7Pass days per purchase.
requiredbooleantruetrue requires an active pass to train. false lets everyone train.

Exercise · exercise ​

OptionTypeDefaultWhat it does
anchorModelstring'prop_tick'Invisible model that syncs the equipment over the network.
startDistancenumber4.0Maximum distance to the equipment to start (m).
maxDistancenumber6.0If the player moves further away, the set ends (m).
minRepMsnumber1500Minimum time between reps (ms).
minigameMinMsnumber1500Minimum accepted minigame duration (ms).
autoPassMsnumber500Minimum duration of an auto-passed minigame (ms).
minigameEverynumber2A minigame in one of every N reps. The first rep of the set always has one.
maxFailsnumber3Consecutive failed minigames that end the set. The failed rep does not count.
toleranceMsnumber250Network margin for timing checks (ms).
idleTimeoutSecondsnumber120With no reps for this long, the server closes the set (s).
defaultMaxRepsnumber20Rep limit if the exercise does not declare one.
requestTimeoutMsnumber10000If the server does not answer in time, the set closes and controls are released (ms).
targetDistancenumber2.0Interaction distance for the equipment (m).
lockdown.allowednumber[]camera, movement and chat, among othersControls left free during the set and while spotting.
lockdown.blockednumber[]{ 199, 200, 322 }Controls always blocked during the set.
lockdown.pauseMenubooleanfalsetrue allows opening the pause menu while training.

Bonus caps · bonuses ​

Caps on the sum of supplements, streak and perks.

OptionTypeDefaultWhat it does
maxMinigameChancenumber90Maximum chance to skip the minigame (%).
maxXpBonusnumber200Maximum extra XP (%).
maxConditionBonusnumber200Maximum extra condition per rep (%).
maxFatigueReductionnumber50Maximum fatigue reduction per rep (%).

Stats · stats ​

OptionTypeDefaultWhat it does
baseMaxHealthnumber200Character base max health, before the Strength bonus.
xpBonusToStatsbooleanfalsetrue also applies the supplement and streak XP bonus to level XP. With false only perks do.
healthGuardMsnumber15000If another resource changes max health, the Strength bonus is restored after this margin (ms).

Level, condition and the effects of each attribute live in data/defaults.lua (below).

Downed player · vital ​

OptionTypeDefaultWhat it does
bagsstring[]{ 'isDead', 'cuxial:state' }Player state bags that mark them as downed. Add your medical system's one.
downValuestable{ true, 'dead', 'laststand' }Values of those state bags that count as downed. Going down ends the set; max health is restored on getting up.

Perks · perks ​

OptionTypeDefaultWhat it does
enabledbooleanfalsetrue enables the perk tree in data/perks.lua and its tab on the tablet.
xpPerPointnumber500Training XP per perk point.

Supplements · supplements ​

OptionTypeDefaultWhat it does
useMsnumber4000Progress bar duration when taking one (ms).
stackSamebooleanfalsetrue adds up two doses of the same supplement. With false, the new one replaces the previous one and renews the duration.
anim.drinktabledrink from bottleAnimation for drinks that do not declare their own.
anim.supplementtableshake and drinkAnimation for supplements that do not declare their own.

Spotter · helper ​

OptionTypeDefaultWhat it does
maxDistancenumber3.0Maximum distance between the spotter and the player training (m).
animSwapMstable{ 10000, 15000 }How often the spotter animation changes, minimum and maximum (ms).
extraDistancenumber1.0Margin over maxDistance accepted by the server (m).
repsnumber2Free reps per spotter minigame beaten.

Tutorial · tutorial ​

OptionTypeDefaultWhat it does
enabledbooleantrueGuided tour the first time the tablet opens. This is the factory value; it can also be changed in /gymadmin.

Preview videos · previews ​

OptionTypeDefaultWhat it does
enabledbooleanfalsetrue shows a video of each exercise in the catalogue.
baseUrlstring''Base URL. The video is baseUrl .. clip .. extension.
extensionstring'.mp4'Video extension.
clipsstring[]{}Available clips.

Compatibility · compat ​

For resources that use the AddSkillToPlayer, GetPlayerSkills and MaxAllSkills exports.

OptionTypeDefaultWhat it does
skillstable{ Strength = 'strength', Stamina = 'endurance', Running = 'speed' }Skill received by the export → gym attribute (strength, endurance, speed, lungs or combat).
xpPerPointnumber10Level XP per skill point.
maxSkillsItemsstring[]{ 'gym_max_power' }Items that set all five attributes to 100 % through MaxAllSkills.

Shop · shop ​

OptionTypeDefaultWhat it does
accountstring'cash'Payment account.
maxCartLinesnumber30Maximum cart lines.
maxAmountnumber100Maximum units per line.
itemstablesix drinks and supplementsCatalogue: { item, price, label?, image? }. Without label or image, the inventory ones are used.

The final price includes the level discount from data/defaults.lua.

shared/config.lua
lua
shop = {
    account = 'bank',
    maxCartLines = 30,
    maxAmount = 100,
    items = {
        { item = 'gym_hydration_station', price = 40 },
        { item = 'gym_mass_gainer', price = 600, label = 'Mass Gainer XL' },
    },
},

Effort effects · effects ​

Face · effects.face ​

OptionTypeDefaultWhat it does
enabledbooleantrueThree-level effort face during the set and an exhausted face after a hard set.
hardFatigue / maxFatiguenumber50 / 80Main body part fatigue that moves to effort 2 and 3 (0-100).
hardProgress / lastProgressnumber0.6 / 0.9Set progress that moves to effort 2 and 3 (0-1).
tiredFatiguenumber70Fatigue at the end from which the exhausted face appears (0-100).
tiredMsnumber20000Exhausted face duration (ms).
replayMsnumber2500How often the expression is replayed for other players (ms).

dicts, fallback, clips, fallbackClips and tiredDicts are the native facial animations used.

Voice · effects.voice ​

OptionTypeDefaultWhat it does
enabledbooleantruePanting and grunting with the audio.breath sounds.
volumenumber1.0Volume (0-1).
cooldownMsnumber4000Minimum time between two sounds (ms).
chancenumber[]{ 35, 60, 100 }Chance per rep at effort levels 1, 2 and 3 (%).
soundsnumber[]{ 1, 1, 2, 2 }Breath sound (1 or 2) per effort level 1-4.
withBreathnumber3Minimum level on exercises that already breathe on their own.

Exhaustion · effects.exhaustion ​

OptionTypeDefaultWhat it does
enabledbooleantrueAfter a hard set: less stamina and a darkened screen.
durationMsnumber180000Duration (ms).
tickMsnumber5000Countdown interval (ms).
restFactornumber2.0At rest, time runs down this many times faster.
restSpeednumber0.5Maximum speed that counts as resting (m/s).
supplementCutnumber0.5Share of the remaining time removed by a supplement (0-1).
staminanumber0.6Max stamina multiplier while it lasts.
timecyclestring'rply_vignette'Screen filter; '' for none.
strengthnumber0.35Initial filter strength, which fades (0-1).
postfxstring''Extra screen effect; '' for none.

Native stats · effects.gameStats ​

OptionTypeDefaultWhat it does
enabledbooleantrueWrites the native GTA stats (0-100): stamina, lung capacity and shooting come from Endurance, Lungs and Combat.
slotstring'MP0'Stats slot: 'MP0' or 'MP1'.
fixedtable{ STRENGTH = 0 }Stats with a fixed value for everyone. Native strength stays at 0 because damage is handled by the Strength attribute.

Panel caps · limits ​

OptionTypeDefaultWhat it does
supplementsnumber64Maximum supplements saved from the panel.
effectsnumber8Maximum effects per supplement.
achievementsnumber200Maximum achievements.

Data files ​

All of them are in data/ and ship with the values for the included gym.

FileContentEdited in /gymadmin
gym.luaThe gym: name, zone polygon, blip, tablet position and every map equipment with its exercises and minigames.No
exercises.lua and exercises/*.luaCatalogue order and one file per exercise: category, body part, fatigue, XP, attribute split, rep limit, animations and sounds.Values (XP, fatigue, reps, split)
minigames.luaThe 13 minigames and their settings across the 8 difficulty levels.No
defaults.luaGlobal fatigue, level and XP curve, condition, each attribute's effects, level discount, inactivity loss and streaks.Yes
bodyparts.luaThe seven body parts: fatigue cap and recovery per minute.Yes
supplements.luaDrinks and supplements: item, kind, duration, effects, prop and animation.Yes
achievements.luaAchievements: counter, tier, target and icon.Yes
perks.luaPerk tree: bonus, value, cost and prerequisite.No
helper.luaSpotter animations.No
hints.luaOn-screen key hints during the set and while spotting.No

The gym · data/gym.lua ​

equipment lists the equipment that is part of the cuxial_gym_assets map. The script finds each one by model at its position; there is no need to create them. For each piece you can change its exercises and minigames:

data/gym.lua
lua
minigames = {
    { id = 'rhythm', min = 1, max = 4 },
    { id = 'grip', min = 2, max = 6 },
},

min and max are the difficulty (1-8) at the start and at the end of the set. The name (label) and the blip (blip.enabled, sprite, color, scale) are also changed here.

Do not move the equipment or zone coordinates: they are fitted to the included map. If a piece is no longer found, enable debug and use /gymmap to see its offset.

Level, condition and effects · data/defaults.lua ​

  • Overall level. stats.levelCap (100), baseXpToNext (100 XP from level 1 to 2), xpMultiplier (×1.15 per level) and baseXpPerRep (5).
  • Condition of each attribute, from 0 to 100 %. It rises with each rep following the exercise's split (condition.perRep, plus levelBonus by level) and drops continuously, offline too: percent (30 %) every hours (12 h).
  • Effects of each attribute by condition, as interpolated { level, value } points: extra max health and melee damage (Strength), stamina and regeneration (Endurance), sprint and climbing (Speed), swimming and lung capacity (Lungs), knockdown resistance and aim (Combat; aim applies with recoilEnabled = true).
  • Level discount in the shop and on the membership: 5 % at level 25, 10 % at 50 and 20 % at 100.
  • Level loss from inactivity (decay): off by default.
  • Streaks: minRepsPerDay (15) and the XP bonuses for consecutive days, from 5 % at 3 days to 50 % at 60.

Common changes ​

Let players train without a membership
shared/config.lua
lua
membership = { account = 'cash', price = 1000, days = 7, required = false },
Charge the membership and the shop from the bank
shared/config.lua
lua
membership = { account = 'bank', price = 1500, days = 30, required = true },

And in shop, account = 'bank'.

Open the panel full screen instead of on the gym screen

In tablet, set dui = false.

Keep attributes from dropping over time

In /gymadmin, stats section, set the condition loss to 0. From the file, in data/defaults.lua:

data/defaults.lua
lua
condition = { enabled = true, percent = 0, hours = 12, perRep = 1.0, levelBonus = 0.5 },

© Cuxial