Skip to main content

πŸ’ͺ Gym

This documentation provides details on how to configure and use our gym script for your FiveM Server.

Overview​

The gym script allows players to train and improve their strength and stamina abilities in-game. The abilities are tracked using GTA V stats and range from 0 to 100. Regular training is required to maintain these abilities; otherwise, they will decrease over time.

How Abilities Work​

Abilities are set as GTA V stats ranging from 0 to 100 for both strength and stamina. If players do not train regularly, these abilities will decrease over time according to the settings defined in Config.RemoveAbilityTime.

Training Abilities​

Players can train their abilities by performing exercises. Each exercise is linked to a specific ability and increases it by a defined amount over a specified duration. The available exercises and their effects are configured in Config.TrainAbility.

Abilities Explained​

Condition​

Condition determines how long a player can perform strenuous activities such as running, swimming, or cycling at full speed before they begin to lose health due to overexertion. Maintaining high condition allows players to engage in these activities for extended periods without experiencing negative effects.

Benefits of High Condition:

  • Extended Activity Duration: Ability to run, swim, or cycle longer distances at full speed.
  • Reduced Health Loss: Less likely to lose health from overexertion during physical activities.

Strength​

Strength reflects the player's physical power and resilience. This ability enhances several aspects of the player's performance in physical tasks and combat situations.

Benefits of High Strength:

  • Increased Melee Damage: Higher strength leads to more powerful melee attacks.
  • Faster Ladder Climbing: Climb ladders more quickly with increased strength.
  • Improved Sporting Agility: Better performance in sports-related activities.
  • Damage Reduction: Reduces the damage taken from various sources, including impacts and damage to armor.
  • Enhanced Physical Resilience: Overall better physical condition and endurance in challenging scenarios.

By regularly training at the gym and maintaining high condition and strength levels, players can significantly improve their performance and survivability in the game.

Configuration​

General Settings​

  • Config.payWithBank: Determines whether payments are made via bank (true) or cash (false).
  • Config.needMembership: Specifies if a membership is required to use the gym.
  • Config.membershipPrice: Sets the price of the gym membership.
  • Config.MembershipExpiration: Configures membership duration.
    • enabled: Enables/disables membership expiration.
    • days: Sets the number of days the membership lasts.

Display Settings​

  • Config.ShowStats: Configures how players can view their stats.
    • useKey: Enables viewing stats using a key.
    • key: Sets the key used to view stats (default is "O").
    • useCommand: Enables viewing stats using a command.
    • command: Sets the command used to view stats (default is "stats").

Ability Management​

  • Config.RemoveAbilityTime: Defines how and when abilities decrease.

    • name: Name of the ability (e.g., "strength", "condition").
    • minutes: Time interval in minutes after which the ability decreases.
    • value: Amount by which the ability decreases.
  • Config.TrainAbility: Defines the exercises and their effects on abilities.

    • lift: Training details for lifting weights.
      • name: Ability name ("strength" or "condition").
      • value: Amount by which the ability increases.
      • seconds: Duration of the exercise in seconds.

Locations​

  • Config.Locations: Configures gym locations and exercise spots.
    • showBlip: Whether to show a map blip for the gym.
    • blip: Blip settings.
      • name: Name of the blip ("Gym").
      • sprite: Blip icon (sprite 311).
      • color: Blip color (0).
    • coords: Coordinates of the gym location.
    • exercises: Exercise spots within the gym.
      • coords: Coordinates and heading for each exercise.
      • sort: Type of exercise (e.g., "pullup", "lift", "pushup", "situp").