> For the complete documentation index, see [llms.txt](https://docs.rytrak.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rytrak.fr/scripts/advanced-police-grab-ped/general-configuration.md).

# General Configuration

This guide will help you configure the script to suit your needs, covering all available options in the `config.lua` file. Each setting is explained step by step.

***

### **1. General Configuration**

#### **Language**

Set the language used by the script.

```lua
Config.Language = 'en' -- Available options: 'en' (English), 'fr' (French)
```

***

#### **Command System**

{% hint style="warning" %}
**Note:** If you are using a target system, disable the command system
{% endhint %}

Activate or deactivate commands for grabbing, putting, and removing players from vehicles.

<pre class="language-lua"><code class="lang-lua">Config.CommandSystem.Enabled = false -- Enable/disable the command-based interaction system. (WARNING! If you are using a system in the Target System, disable the command system)tions.
<strong>Config.CommandSystem.Grab = 'grab' -- Command to grab the person by the arm.
</strong>Config.CommandSystem.PutPlayer = 'putplayer' -- Command to put the person in a vehicle.
Config.CommandSystem.RemovePlayer = 'removeplayer' -- Command to take the person out of a vehicle.
</code></pre>

*Commands can also be customized in the `cl_utils.lua` file.*

***

### **2. Target System Compatibility**

{% hint style="danger" %}
**Note:** Only one target system can be enabled at a time.
{% endhint %}

{% hint style="warning" %}
**Note:** If you are using the target system set *Config.CommandSystem.Enabled = false*
{% endhint %}

#### **ox\_target Compatibility**

Enables compatibility with `ox_target` to allow interaction with players.

```lua
Config.TargetSystem.UseOXTarget = false -- Set to true to enable ox_target compatibility.
```

#### **qb-target Compatibility**

Enables compatibility with `qb-target` to allow interaction with players.

```lua
Config.TargetSystem.UseQBTarget = false -- Set to true to enable qb-target compatibility.
```

**Custom Target System**

If you are using a custom targeting system, enable this option and follow the structure of the `client/ox_target.lua` or `client/qb_target.lua` files.

```lua
Config.TargetSystem.UseCustomTarget = false -- Set to true to enable a custom targeting system.
```

***

### **3. Compatibility with Frameworks**

{% hint style="danger" %}
**Note:** Only one framework system can be enabled at a time.
{% endhint %}

#### **ESX Compatibility**

Enable ESX compatibility and restrict functionality to specific jobs.

```lua
Config.Framework.ESX = {
    enabled = false, -- Set to true to enable ESX compatibility.
    jobs = { 'police', 'fbi' }, -- Jobs allowed to use the grab feature.
    exceptionJobs = false -- If true, players with the listed jobs cannot be grabbed.
}
```

#### **QB Compatibility**

Enable QB compatibility and restrict functionality to specific jobs.

```lua
Config.Framework.QB = {
    enabled = false, -- Set to true to enable QB compatibility.
    jobs = { 'police', 'fbi' } -- Jobs allowed to use the grab feature.
}
```

***

### **4. Player Movement and Interactions**

#### Controls Disabled

```lua
DisableControls = {
    disableSprint = true, -- Disable sprinting while carrying a player (recommended: true).
    getOutVehicle = true, -- Prevents grabbed players from exiting the vehicle on their own.
},
```

***

#### **Collision Range**

Adjust the collision distance between the grabbed player and the carrier.

```lua
Config.CollisionRange = 0.5 -- Value range: 0.0 (disable collision) to desired distance.
```

***

#### **Grabbing Radius**

Define the distance required to grab a player.

```lua
Config.GrabbingRadius = 1.0 -- Recommended value: 1.0
```

***

#### **Attachment Position**

Set the position of the grabbed player relative to the carrier.

```lua
Config.AttachPosition = vector3(0.20, 0.45, 0.0) -- Modify as needed for positioning.
```

***

### **5. Animations**

Control animations for both the person grabbing and the person being grabbed.

```lua
Config.Animations = {
    policeAnimation = {
        enabled = true, -- Set to true to enable animations for the carrier.
        animDict = 'amb@world_human_drinking@coffee@male@base',
        anim = 'base'
    },
    citizenAnimation = {
        enabled = false, -- Set to true to enable animations for the grabbed person.
        animDict = 'amb@world_human_drinking@coffee@male@base',
        anim = 'base'
    }
}
```

***

### **6. Key Bindings**

#### **Keys for Interactions**

Set the keys used for actions when `CommandEnabled` is set to false.

```lua
Config.Keys = {
    GrabAndDropKey = 289, -- Key to grab and release a person.
    GrabAndDropKeyString = '~INPUT_REPLAY_START_STOP_RECORDING_SECONDARY~', -- Key name for display.

    TaskEnterKey = 305, -- Key to put a person in the vehicle.
    TaskEnterKeyString = '~INPUT_REPLAY_STARTPOINT~' -- Key name for display.
}
```

*Refer to the* [*FiveM Control Reference*](https://docs.fivem.net/docs/game-references/controls/) *for a list of control codes.*

***

### **7. Language Library**

Edit the text displayed for different actions in multiple languages.
