# Server Setup

***

## Five Manage API Key

<mark style="color:red;">**This is required for our script to work properly on your server!**</mark>

{% stepper %}
{% step %}
**Create account**

Go to fivemanage.com and create an account
{% endstep %}

{% step %}
**Create Token**

Once you created account, go to Tokens and create token for MEDIA
{% endstep %}

{% step %}
**Setup Token in Server**

Go to your server.cfg file and paste this, change your\_api\_key to api key from panel

```lua
set FIVEMANAGE_MEDIA_API_KEY your_api_key
```

{% endstep %}
{% endstepper %}

## Target resource setup

### 1. ox\_target

{% hint style="info" %}
We recommend using minimum 1.16.0 version of ox\_target
{% endhint %}

{% stepper %}
{% step %}
**First Step**

Open `ox_target / client / main.lua`
{% endstep %}

{% step %}
**Second Step**

Find in code this `nearbyZones, zonesChanged = utils.getNearbyZones(endCoords)`
{% endstep %}

{% step %}
**Third Step**

Add code under this line like on screenshot

```lua
local localState = LocalPlayer.state
if localState.draggingPlayer or localState.carryingPlayer then
    entityHit = GetPlayerPed(GetPlayerFromServerId(localState.draggingPlayer or localState.carryingPlayer))
    dist = 0
end
```

<figure><img src="/files/QqgogWNxig7wq9Vi1iYK" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Fourth Step**

Scroll down and look for `if entityHit > 0 then` (If you can't find it, use CTRL + F)
{% endstep %}

{% step %}
**Fifth Step**

Make space for our snippet, and insert code below under `if entityHit > 0 then`

```lua
if localState.draggingPlayer or localState.carryingPlayer then
    entityHit = GetPlayerPed(GetPlayerFromServerId(localState.draggingPlayer or localState.carryingPlayer))
    entityType = 1
    distance = 0
end
```

<figure><img src="/files/zIMSeOClXjRCrbc1jClf" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

#### File ready to go (ox\_target 1.16.0)

Modified client/main.lua file if you have issue with modifying the file \[ox\_target 1.16.0]

{% file src="/files/iUN5ZpzOH3q0q77hGtP8" %}

***

### 2. qb-target

{% stepper %}
{% step %}
**First Step**

Open `qb-target / client.lua`
{% endstep %}

{% step %}
**Second Step**

Find line `while targetActive do` in `function EnableTarget()`
{% endstep %}

{% step %}
**Third Step**

Add code below like on screenshot.

```lua
local localState = LocalPlayer.state
if localState.draggingPlayer or localState.carryingPlayer then
    entityType = 1
    entity = GetPlayerPed(GetPlayerFromServerId(localState.draggingPlayer or localState.carryingPlayer))
    distance = 0
end
```

<figure><img src="/files/prjQTsAgKdjri2DFPj31" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**First Step**

Find `local function CheckEntity`
{% endstep %}

{% step %}
**Second Step**

Add following code like on screenshot.

```lua
local localState = LocalPlayer.state
if localState.draggingPlayer or localState.carryingPlayer then
    entity2 = GetPlayerPed(GetPlayerFromServerId(localState.draggingPlayer or localState.carryingPlayer))
end
```

<figure><img src="/files/YW1NEoKcn05klzVFQQEL" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

#### File ready to go

Modified client.lua file if you have issue with modifying file **\[Only for original qb-target without any additional modifications and/or changes]**

{% file src="/files/q7RWNQVmUu5wcLAdIAPV" %}

***

## Voice script setup

### pma-voice

If you want to use our radio animation menu follow these steps

{% stepper %}
{% step %}
**First Step**

Open your server.cfg file
{% endstep %}

{% step %}
**Second Step**

Locate `setr voice_enableRadioAnim 1` and set `1` to `0`
{% endstep %}
{% endstepper %}

***


---

# 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://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/police-job/server-setup.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.
