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_libcuxial_bridge, with one of the supported frameworks: QBox, QBCore or ESXox_inventoryorqb-inventory
Optional:
av_weatherorcd_easytime, to freeze the time of day while a match is running.ox_inventoryalso 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:
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
valuemust be a weapon that exists on your server, add-on weapons included. - Gun Game ladder. Review
ladderandfinisherindata/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:
-- '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:
add_ace group.admin cuxialpvp.zones allowSet the language
English and Spanish are included. The script follows the ox_lib language:
setr ox:locale "en"Start the resource
Start it after its dependencies and after your framework:
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 CuxiaPvPCheck that it works
- Join the server and type
/Cuxiall. The menu opens. - 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.
- Finish the match. Both players return to
exitCoordswith their previous armour. - Type
/pvpzone gungame Testwith the permission granted, draw a zone and press Enter. The zone is saved todata/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.
