Skip to content
Documentation
Games & Events4FFA Arenas

r_ffa Exports

r_ffa client and server exports: check if a player is in an arena, read their lobby or game mode and count players, plus the reward hooks.

Client exports

local inArena = exports.r_ffa:isInFFA()   -- true in a lobby or duel
local mode = exports.r_ffa:GetGameMode()  -- 'ffa' | '1v1' | nil
local session = exports.r_ffa:GetSession() -- lobby, arena, weapons, kills, deaths, streak or nil
RegisterCommand('phone', function()
    if exports.r_ffa:isInFFA() then return end
    OpenPhone()
end)

Server exports

local total = exports.r_ffa:GetTotalPlayerCount()              -- everyone in a lobby or duel
local count = exports.r_ffa:GetLobbyPlayerCount('paleto_pistols') -- one lobby by its id
local inArena = exports.r_ffa:IsPlayerInFFA(source)
local lobby = exports.r_ffa:GetPlayerLobby(source)
-- { id = 'custom_3', kind = 'custom', label = 'Pistols only', arena = 'paleto', players = 6 } or nil

Rewards

Use the hooks in server/sv_custom.lua to give XP, items or achievements:

function OnKill(killer, victim, lobby, streak)
end

function OnDuelFinished(winner, loser, duel)
    -- duel.bet, duel.currency, duel.target, duel.scores
end

All hooks are listed on Configuration.