---
description: >-
  Quick guide on how to set up your server to be ready for our police job
  script.
---

# 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="https://3808595786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWtp2CzACAMvuPWbeJ3cy%2Fuploads%2FJoL9zfZ89rO3kYhpKHd9%2Fimage.png?alt=media&#x26;token=1f6e3e20-48cc-41cc-a32b-dcd811256e77" 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="https://3808595786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWtp2CzACAMvuPWbeJ3cy%2Fuploads%2FIkZyIHnn48WhDgkefWBK%2Fimage.png?alt=media&#x26;token=44f8ef97-1916-4ca5-85f1-1a4c1bf551d1" 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="https://3808595786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWtp2CzACAMvuPWbeJ3cy%2Fuploads%2FocSoeyNjwbEF3gAuoGdK%2Fmain.lua?alt=media&token=e6f4f6b3-6cb4-4aec-a4d4-3db511ea0c06" %}

***

### 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="https://3808595786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWtp2CzACAMvuPWbeJ3cy%2Fuploads%2F4EjvuJzJtXbRKGk24za5%2Fimage.png?alt=media&#x26;token=074d6f5a-718d-4ebb-8dc1-3477455390b4" 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="https://3808595786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWtp2CzACAMvuPWbeJ3cy%2Fuploads%2FgyF81kLTrMoGxXfTLJiF%2Fimage.png?alt=media&#x26;token=d24a0580-1843-4d99-9c63-15756baf3cac" 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="https://3808595786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWtp2CzACAMvuPWbeJ3cy%2Fuploads%2Fs2fIj6X06qEMLBsOJaSM%2Fclient.lua?alt=media&token=c1a4a536-749d-443e-bc94-746843e99e5f" %}

***

## 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 %}

***
