Skip to content
Documentation
Games & Events4FFA Arenas

r_ffa Configuration

r_ffa config: framework and integrations, commands and keys, currency and wagers, arena rules, streaks, the arena ped, the podium, Discord pictures, attachments, UI and the custom hooks.

All settings live in config.lua. Restart the resource after changing it. Arenas, lobbies and weapons are on Creating Arenas.

General

R.Framework = 'auto' -- 'auto' | 'esx' | 'qb' | 'qbox'
R.CoreName = 'es_extended' -- only if you renamed es_extended
R.Inventory = 'ox_inventory' -- 'ox_inventory' | 'qs-inventory' | 'none' (ESX cash handling)
R.Target = 'ox_target' -- 'ox_target' | 'qb-target' | 'none' (key prompt) | 'custom'
R.TextUI = 'gta' -- 'gta' | 'ox_lib' | 'okok' | 'qb' | 'jg' | 'cd' | 'esx' | 'custom'
R.Notify = 'ox_lib' -- 'ox_lib' | 'esx' | 'qb' | 'okok'
R.Ambulance = 'auto' -- 'auto' | 'qbx_medical' | 'wasabi' | 'esx' | 'qb' | 'none'
R.Debug = false
R.EnableLogs = true -- webhooks in server/sv_custom.lua
R.EnableAutoinsert = true -- creates the r_ffa table on first start

R.Voice = true -- puts the lobby in its own pma-voice radio channel (hooks in client/cl_custom.lua)
R.HideTopHud = true -- hides r_tophud while you are in an arena (the hub leaves it alone)
R.Avatars = 'auto' -- Discord pictures on the profile, leaderboard and duels: 'auto' | 'trase' (trase_discord) | 'badger' (Badger_Discord_API) | 'none'
R.Names = 'player' -- 'player' = FiveM name | 'character' = character name (killfeed, scoreboard, leaderboard)

Leave R.Framework and R.Ambulance on 'auto'. Another ambulance script? Set 'none' and add your revive to RevivePlayer in client/cl_custom.lua.

Prompt style and custom target

R.TextUI sets how the "press E" prompts look: gta (default, GTA help text), ox_lib, okok, qb, jg, cd, esx or custom. For custom, edit BridgeTextUI in bridge/cl_textui.lua.

R.Target = 'none' uses the built-in key prompt, no target script needed. R.Target = 'custom' is for any other target script: fill in BridgeCustomTarget in bridge/cl_target.lua with AddBoxZone, AddModels, AddEntity and Remove. Each option has name, label, icon, distance, canInteract and onSelect.

The bridge/ folder is open, so you can edit it freely.

Commands & Keys

R.Commands = {
    leave = 'ffaleave',
    admin = 'ffaadmin'
}

R.AdminGroup = 'group.admin' -- ace group allowed to remove any lobby

R.Keys = {
    menu = 'G', -- in-arena menu (weapons, attachments, voice, leave)
    scoreboard = 'TAB' -- hold to show the scoreboard
}

Players can rebind the keys in FiveM settings.

Currency & Wagers

R.Currency = {
    symbol = '$',
    after = false, -- true = 1,000$ | false = $1,000
    separator = ','
}

R.Payment = {
    cash = true,
    bank = true,
    credits = true -- r_store credits
}

R.Credits = {
    resource = 'r_store' -- your r_store resource name
}

R.Wager = {
    min = 100,
    max = 100000,
    minKills = 1,
    maxKills = 50,
    defaultKills = 5,
    countdown = 5, -- seconds before every round
    responseTime = 30, -- seconds the opponent has to answer
    range = 15.0 -- how close the opponent must be
}

credits only shows up when R_Store is running. Both stakes are taken when the duel is accepted and the winner gets the pot.

Arena Rules

R.Lobby = {
    leaveDelay = 5, -- seconds before a player can leave after joining
    respawnDelay = 2, -- seconds on the death screen before respawning
    spawnProtection = 1.5, -- seconds of invincibility after (re)spawning
    protectionAlpha = 204, -- ped opacity while protected, others see it too (255 = fully visible)
    outOfBounds = 5, -- seconds to return after leaving the arena zone
    weaponSwapCooldown = 3, -- seconds between weapon swaps in the menu
    hintInterval = 60, -- seconds between the "G menu / TAB scoreboard" reminders (0 = off)
    infiniteAmmo = true,
    maxHealth = 200,
    customMaxPlayers = 32,
    joinDistance = 15.0, -- how close to a join point you must be to enter a lobby, 0 = anywhere
    bucketBase = 3000 -- routing buckets used by the arenas start from here
}

