Skip to content

FightClub API Reference

Configuration Reference

All options live in config.lua under the global Config table. Sensitive server-only values belong in server/server_config.lua.

General

KeyTypeDefaultDescription
DebugbooleanfalseEnables extra client-side debug output.
CooldownBetweenFightsnumber300000Per-arena cooldown in ms after a fight ends (default 5 min).

Level Thresholds (Config.Levels)

Maps level number → total XP required to reach it. Level 1 is the starting level (0 XP).

lua
Config.Levels = {
    [1] = 0, [2] = 20, [3] = 50, [4] = 100,
    [5] = 180, [6] = 300, [7] = 500, [8] = 800,
    [9] = 1200, [10] = 2000
}

Players earn 1 XP per round fought regardless of outcome.

Fight Locations (Config.FightLocations)

Each entry defines one arena. Fields:

FieldTypeDescription
LevelnumberMinimum fighter level required to enter (ignored when AllowAll = true).
EntryFeenumberAmount of Config.Currency required to enter.
AllowAllbooleanIf true, bypasses the level requirement.
CenterPosvec4Center of the arena; spectator crowd spawns at this radius.
Trainer.modelstringPed model hash string for the fight trainer/guard NPC.
Trainer.locationvec4World position + heading for the trainer.
PlayerFightingPosvec4Where the player is teleported when the fight starts.
NPCFighter.modelstringPed model used for the promoted opponent.
NPCFighter.positionvec4Fight spot the NPC walks to.
NPCFighter.minHealthnumberMinimum health rolled for the opponent.
NPCFighter.maxHealthnumberMaximum health rolled for the opponent.
Spectators.amountnumberHow many spectator peds to spawn.
Spectators.modelstablePool of ped models chosen at random for spectators.

Item Shop (Config.Shop)

Items purchasable via the seller NPC using Config.SoapItem as currency.

lua
Config.Shop = {
    ['bandage']  = { item = "Bandage",       price = 1, amount = 10 },
    ['firstaid'] = { item = "First Aid Kit", price = 1, amount = 3  },
}

price is the number of soaps required; amount is how many of the item are given.

First Aid Station

KeyTypeDescription
FirstAidStationCoordsvec3World position of the ox_target first-aid pickup zone.
FirstAidItemstringItem name given to the player.
FirstAidStation.minnumberMinimum quantity given per pickup.
FirstAidStation.maxnumberMaximum quantity given per pickup.

Economy

KeyDefaultDescription
Config.Currency"money"ox_inventory item used for entry fees, prize payouts, and ban repayments.
Config.SoapItem"pinksoap"Item used as shop currency and ban-unblock payment.
Config.SoapUnblockCost100Number of soaps required for self-unblock.
Config.SoapReward.minLevel5Minimum fighter level to be eligible for a soap drop.
Config.SoapReward.chance10Percent chance (1–100) of receiving a soap after any fight.
Config.ToothItem"body_humantooth"Item given on the rare 5% tooth drop after winning a fight.

Stamina (Config.Stamina)

All stamina values are client-side only and take effect immediately on resource restart — no server restart needed.

KeyDefaultDescription
drainPerAttack10Stamina lost per attack input frame.
blockRegenPerFrame0.1Stamina gained per frame while holding block (no attack).
baseRegenPerTick0.03Minimum auto-regen per tick (players with low stamina stat).
capRegenPerTick0.2Maximum auto-regen per tick (players with high stamina stat).
logScale900.0Log-curve width for stamina stat → regen scaling. Higher = slower ramp.
regenTickMs50Regen loop interval in milliseconds.
regenDelayMs3000Delay in ms before regen begins once conditions are met.
regenIdleGateMs2000Required idle time (no attack inputs) before regen is allowed.
regenStartThreshold40Regen only activates when stamina drops below this percentage.

KO Recovery Customization

The KO recovery flow is intentionally exposed in client_open.lua. This file is non-escrowed and loaded before the main client logic.

Use HandleFightClubKO(context) to run your own recovery minigame and post-success heal/revive flow. When the player succeeds, call CompleteFightClubKORecovery(context).

The context table includes:

FieldTypeDescription
playerPednumberClient ped handle for the knocked-out player.
fightingLevelnumberCurrent fight-club level for the player.
strengthnumberCurrent strength value used for KO scaling.
baseDifficultynumberRaw difficulty before bonuses are applied.
adjustedDifficultynumberRecommended difficulty value to pass into your minigame.
iterationsnumberSuggested number of taps/checks/rounds for the recovery minigame.

