> For the complete documentation index, see [llms.txt](https://jixelpatterns.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jixelpatterns.gitbook.io/docs/troubleshooting/setting-up-locations.md).

# Setting Up Locations

My scripts come with a generally unified way of creating locations for target zones

The basics of this is: Location File > Create Target Event > Tanslate to qb-target or ox\_target

It is very easy to add new locations in files simply by copy and pasting another and editing it through that

{% hint style="info" %}
Setting up a new location is ALOT easier with debugMode enabled in the config of the script
{% endhint %}

## Explanation of a target in a location file:

Example:

```lua
Shop = {
        {   coords = vec4(1171.75, 2635.96, 37.38, 315.0), width = 0.6, depth = 0.6, minZ = 36.93, maxZ = 38.33,
            label = "Shop", icon = "fas fa-box-open",
        },
},
```

This is a shop target, we're only going to focus on the coords here

{% hint style="danger" %}
When creating a new zone, there **NEEDS** to be model/prop inside it for you to target
{% endhint %}

### Coords

This is the "center" of the location, in the game world where the target zone will be created

This is a `vector4()`&#x20;

This consists of 4 vector variables - X Y Z and Heading

```lua
coords = vec4(1171.75, 2635.96, 37.38, 315.0)
```

***

### Width

This is the width in GTA unit's, how wide the target box zone will be when created

```lua
width = 0.6,
```

***

### Depth

This is how "deep" in GTA units the target box will be when created

```lua
depth = 0.6,
```

***

### minZ

{% hint style="warning" %}
This is optional, if this is removed or not added, it will automatically create a number based on the z coord
{% endhint %}

This is where, in the game world, the **BOTTOM** of the target box zone should be

This needs to be **below** the Z coord, in this example it is:

```lua
minZ = 36.93,
```

This is `0.45` **BELOW** the Z coordinate of `37.38`&#x20;

***

### maxZ

{% hint style="warning" %}
This is optional, if this is removed or not added, it will automatically create a number based on the z coord
{% endhint %}

This is where, in the game world, the **TOP** of the target box zone should be

This needs to be **above** the Z coord, in this example it is:

```lua
maxZ = 38.33,
```

This is `0.95` **ABOVE** the Z coordinate of `37.38`&#x20;

***

{% tabs %}
{% tab title="PolyZone" %}
The easiest way to create a new zone is to use PolyZone, the script that controls the creation of these zones

### Zone location

Type `/pzcreate poly` to start creating a PolyZone

Pick a name, this doesn't matter as you can set this later in locations.lua&#x20;

You will then get a red line right where you are standing.&#x20;

Use your ARROW keys to move this around to the first corner/point you want to place.&#x20;

When its in the correct place, type `/pzadd` and this will lock the current point and allow you to create another Repeat this until your last corner/point where you will type `/pzfinish`.&#x20;

This will save all the vectors of the points you have chosen and place them in a file called: `polyzone_created_zones.txt`&#x20;

In this file is the vectors that you need to copy over to my scripts.

### Target Locatons

\--
{% endtab %}

{% tab title="OX\_Lib" %}

{% endtab %}

{% tab title="Manual" %}
So, the "manual" way is simply to try get the vector location by standing as close as you can to the location and using `/vector4`\
Then guessing the width an depth of a location.\
\
This is how I programmed for around a year before I realised PolyZone had built in commands
{% endtab %}
{% endtabs %}
