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


---

# 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/ambulance-job/setup-server.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.