Opinionated defaults for adjustedDifficulty:

  • 80+ = very hard, best reserved for weak or brand-new fighters
  • 60-79 = solid default range for most servers
  • 40-59 = forgiving and good for casual progression
  • <40 = very easy, recovery should usually succeed

Suggested use of iterations:

  • 1 for brutal KOs or low-level fighters
  • 2 for a normal recovery minigame
  • 3 only if you want recovery to be intentionally demanding

Minimal example:

lua
function HandleFightClubKO(context)
    local success = exports['your_minigame']:Start(context.iterations, context.adjustedDifficulty)

    if success then
        TriggerEvent('your_medical_resource:client:healOrRevive')
        CompleteFightClubKORecovery(context)
    end
end

Server Exports

IsBlockedFromFightClub(src)

Returns whether a player is currently banned from the fight club.

Parameters

NameTypeDescription
srcnumberServer player ID.

Returnsboolean

lua
local banned = exports['metaden-fightclub']:IsBlockedFromFightClub(source)

GetPlayerFighting(src)

Returns the full fighter record for a player.

Parameters

NameTypeDescription
srcnumberServer player ID.

Returns

lua
{
    level                 = number,  -- current fight level (1–10)
    experience            = number,  -- total XP earned
    wins                  = number,
    losses                = number,
    earnings              = number,  -- total cash won across all fights
    experienceToNextLevel = number,  -- XP threshold for next level (0 if max level)
    blocked               = boolean,
}
lua
local record = exports['metaden-fightclub']:GetPlayerFighting(source)

Client Exports

isPlayerFighter(entity)

Returns whether the given entity handle is the calling player's spawned companion fighter.

Parameters

NameTypeDescription
entitynumberClient entity handle (ped).

Returnsboolean

lua
local isFighter = exports['metaden-fightclub']:isPlayerFighter(entity)
if isFighter then
    -- block interaction, e.g. prevent selling drugs to the fighter
    return
end

Server Callbacks

Registered via ox_lib and invoked client-side with lib.callback.await.


metaden-fight-club:server:GetPlayerFighting

Returns the caller's own fighter record. Same shape as the GetPlayerFighting export.


metaden-fight-club:server:GetPlayerDamageModifier

Returns a melee damage multiplier for the calling player.

Calculation

  • Base: 1.0
  • +floor(level / 5) * 0.1 per 5 fight levels
  • If gym strength > 60: +(strength / 1000) * 0.1
  • Capped at 1.8
  • Blocked players receive no bonus (returns 1.0).

Returnsnumber


metaden-fight-club:server:GetSellerPosition

Returns the world position of the soap shop seller NPC.

Returnsvec4


metaden-fight-club:server:GetPlayerSkills

Returns the calling player's configured skill XP values when Config.SkillsIntegration is enabled and the target skills are configured.

Returnstable|nil


metaden-fight-club:server:GetLeaderboard

Returns two top-10 leaderboards built from metaden_fight_club:

  • byWins (wins desc, then level)
  • byLevel (level desc, then experience)

Returns{ byWins = table, byLevel = table }


metaden-fight-club:server:GetAdminFighters

Returns the full fighter list for the admin panel, including earnings, soaps, teeth, blocked state, and resolved names.

Returnstable


metaden-fight-club:server:GetBannedPlayers

Returns currently blocked fighters for the admin panel.

Returnstable


Server Events

metaden-fight-club:Server:startFight (client → server)

Initiates a fight session. Performs all validation (cooldown, ban check, payment) before confirming.

ParameterTypeDescription
indexnumberConfig.FightLocations key.
roundsnumberNumber of rounds to fight.

metaden-fight-club:server:fightEnd (client → server)

Fired by the client when a fight session concludes. Handles prize payout, XP update, and ban logic.

ParameterTypeDescription
winboolean|niltrue = won, false = lost, nil = opponent failed to appear (refund).
timesRanAwaynumberNumber of times the player left their opponent during the session.

metaden-fight-club:server:getFirstAid (client → server)

Gives the calling player a random quantity of Config.FirstAidItem. Limited to one pickup per session.


metaden-fight-club:server:giveTooth (client → server)

Gives the calling player one Config.ToothItem. Triggered automatically client-side on the 5% rare win drop.


