# Configuration

### Prerequisites

Before setting up the force-sling, ensure that you have the following dependency installed:

* **ox\_lib**: This library is required for the resource to function correctly.
  * **GitHub Repository**: [ox\_lib](https://github.com/overextended/ox_lib)
  * **Documentation**: [ox\_lib Documentation](https://overextended.dev/ox_lib)

### Configuration File

This section provides detailed information on how to configure force-sling. The configuration file (`config.lua`) allows you to customize various aspects of the resource to fit your needs and preferences.

#### Debug Mode

* **Config.Debug**
  * **Description**: Enables or disables debug mode.
  * **Type**: `boolean`
  * **Default**: `true`
  * **Example**:

    ```lua
    Config.Debug = true
    ```

#### Locale

* **Config.Locale**
  * **Description**: Sets the locale for the application.
  * **Type**: `string`
  * **Options**: `"ar"`, `"en"`, `"es"`, `"fr"`, `"pt"`, `"de"`, `"nl"`, `"pl"`, `"ru"`, `"sv"`, `"auto"`
  * **Default**: `"en"`
  * **Example**:

    ```lua
    Config.Locale = "en"
    ```

#### Admin Configuration

* **Config.Admin**
  * **Global**
    * **enabled**
      * **Description**: Enables or disables global admin commands.
      * **Type**: `boolean`
      * **Default**: `true`
      * **Example**:

        ```lua
        Config.Admin.Global.enabled = true
        ```
    * **players**
      * **Description**: List of players with admin access.
      * **Type**: `table`
      * **Example**:

        ```lua
        Config.Admin.Global.players = {
          "discord:453870580374962177", -- Force
          "discord:566930948986241024", -- Olpis
        }
        ```

#### Framework Configuration

* **Config.Framework**
  * **name**
    * **Description**: Name of the framework.
    * **Type**: `string`
    * **Options**: `"esx"`, `"qbcore"`, `"custom"`, `"auto"`
    * **Default**: `"auto"`
    * **Example**:

      ```lua
      Config.Framework.name = "auto"
      ```
  * **resource**
    * **Description**: Resource name for ESX or QBCore.
    * **Type**: `string`
    * **Default**: `"es_extended"`
    * **Example**:

      ```lua
      Config.Framework.resource = "es_extended"
      ```

#### Inventory Configuration

* **Config.Inventory**
  * **Description**: Configuration for the inventory system.
  * **Type**: `string`
  * **Options**: `"none"`, `"auto"`, `"qs-inventory"`, `"qb-inventory"`, `"core_inventory"`, `"ox_inventory"`, `"custom"`
  * **Default**: `"auto"`
  * **Example**:

    ```lua
    Config.Inventory = "auto"
    ```
* **Config.UseWeaponAttachments**
  * **Description**: Enables or disables the use of weapon attachments.
  * **Type**: `boolean`
  * **Default**: `true`
  * **Example**:

    ```lua
    Config.UseWeaponAttachments = true
    ```

#### Command Configuration

* **Config.Command**
  * **name**
    * **Description**: Name of the command.
    * **Type**: `string`
    * **Default**: `"sling"`
    * **Example**:

      ```lua
      Config.Command.name = "sling"
      ```
  * **description**
    * **Description**: Description of the command.
    * **Type**: `string`
    * **Default**: `"Configure weapon positions"`
    * **Example**:

      ```lua
      Config.Command.description = "Configure weapon positions"
      ```
  * **permission**
    * **Description**: Permission required to use the command.
    * **Type**: `string`
    * **Default**: `"any"`
    * **Example**:

      ```lua
      Config.Command.permission = "any"
      ```

#### Preset Command Configuration

* **Config.Presets**
  * **command**
    * **Description**: Name of the preset command.
    * **Type**: `string`
    * **Default**: `"slingpreset"`
    * **Example**:

      ```lua
      Config.Presets.command = "slingpreset"
      ```
  * **permission**
    * **Description**: Permission required to use the preset command.
    * **Type**: `string`
    * **Default**: `"global"`
    * **Example**:

      ```lua
      Config.Presets.permission = "global"
      ```

#### Bone Configuration

* **Config.Bones**
  * **Back**
    * **Description**: Bone ID for back attachment.
    * **Type**: `number`
    * **Default**: `24816`
    * **Example**:

      ```lua
      ["Back"] = 24816
      ```
  * **Front**
    * **Description**: Bone ID for front attachment.
    * **Type**: `number`
    * **Default**: `10706`
    * **Example**:

      ```lua
      ["Front"] = 10706
      ```

#### Editable Weapon Configuration

* **Config.Weapons**
  * **Description**: Configuration for editable weapons.
  * **Type**: `table`
  * **Example**:

    ```lua
    Config.Weapons = {
      ["weapon_pistol50"] = { model = `w_pi_pistol50`, name = `weapon_pistol50` },
      ["weapon_pistol"] = { model = `w_pi_pistol`, name = `weapon_pistol` },
      ...
    }
    ```

### Setting Up the Resource

1. **Download and Install**: Download the resource and add it to your FiveM server's resources folder. [GitHub](https://github.com/Force-Developing/force-sling)
2. **Configure**: Edit the [config.lua](http://_vscodecontentref_/0) file to customize the settings according to your needs.
3. **Install ox\_lib**: Ensure that you have `ox_lib` installed. You can find it on [GitHub](https://github.com/overextended/ox_lib) or refer to the [ox\_lib Documentation](https://overextended.dev/ox_lib) for installation instructions.
4. **Start the Resource**: Add `ensure force-sling` to your server configuration file to start the resource. Make sure it's below `ox_lib`
5. **Use Commands**: Use the provided commands to configure weapon positions and manage attachments.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.forcedevelopments.com/free-resources/force-sling/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
