Skip to content

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.

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.

Copy the resource ​

Place the CuxiaPvP folder inside your resources directory. Keep the folder name as it is: the exports are called through it.

Set the exit point ​

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

data/config.lua
lua
exitCoords = vector4(0.0, 0.0, 72.0, 0.0),

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.

A map whose coordinates point to an interior you do not have drops players into the void. Check every map before going live.

The format of each file is explained in Configuration.

Match your weather and ambulance scripts ​

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

data/config.lua
lua
-- 'av' = av_weather | 'cd' = cd_easytime
weatherSystem = 'av',

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

Leave in events only the revive event of your ambulance script.

Grant the zone tool permission ​

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

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

Set the language ​

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

server.cfg
cfg
setr ox:locale "en"

Start the resource ​

Start it after its dependencies and after your framework:

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

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 Enter. The zone is saved to data/gungame_zones.lua.

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.

Next: learn how matches play in the Features guide, or adjust the rules in Configuration.

© Cuxial