metaden-fight-club:server:unblockPlayer (client → server)

Self-unblock flow. Requires Config.SoapUnblockCost soaps and the player's total career earnings in cash. On success, fully resets the fight record.


metaden-fight-club:server:BuyFromFightClub (client → server)

Purchases a shop item using pink soaps.

ParameterTypeDescription
itemstringKey in Config.Shop.

metaden-fight-club:server:AdminBanById (client → server)

Admin panel action to ban a fighter record by source ID or citizen ID string.

ParameterTypeDescription
targetnumber|stringSource ID or citizen ID.

metaden-fight-club:server:AdminUnbanById (client → server)

Admin panel action to unban a fighter record by source ID or citizen ID string.

ParameterTypeDescription
targetnumber|stringSource ID or citizen ID.

metaden-fight-club:server:AdminResetById (client → server)

Admin panel action to reset a fighter record (unblock, level/XP/wins/losses/earnings/soap/tooth reset).

ParameterTypeDescription
targetnumber|stringSource ID or citizen ID.

Admin Commands

CommandPermissionParametersDescription
/createfightRequires 1 pink soap<target> [skill] [model]Spawns a custom fight opponent against the target player. skill 1–10 sets HP tier; model overrides the ped model. Costs 1 soap from the caller. Cannot target LEO-job players.
/fightclubPlayerOpens the player fight club panel.
/fightclubadmingroup.adminOpens the fight club admin panel UI.

NUI Message Reference

Messages sent from client Lua to the fight HUD via SendNUIMessage.

typePayloadDescription
barStatus{ display: boolean }Shows (true) or hides (false) the entire HUD panel.
barLevel{ level: number }Updates the stamina bar (0–100).
playerHP{ level: number }Updates the player HP bar (0–100).
enemyHP{ level: number }Updates the opponent HP bar (0–100).

Database Schema

