> For the complete documentation index, see [llms.txt](https://piotreq-scripts.gitbook.io/piotreq-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/ambulance-job/setup-server.md).

# Setup Server

## Target Setup

***

### 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
```

{% endstep %}
{% endstepper %}

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

{% stepper %}
{% step %}

### First Step

Scroll down a little bit and find `if entityHit > 0 then`
{% endstep %}

{% step %}

### Second Step

Add code under this line like on screenshot.

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

{% endstep %}
{% endstepper %}

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

***

### 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
```

{% endstep %}
{% endstepper %}

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

{% stepper %}
{% 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
```

{% endstep %}
{% endstepper %}

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