# Compatibility with esx\_policejob

This guide explains how to make the **esx\_policejob** script compatible with the **Advanced Police Grab Ped** resource. Follow the steps below to integrate the functionality smoothly.

***

### **1. Modify the `r_grab` Configuration**

Open the `config.lua` file of the **r\_grab** resource and make the following changes:

1. **Change the Grab Command**

```lua
Config.GrabCommand = '+grab'
```

2. **Change the Put Car Command**

```lua
Config.PutCarCommand = '+putcar'
```

***

### **2. Edit the `esx_policejob` Script**

Navigate to the `esx_policejob/client/main.lua` file and update it as follows:

#### **2.1 Modify the Drag Action**

Locate line **675** (or search for `elseif action == 'drag' then`) and replace the line below it:

**Before:**

```lua
TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(closestPlayer))
```

**After:**

```lua
ExecuteCommand('+grab')
```

***

#### **2.2 Modify the Put In Vehicle Action**

Search for `elseif action == 'put_in_vehicle' then` and replace the line below it:

**Before:**

```lua
TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(closestPlayer))
```

**After:**

```lua
ExecuteCommand('+putcar')
```

***

#### **2.3 Delete the Detach Thread**

Search for the `DetachEntity` function (around line **1565**) and remove the entire thread where it is used.

Refer to the GIF below for guidance:

<figure><img src="/files/HYvejFLPlLaPKkAJUJ3i" alt=""><figcaption></figcaption></figure>

***

### **3. Final Steps**

* Save all changes to the `r_grab` and `esx_policejob` files.
* Restart your server to apply the updates.


---

# 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.rytrak.fr/scripts/advanced-police-grab-ped/compatibility-with-esx_policejob.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.