sql
CREATE TABLE `metaden_fight_club` (
    `id`         VARCHAR(50)  NOT NULL,   -- citizenid
    `level`      INT          NOT NULL DEFAULT 1,
    `experience` INT          NOT NULL DEFAULT 0,
    `wins`       INT          NOT NULL DEFAULT 0,
    `losses`     INT          NOT NULL DEFAULT 0,
    `earnings`   INT          NOT NULL DEFAULT 0,
    `blocked`    BOOLEAN      NOT NULL DEFAULT FALSE,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Configuration Reference

All options live in config.lua under the global Config table. Sensitive server-only values belong in server/server_config.lua.

General

KeyTypeDefaultDescription
DebugbooleanfalseEnables extra client-side debug output.
CooldownBetweenFightsnumber300000Per-arena cooldown in ms after a fight ends (default 5 min).

Level Thresholds (Config.Levels)

Maps level number → total XP required to reach it. Level 1 is the starting level (0 XP).

lua
Config.Levels = {
    [1] = 0, [2] = 20, [3] = 50, [4] = 100,
    [5] = 180, [6] = 300, [7] = 500, [8] = 800,
    [9] = 1200, [10] = 2000
}

Players earn 1 XP per round fought regardless of outcome.

Fight Locations (Config.FightLocations)

Each entry defines one arena. Fields:

FieldTypeDescription
LevelnumberMinimum fighter level required to enter (ignored when AllowAll = true).
EntryFeenumberAmount of Config.Currency required to enter.
AllowAllbooleanIf true, bypasses the level requirement.
CenterPosvec4Center of the arena; spectator crowd spawns at this radius.
Trainer.modelstringPed model hash string for the fight trainer/guard NPC.
Trainer.locationvec4World position + heading for the trainer.
PlayerFightingPosvec4Where the player is teleported when the fight starts.
NPCFighter.modelstringPed model used for the promoted opponent.
NPCFighter.positionvec4Fight spot the NPC walks to.
NPCFighter.minHealthnumberMinimum health rolled for the opponent.
NPCFighter.maxHealthnumberMaximum health rolled for the opponent.
Spectators.amountnumberHow many spectator peds to spawn.
Spectators.modelstablePool of ped models chosen at random for spectators.

Item Shop (Config.Shop)

Items purchasable via the seller NPC using Config.SoapItem as currency.

lua
Config.Shop = {
    ['bandage']  = { item = "Bandage",       price = 1, amount = 10 },
    ['firstaid'] = { item = "First Aid Kit", price = 1, amount = 3  },
}

price is the number of soaps required; amount is how many of the item are given.

First Aid Station

KeyTypeDescription
FirstAidStationCoordsvec3World position of the ox_target first-aid pickup zone.
FirstAidItemstringItem name given to the player.
FirstAidStation.minnumberMinimum quantity given per pickup.
FirstAidStation.maxnumberMaximum quantity given per pickup.

Economy

KeyDefaultDescription
Config.Currency"money"ox_inventory item used for entry fees, prize payouts, and ban repayments.
Config.SoapItem"pinksoap"Item used as shop currency and ban-unblock payment.
Config.SoapUnblockCost100Number of soaps required for self-unblock.
Config.SoapReward.minLevel5Minimum fighter level to be eligible for a soap drop.
Config.SoapReward.chance10Percent chance (1–100) of receiving a soap after any fight.
Config.ToothItem"body_humantooth"Item given on the rare 5% tooth drop after winning a fight.

Stamina (Config.Stamina)

All stamina values are client-side only and take effect immediately on resource restart — no server restart needed.

KeyDefaultDescription
drainPerAttack10Stamina lost per attack input frame.
blockRegenPerFrame0.1Stamina gained per frame while holding block (no attack).
baseRegenPerTick0.03Minimum auto-regen per tick (players with low stamina stat).
capRegenPerTick0.2Maximum auto-regen per tick (players with high stamina stat).
logScale900.0Log-curve width for stamina stat → regen scaling. Higher = slower ramp.
regenTickMs50Regen loop interval in milliseconds.
regenDelayMs3000Delay in ms before regen begins once conditions are met.
regenIdleGateMs2000Required idle time (no attack inputs) before regen is allowed.
regenStartThreshold40Regen only activates when stamina drops below this percentage.

KO Recovery Customization

The KO recovery flow is intentionally exposed in client_open.lua. This file is non-escrowed and loaded before the main client logic.

Use HandleFightClubKO(context) to run your own recovery minigame and post-success heal/revive flow. When the player succeeds, call CompleteFightClubKORecovery(context).

The context table includes:

FieldTypeDescription
playerPednumberClient ped handle for the knocked-out player.
fightingLevelnumberCurrent fight-club level for the player.
strengthnumberCurrent strength value used for KO scaling.
baseDifficultynumberRaw difficulty before bonuses are applied.
adjustedDifficultynumberRecommended difficulty value to pass into your minigame.
iterationsnumberSuggested number of taps/checks/rounds for the recovery minigame.

Opinionated defaults for adjustedDifficulty:

  • 80+ = very hard, best reserved for weak or brand-new fighters
  • 60-79 = solid default range for most servers
  • 40-59 = forgiving and good for casual progression
  • <40 = very easy, recovery should usually succeed

Suggested use of iterations:

  • 1 for brutal KOs or low-level fighters
  • 2 for a normal recovery minigame
  • 3 only if you want recovery to be intentionally demanding

Minimal example:

lua
function HandleFightClubKO(context)
    local success = exports['your_minigame']:Start(context.iterations, context.adjustedDifficulty)

    if success then
        TriggerEvent('your_medical_resource:client:healOrRevive')
        CompleteFightClubKORecovery(context)
    end
end

Server Exports

IsBlockedFromFightClub(src)

Returns whether a player is currently banned from the fight club.

Parameters

NameTypeDescription
srcnumberServer player ID.

Returnsboolean

lua
local banned = exports['metaden-fightclub']:IsBlockedFromFightClub(source)

GetPlayerFighting(src)

Returns the full fighter record for a player.

Parameters

NameTypeDescription
srcnumberServer player ID.

Returns

lua
{
    level                 = number,  -- current fight level (1–10)
    experience            = number,  -- total XP earned
    wins                  = number,
    losses                = number,
    earnings              = number,  -- total cash won across all fights
    experienceToNextLevel = number,  -- XP threshold for next level (0 if max level)
    blocked               = boolean,
}
lua
local record = exports['metaden-fightclub']:GetPlayerFighting(source)

Server Callbacks

Registered via ox_lib and invoked client-side with lib.callback.await.


metaden-fight-club:server:GetPlayerFighting

Returns the caller's own fighter record. Same shape as the GetPlayerFighting export.


metaden-fight-club:server:GetPlayerDamageModifier

Returns a melee damage multiplier for the calling player.

Calculation

  • Base: 1.0
  • +floor(level / 5) * 0.1 per 5 fight levels
  • If gym strength > 60: +(strength / 1000) * 0.1
  • Capped at 1.8
  • Blocked players receive no bonus (returns 1.0).

Returnsnumber


metaden-fight-club:server:GetSellerPosition

Returns the world position of the soap shop seller NPC.

Returnsvec4


metaden-fight-club:server:GetPlayerSkills

Returns the calling player's configured skill XP values when Config.SkillsIntegration is enabled and the target skills are configured.

Returnstable|nil


metaden-fight-club:server:GetLeaderboard

Returns two top-10 leaderboards built from metaden_fight_club:

  • byWins (wins desc, then level)
  • byLevel (level desc, then experience)

Returns{ byWins = table, byLevel = table }


metaden-fight-club:server:GetAdminFighters

Returns the full fighter list for the admin panel, including earnings, soaps, teeth, blocked state, and resolved names.

Returnstable


metaden-fight-club:server:GetBannedPlayers

Returns currently blocked fighters for the admin panel.

Returnstable


Server Events

metaden-fight-club:Server:startFight (client → server)

Initiates a fight session. Performs all validation (cooldown, ban check, payment) before confirming.

ParameterTypeDescription
indexnumberConfig.FightLocations key.
roundsnumberNumber of rounds to fight.

metaden-fight-club:server:fightEnd (client → server)

Fired by the client when a fight session concludes. Handles prize payout, XP update, and ban logic.

ParameterTypeDescription
winboolean|niltrue = won, false = lost, nil = opponent failed to appear (refund).
timesRanAwaynumberNumber of times the player left their opponent during the session.

metaden-fight-club:server:getFirstAid (client → server)

Gives the calling player a random quantity of Config.FirstAidItem. Limited to one pickup per session.


metaden-fight-club:server:giveTooth (client → server)

Gives the calling player one Config.ToothItem. Triggered automatically client-side on the 5% rare win drop.


metaden-fight-club:server:unblockPlayer (client → server)

Self-unblock flow. Requires Config.SoapUnblockCost soaps and the player's total career earnings in cash. On success, fully resets the fight record.


metaden-fight-club:server:BuyFromFightClub (client → server)

Purchases a shop item using pink soaps.

ParameterTypeDescription
itemstringKey in Config.Shop.

metaden-fight-club:server:AdminBanById (client → server)

Admin panel action to ban a fighter record by source ID or citizen ID string.

ParameterTypeDescription
targetnumber|stringSource ID or citizen ID.

metaden-fight-club:server:AdminUnbanById (client → server)

Admin panel action to unban a fighter record by source ID or citizen ID string.

ParameterTypeDescription
targetnumber|stringSource ID or citizen ID.

metaden-fight-club:server:AdminResetById (client → server)

Admin panel action to reset a fighter record (unblock, level/XP/wins/losses/earnings/soap/tooth reset).

ParameterTypeDescription
targetnumber|stringSource ID or citizen ID.

Admin Commands

CommandPermissionParametersDescription
/createfightRequires 1 pink soap<target> [skill] [model]Spawns a custom fight opponent against the target player. skill 1–10 sets HP tier; model overrides the ped model. Costs 1 soap from the caller. Cannot target LEO-job players.
/fightclubPlayerOpens the player fight club panel.
/fightclubadmingroup.adminOpens the fight club admin panel UI.

NUI Message Reference

Messages sent from client Lua to the fight HUD via SendNUIMessage.

typePayloadDescription
barStatus{ display: boolean }Shows (true) or hides (false) the entire HUD panel.
barLevel{ level: number }Updates the stamina bar (0–100).
playerHP{ level: number }Updates the player HP bar (0–100).
enemyHP{ level: number }Updates the opponent HP bar (0–100).

Database Schema

sql
CREATE TABLE `metaden_fight_club` (
    `id`         VARCHAR(50)  NOT NULL,   -- citizenid
    `level`      INT          NOT NULL DEFAULT 1,
    `experience` INT          NOT NULL DEFAULT 0,
    `wins`       INT          NOT NULL DEFAULT 0,
    `losses`     INT          NOT NULL DEFAULT 0,
    `earnings`   INT          NOT NULL DEFAULT 0,
    `blocked`    BOOLEAN      NOT NULL DEFAULT FALSE,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;