Skip to content

Configuration

Every option of Cuxial PvP explained: rules, limits, maps, weapons, Gun Game and zones.

Everything you can adjust lives in the data folder. Restart the resource after any change.

FileWhat it holds
data/config.luaGeneral behaviour, commands, limits, integrations
data/settings.luaArmour amount and the hours of day and night
data/modes.luaWhich game modes are open and their minimum players
data/maps.luaDuel arenas
data/weapons.luaDuel weapons
data/gungame.luaGun Game ladder and timings
data/gungame_zones.luaGun Game zones, written by the zone tool

General ​

data/config.lua
lua
return {
    debug = false,
    weatherSystem = 'av',
    exitCoords = vector4(0.0, 0.0, 72.0, 0.0),
    -- ...
}
OptionTypeDefaultWhat it does
debugbooleanfalsetrue prints traces to the console.
weatherSystemstring'av'Script used to freeze the time of day during a match. 'av' = av_weather, 'cd' = cd_easytime.
exitCoordsvector4exampleWhere players are sent when a match ends. Change it to a place on your map.
zoneToolAcestring'cuxialpvp.zones'ACE permission required to save a zone drawn with the zone tool.

Commands · commands ​

OptionTypeDefaultWhat it does
openMenustring'Cuxiall'Command that opens the menu. It is also the entry players bind a key to.
exitDuelstring'exitduel'Command to leave the current match.
createZonestring'pvpzone'Command that opens the zone tool.

Zone wall · boundary ​

The wall that marks the edge of a Gun Game zone.

OptionTypeDefaultWhat it does
nearnumber15.0Distance in metres from the edge at which the wall becomes visible.
risenumber9.0Height of the wall above the player, in metres, for zones saved without a ceiling.
dropnumber2.5Depth of the wall below the player, in metres, for zones saved without a floor.

Fallback values · defaults ​

Applied by the server when a duel is created without a valid value.

OptionTypeDefaultWhat it does
gameTypestring'rounds'Game type. 'rounds' or 'time'.
roundsnumber3Rounds needed to win.
timeMinutesnumber5Length of a timed duel, in minutes.
dayTimestring'day'Time of day. 'day' or 'night'.

Limits · limits ​

OptionTypeDefaultWhat it does
maxTeamSizenumber30Maximum players per team in a duel.
maxRoundsnumber99Maximum rounds a host can ask for.
maxTimeMinutesnumber60Maximum length of a timed duel, in minutes.
maxLobbiesnumber50Maximum open lobbies on the whole server.
maxLobbiesPerHostnumber1Lobbies a single player can host at once.
createCooldownMsnumber3000Milliseconds a player waits before creating another lobby.

Discord pictures · discord ​

OptionTypeDefaultWhat it does
botTokenstring''Discord bot token used to load each player's real picture, banner and accent colour. Empty = the default Discord avatar is shown.

The bot needs no permissions and does not have to be in any Discord server.

A bot token is a password. Never share data/config.lua with the token inside, and reset the token in the Discord developer portal if the file leaves your hands.

Revive · revive ​

How the script brings a player back to life between rounds and at the end of a match.

OptionTypeDefaultWhat it does
enabledbooleantruetrue triggers the events below. false triggers none.
eventsstring[]two examplesClient events of your ambulance script that revive the player. Leave only the one your server uses.
delaynumber500Milliseconds to wait before reviving at the end of a match.

Leaderboard · leaderboard ​

OptionTypeDefaultWhat it does
clearOnRestartbooleanfalsetrue wipes the leaderboard every time the resource starts.
maxEntriesnumber30Players shown on each leaderboard.

Match settings · data/settings.lua ​

OptionTypeDefaultWhat it does
armor.armorValuenumber100Armour given when a match is played with armour. From 0 to 100.
dayTime.hours.daynumber12Hour of the clock used for a day match.
dayTime.hours.nightnumber0Hour of the clock used for a night match.

Game modes · data/modes.lua ​

One block per game mode: duel and gungame.