R.Streaks = { 3, 5, 10, 15, 20 } -- announced kill streaks

Each lobby runs in its own instance. Only change bucketBase if another script uses the same numbers. Duels don't count toward kills or streaks, only duel wins.

Downed, cuffed or jailed players can't join a lobby or a duel. Admins can join from anywhere.

Arena Ped

R.Join = {
    {
        Ped = {
            Model = 'ig_joeminuteman',
            Scenario = 'WORLD_HUMAN_DRUG_DEALER',
            Coords = vec4(-257.2, -972.6, 31.2, 250.5)
        },
        Blip = {
            enabled = true,
            sprite = 110,
            colour = 27,
            scale = 0.7,
            label = 'FFA Arena'
        }
    }
}

Add more entries for more entrances. Players always return to the first one when they leave.

Podium

The top 3 players by kills stand on a podium in the world, in their own outfits, with their name and kills on a small screen above each step.

R.Podium = {
    enabled = true,
    location = vector4(-254.13, -970.89, 31.22, 340.0), -- x, y, ground z, heading: the front faces the way a player looks at it
    distance = 60.0, -- the podium appears within this range
    alpha = 210, -- 255 = solid, lower = more see-through hologram
    scenario = 'WORLD_HUMAN_HANG_OUT_STREET',
    display = true, -- the screens with name and kills
    style = {
        accent = '', -- '' = R.UI.Accent
        plate = '#e9e6df',
        ink = '#17171b',
        logo = 'logo.png', -- a file in web/build/podium/, an https link, or '' for none
        logoSize = 0.8, -- 0.2 - 1.0
        light = true,
        lightRange = 2.5,
        lightIntensity = 1.2,
        lightCount = 1, -- 1 = one wide light (cheapest), 3 = one per step
        lightHours = { 19, 6 }, -- the light only runs between these in-game hours, false = always
        lightDistance = 20.0 -- and only for players this close
    }
}

Put your server logo on the top plates with logo. The podium updates within a minute when the top 3 changes.

Discord pictures

With trase_discord or Badger_Discord_API running, the leaderboard, your profile and duels show Discord profile pictures. 'auto' uses whichever one is started. Players without a picture get the default avatar.

Attachments

R.Attachments = {
    {
        key = 'suppressor',
        label = 'Suppressor',
        image = 'nui://ox_inventory/web/images/at_suppressor.png',
        components = { 'COMPONENT_AT_PI_SUPP', 'COMPONENT_AT_SR_SUPP', ... }
    },
}

Each entry is one toggle in the G menu. Add the COMPONENT_... names of your add-on weapons here. Ships with suppressor, extended clip, drum, grip, scope and flashlight.

Interface

R.WeaponImage = 'nui://ox_inventory/web/images/%s.png' -- %s = WEAPON_NAME in uppercase

R.UI = {
    Accent = '#9a27ea',
    Primary = "#ffffff",      -- main action buttons (buy / play / confirm)
    PrimaryText = "#000000",  -- text on those buttons
    NavActive = "",           -- selected tab background, "" keeps the neutral default
    NavActiveText = "#ffffff",-- selected tab text
    DefaultAvatar = 'nui://r_ffa/web/build/media/avatar.png'
}

Using another inventory? Point R.WeaponImage at its image folder. DefaultAvatar shows when MugShotBase64 isn't running.

Hooks

client/cl_custom.lua and server/sv_custom.lua are open, so you can connect your own scripts.

HookWhat it's for
Notify, GetAvatarYour notifications and player photos.
JoinVoice, LeaveVoiceAnother voice script.
RevivePlayer, IsPlayerDownedAnother ambulance script.
OnHubOpened, OnHubClosed, OnArenaEntered, OnArenaLeftHide HUDs or lock your inventory in the arena.
OnKillfeed, OnDuelResultYour own sounds or effects.
OnPlayerJoinedLobby, OnPlayerLeftLobby, OnKill, OnDuelFinishedRewards, XP or achievements (server).
Log, WebhooksDiscord logs (server).