> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/leisure/cuxial-pvp/installation.md).

# Installation

Install Cuxial PvP step by step: dependencies, arenas, weapons, permissions and start order.

Cuxial PvP needs no SQL import and no inventory items. The leaderboard is stored by the resource itself.

{% stepper %}
{% step %}

## Check the dependencies

These must be installed and working before you add the script:

* OneSync enabled on the server
* `ox_lib`
* `cuxial_bridge`, with one of the supported frameworks: QBox, QBCore or ESX
* `ox_inventory` or `qb-inventory`

Optional:

* `av_weather` or `cd_easytime`, to freeze the time of day while a match is running.
* `ox_inventory` also provides the names and icons of the Gun Game ladder weapons.
  {% endstep %}

{% step %}

## Copy the resource

Place the `CuxiaPvP` folder inside your `resources` directory. Keep the folder name as it is: the exports are called through it.
{% endstep %}

{% step %}

## Set the exit point

Players are sent to `exitCoords` when a match ends. Change it to a place on your map:

{% code title="data/config.lua" %}

```lua
exitCoords = vector4(0.0, 0.0, 72.0, 0.0),
```

{% endcode %}
{% endstep %}

{% step %}

## Adapt arenas and weapons to your server

The maps in `data/maps.lua` and the weapons in `data/weapons.lua` are examples. Replace them before opening the script to players:

* **Maps.** Each one lists the spawn points of both teams. Use coordinates of arenas that exist on your server.
* **Duel weapons.** Each `value` must be a weapon that exists on your server, add-on weapons included.
* **Gun Game ladder.** Review `ladder` and `finisher` in `data/gungame.lua`.

{% hint style="warning" %}
A map whose coordinates point to an interior you do not have drops players into the void. Check every map before going live.
{% endhint %}

The format of each file is explained in [Configuration](/scripts/leisure/cuxial-pvp/configuration.md).
{% endstep %}

{% step %}

## Match your weather and ambulance scripts

Set which time script you run, and the events that revive a player on your server:

{% code title="data/config.lua" %}

```lua
-- 'av' = av_weather | 'cd' = cd_easytime
weatherSystem = 'av',

revive = {
    enabled = true,
    events = {
        'hospital:client:Revive',
        'esx_ambulancejob:revive',
    },
    delay = 500,
},
```

{% endcode %}

Leave in `events` only the revive event of your ambulance script.
{% endstep %}

{% step %}

## Grant the zone tool permission

Saving a Gun Game zone writes a file inside the resource, so it sits behind an ACE permission:

{% code title="server.cfg" %}

```cfg
add_ace group.admin cuxialpvp.zones allow
```

{% endcode %}
{% endstep %}

{% step %}

## Set the language

English and Spanish are included. The script follows the `ox_lib` language:

{% code title="server.cfg" %}

```cfg
setr ox:locale "en"
```

{% endcode %}
{% endstep %}

{% step %}

## Start the resource

Start it after its dependencies and after your framework:

{% code title="server.cfg" %}

```cfg
ensure ox_lib
# your framework here (qbx_core, qb-core or es_extended)
# your inventory here (ox_inventory or qb-inventory)
ensure cuxial_bridge
ensure CuxiaPvP
```

{% endcode %}
{% endstep %}

{% step %}

## Check that it works

1. Join the server and type `/Cuxiall`. The menu opens.
2. Create a duel, have a second player join, assign them to the other team and start. Both players appear in the arena with the chosen weapon.
3. Finish the match. Both players return to `exitCoords` with their previous armour.
4. Type `/pvpzone gungame Test` with the permission granted, draw a zone and press <kbd>Enter</kbd>. The zone is saved to `data/gungame_zones.lua`.
   {% endstep %}
   {% endstepper %}

{% hint style="info" %}
The menu key is unassigned on purpose. Each player binds it in the FiveM key settings, or you can open the menu from your own resource with the `toggleUI` export. See [Exports & events](/scripts/leisure/cuxial-pvp/developers.md).
{% endhint %}

Next: learn how matches play in the [Features guide](/scripts/leisure/cuxial-pvp/features.md), or adjust the rules in [Configuration](/scripts/leisure/cuxial-pvp/configuration.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/leisure/cuxial-pvp/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