OptionTypeDefaultWhat it does
availablebooleantruefalse rejects the creation of lobbies of that mode.
minPerTeamnumber1Duels. Players needed on each team to start.
minPlayersnumber2Gun Game. Players needed to start.
lateJoinbooleantrueGun Game. true lets players join a match that has already started.
spectatebooleantruetrue lists the mode's matches as live matches and allows spectating them.

Duel maps · data/maps.lua ​

Each entry is an arena. The ones included are examples: replace them with arenas of your server.

data/maps.lua
lua
{
    value = 'warehouse',
    label = 'Warehouse',
    spectatorSpawn = vector4(0.0, 0.0, 80.0, 0.0),
    coords = {
        team1 = {
            vector4(10.0, 0.0, 72.0, 90.0),
            vector4(10.0, 2.0, 72.0, 90.0),
        },
        team2 = {
            vector4(-10.0, 0.0, 72.0, 270.0),
            vector4(-10.0, 2.0, 72.0, 270.0),
        },
    },
},
FieldTypeWhat it does
valuestringUnique identifier of the map. Also the name of its picture.
labelstringName shown in the menu.
spectatorSpawnvector4Where spectators are placed. Without it, the first spawn of team 1 is used.
coords.team1, coords.team2vector4[]Spawn points of each team. With more players than points, the points are reused in order.

The picture of a map is web/build/maps/<value>.png.

Duel weapons · data/weapons.lua ​

data/weapons.lua
lua
return {
    { value = 'WEAPON_PISTOL',       label = 'Pistol',        roll = false },
    { value = 'WEAPON_COMBATPISTOL', label = 'Combat Pistol', roll = false },
}
FieldTypeWhat it does
valuestringWeapon name. It must exist on your server.
labelstringName shown in the menu.
rollbooleantrue makes the weapon selectable only when the host turns on the roll option of the lobby.

The picture of a weapon is web/build/weapons/<value>.png.

Gun Game · data/gungame.lua ​

OptionTypeDefaultWhat it does
killsPerWeaponnumber3Kills needed to move up one rung.
ladderstring[]12 weaponsWeapons in order, from first to last, without the finisher. The host chooses how many are played; the list is cut from the end.
finisherstring'WEAPON_MACHETE'Last weapon of every match, whatever the ladder length.
respawnSecondsnumber5Seconds a dead player waits before respawning.
spawnProtectSecondsnumber3Seconds of invulnerability after spawning. Shooting ends it.
outOfBoundsSecondsnumber6Seconds a player can stay outside the zone before being moved back in.
boundsCheckMsnumber1000Milliseconds between checks of who is outside the zone. Lower is more precise and costs more.

With ox_inventory running, ladder weapons take their name and icon from it.

Gun Game zones · data/gungame_zones.lua ​

This file is written by the zone tool. Draw zones in game with /pvpzone gungame <name>; see Commands & permissions.

The zone tool rewrites the whole file every time a zone is saved. Edit it by hand only to remove or rename a zone, and keep the format.

FieldTypeWhat it does
valuestringIdentifier, built from the name: gg_ plus the name in lower case. Also the name of its picture.
labelstringName shown in the menu.
pointsvector2[]Corners of the zone, three or more.
minZ, maxZnumberFloor and ceiling of the zone.

The picture of a zone is web/build/zones/<value>.webp. A zone without picture shows its name and an icon.

Player banners ​

The respawn card of Gun Game shows a banner behind the killer's name. To give a player a custom one, add a picture named after their Discord ID:

web/build/banners/123456789012345678.webp

With a bot token set, the player's own Discord banner takes priority.

Common changes ​

Open only duels ​

data/modes.lua
lua
gungame = {
    id = 'gungame',
    available = false,
    -- ...
},

Shorter, faster Gun Game ​

data/gungame.lua
lua
killsPerWeapon = 2,
respawnSeconds = 3,

Rename the commands ​

data/config.lua
lua
commands = {
    openMenu = 'pvp',
    exitDuel = 'leavepvp',
    createZone = 'pvpzone',
},

Use cd_easytime and your own revive event ​

data/config.lua
lua
weatherSystem = 'cd',

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

© Cuxial