FightClub Changelog
All notable changes to this project will be documented in this file.
[1.3.2] - 2026-03-16
Fixed
- Single-owner arena spectator spawning — normal cage fights now designate the fighter who starts the match as the only client allowed to spawn the spectator ring and promoted opponent, preventing nearby players from creating duplicate crowd peds.
- Single-owner trained-fighter spawning — trained-fighter NPC matches and player-vs-player fighter challenges now use one authoritative client to spawn the networked fight peds, which fixes duplicate fighter spawns when other players are nearby.
- Fight ped cleanup on finish/disconnect — both arena fights and trained-fighter matches now register spawned network IDs with the server so cleanup runs reliably on win, loss, cancel, runaway, and owner disconnect.
- HP percentages now respect GTA death threshold — fight HUD and trained-fighter result checks now treat health at or below
100as defeated, preventing dead peds from showing misleading remaining-health percentages.
Changed
- Arena fight state is now server-tracked — active cage fights now store owner and spawned entity state on the server instead of relying on each nearby client's local spectator table.
- Player-vs-player fighter authority now follows the challenger — the challenger owns ped spawning and result authority for trained-fighter wagers, while the other participant receives cleanup/state handling only.
[1.3.1] - 2026-03-10
Added
- Ready-health recovery timer — trained fighters now persist a dedicated
health_recovery_timevalue so the resource can show an exact countdown until the fighter is back to usable HP. - Hurt status in fighter UI — both the ox_lib trainer status menu and the React fighter panels now distinguish low-HP fighters from healthy fighters by showing a
Hurtstate plus the remaining heal timer. - Companion take-out gating — the "Take Fighter" action now checks the fighter's ready-health state and blocks taking out fighters that are still below the configured HP threshold.
Changed
- First aid now restores HP — first aid still reduces injury recovery time, but it also restores
Config.Training.FirstAidHealthRestorePercentof max HP and recalculates the ready-health timer. - Training readiness messaging — train/fight validation now tells players how long remains until their fighter is back to ready HP instead of only reporting a generic injury block.
- New recovery tuning keys —
Config.Training.MinimumReadyHealth,Config.Training.HealthRecoverySecondsPerHp, andConfig.Training.FirstAidHealthRestorePercentwere added for server-side balancing.
Notes
- Safe schema migration included — resource start now ensures the
fighters.health_recovery_timecolumn exists on older installs. - Default ready-health threshold remains 100 HP — this preserves the existing gameplay expectation while making the recovery behavior much clearer to players.
[1.3.0] - 2026-03-10
Added
- Admin overview dashboard —
/fightclubadminnow opens with an Overview section covering both the main fight-club system and the Train-a-Fighter system, including total earnings, XP, wins/losses, average level, injury/rest summaries, and top earners. - Clickable fighter drill-down — the admin Fighters roster now supports clicking a row to jump directly into Fighter Management with that owner's training-fighter state preloaded.
- Persistent trained-fighter earnings — the
fighterstable now stores anearningstotal used by the admin overview and training top-earner rankings. - Immediate food healing options —
Config.Training.Fooditems can now optionally restore current HP instantly with flathealth, percentage-basedhealth_percent, or both.
Changed
- Train-a-Fighter payouts now update training earnings — NPC match wins and player-vs-player wager wins increment the new trained-fighter
earningsfield. - Admin UI navigation flow — Fighter Management can still search by owner/citizen ID manually, but admins no longer need to type an ID when selecting a fighter from the list.
Notes
- Trained-fighter earnings are forward-only — existing fighters start with
earnings = 0when the new column is added. Historical training payouts are not backfilled. - Safe schema migration included — resource start now ensures the
fighters.earningscolumn exists on older installs.
[1.2.0] - 2026-03-09
Added
Config.ShopEnabledtoggle — new boolean inconfig.lua(defaulttrue). Set tofalseto prevent the shop seller NPC from spawning entirely.Config.NPCFighterDamageglobal modifier — configurable melee damage multiplier (default1.0) applied to all NPC fight opponents viaSetAiMeleeWeaponDamageModifier.- Per-arena
DamageModifieroverride — each entry inConfig.FightLocationsnow accepts an optionalDamageModifierkey that overrides the globalConfig.NPCFighterDamagefor that specific arena. - Fighter rest time display — the ox_lib StatusMenu fatigue entry now shows a live countdown ("Resting — Time remaining: Xh Ym") when the fighter is resting, and is disabled to prevent double-resting.
- Rest confirmation dialog — triggering rest now shows a
lib.alertDialogconfirmation with the computed rest duration fromConfig.Training.RestTimebefore committing. - Rest badge in NUI — FighterPage and StatsPage fighter panels now display a blue "Resting · Xh Ym" badge (with faBed icon) when the fighter is actively resting.
isPlayerFighterclient export —exports['metaden-fightclub']:isPlayerFighter(entity)returnstrueif the given entity is the calling player's spawned companion fighter. Useful for blocking interactions (e.g. drug sales) with fighter peds from other resources.
Fixed
- Fighter no longer attacks its owner — four-layer fix: all weapons are stripped on spawn, a dedicated
YOURFIGHTERrelationship group prevents aggression toward the owner,gameEventTriggeredfilters out the fighter ped, and weapons are re-stripped after combat assist. - Discord webhook logging — empty webhook URL now prints a console warning instead of silently failing; HTTP responses with error status codes are logged in red.
[1.1.1] - 2026-03-05
Added
- Train-a-Fighter table auto-creation — the
fighterstable is now created automatically on resource start inserver/train_fighter.luausingCREATE TABLE IF NOT EXISTS. - Centralized Discord logger module — webhook payload building is now handled in
server/logger.luawith shared helper methods for all Fight Club and Train-a-Fighter logs. - Prize scaling configuration block —
Config.PrizeScalingadded toconfig.lua(basePercent,roundBonus,levelBonus) so reward math can be tuned without touching server logic.
Changed
- Webhook call sites refactored — direct
PerformHttpRequestusage in fight and training handlers now routes throughLog.*helpers. - README/API reference refresh — command and API documentation aligned with the current implementation, including admin panel callbacks/events and training API coverage.
[1.1.0] - 2026-03-02
Added
- Player HP bar in the fight HUD — a green (
#4fff91) bar showing the local player's current health percentage, updated every 100 ms alongside the opponent bar. - Opponent HP bar in the fight HUD — a pink (
#ff4fd8) bar tracking the NPC opponent's HP in real time during the fight session. preparingFightflag — all player attack inputs are fully blocked while the NPC opponent is walking to the fight position, preventing pre-fight damage to the opponent.Config.Staminatable — all previously hardcoded stamina constants extracted toconfig.luafor live tuning without code changes:drainPerAttack,blockRegenPerFramebaseRegenPerTick,capRegenPerTick,logScaleregenTickMs,regenDelayMs,regenIdleGateMs,regenStartThreshold
Config.Currency— replaces six hardcoded"black_money"references inserver.lua. Can be set to any ox_inventory item name.Config.SoapItem,Config.SoapUnblockCost,Config.SoapReward,Config.ToothItem— all item strings and reward conditions extracted from code intoconfig.lua.
Changed
- HUD panel redesigned — replaced the plain single green bar with a dark glassmorphism panel (
#0b0f1a, 88% opacity) containing labelled rows for Stamina, My HP, and Opponent. Font is Inter; colours follow the MetaDen brand palette (cyan#00d4ff, green#4fff91, pink#ff4fd8). Percentage values display beside each label with tabular numeral alignment. - NPC opponent no longer teleports —
SetEntityCoordsNoOffsetreplaced withTaskGoStraightToCoord+ an arrival wait loop (15 s deadline). The NPC remains invincible during the walk;SetEntityInvincible(false)is called only afterSetEntityHealthis applied at the destination, making any pre-walk damage irrelevant. - Weapon detection overhauled — removed unreliable
args[4]weapon-hash index reading fromgameEventTriggered. Now usesHasEntityBeenDamagedByWeapon(currentOponent, WEAPON_UNARMED, 0)per-hit, followed byClearEntityLastWeaponDamage, for reliable fist-only enforcement. - Stamina spam exploit fixed — regen now requires
regenIdleGateMsof continuous idle.lastAttackTimeis stamped on every attack frame; the regen loop breaks immediately if the player attacked recently, regardless of how quickly they release and re-press inputs. fightStartedguard added to thestartFightwhile loop — prevents a doublefightEndcall when both the opponent poll loop andgameEventTriggeredwould otherwise fire simultaneously.
Fixed
server.lua:306 attempt to index a nil value (local 'fight')crash whenfightEndfires for a player with no registered fight (e.g. after a disconnect or late event delivery). Now guarded withif not fight then return end.- Lifetime earnings always recorded as
0in the database —local prize = entryFeeinside the win branch was shadowing the outerlocal prize = 0, soUpdateFighterRecordalways received0. Thelocalkeyword removed from the inner assignment. - Player could freely attack the NPC opponent while it was walking into position, starting the real fight with the opponent already at reduced HP.
- Every normal fist punch falsely triggered "bad hit detected" —
gameEventTriggeredwas readingargs[4](theisFatalflag, 0 or 1) instead of the weapon hash, so all valid hits appeared to use a non-unarmed weapon. - Stamina could be maintained near 100% by rapidly tapping attack and block inputs — the single-frame gap between presses caused
IsControlJustPressedto be false, which the old code treated as "idle" and triggered regen immediately.
[1.0.0] - 2026-01-15
Added
- 16 fight arena locations spread across the map, each independently configured with entry fee, minimum level, NPC models, spectator pools, and world positions.
- 10-level XP progression — players earn 1 XP per round fought; level thresholds configurable via
Config.Levels. Level affects damage modifier and soap reward eligibility. - Spectator crowd system — a pool of ambient peds spawns in a circle around the arena center. One ped is randomly selected and promoted to the fight position as the opponent; the rest remain as spectators.
- Multi-round fight sessions — trainers can initiate N-round fights; a fresh opponent is promoted from the remaining spectators for each round.
- Stamina HUD — bottom-centered NUI bar tracking stamina during fights. Drains on attack input, regenerates slowly on idle, recovers slightly while blocking.
- Cheat detection — melee weapon use (non-fist) during a fight ends the session immediately and increments the run-away counter. Multi-round fights allow one run per session; exceeding the limit triggers a permanent ban.
- Melee damage modifier — scales with fight level (
+0.1every 5 levels) and QBX gym strength stat (bonus above 60 strength points). Capped at1.8×. Applied viaSetPlayerMeleeWeaponDamageModifieron player load. - Scaled prize formula — winners receive their entry fee back plus a percentage bonus: base 10%, +5% per round, +5% per arena level above 1.
- Per-arena cooldown (
Config.CooldownBetweenFights) — prevents rapid re-entry to the same arena after a fight concludes. AllowAllflag per arena — bypasses the minimum level requirement; used for starter areas and the prison location.- First aid station — ox_target interaction zone at
Config.FirstAidStationCoords. Gives a random quantity ofConfig.FirstAidItemonce per session per player. - Pink soap economy — soap drops as a random reward after any fight (configurable minimum level and percentage chance). Used as shop currency and as half of the ban-unblock payment.
- Human tooth rare drop — 5% chance to receive
Config.ToothItemupon winning a round. - Item shop — context-menu shop accessible via the seller NPC (
ig_omegaped). Items purchased with pink soaps, defined inConfig.Shop. - Self-unblock system — banned players can surrender
Config.SoapUnblockCostsoaps plus their total career earnings in cash to wipe their record and regain access. /createfightcommand — spend 1 pink soap to spawn a custom opponent (skill1–10 sets HP tier, optional pedmodeloverride) against any target player ID. Blocked if the target is a LEO-job player.- Admin commands:
/banfromfightclub,/unbanfromfightclub(with optionalresetflag),/resetfightrecord,/checkfighterrecord— all restricted togroup.admin. - lb-phone SMS — automatic text messages sent to the player on ban and on unban.
- Discord webhook logging — embed messages for: runaway bans, soap rewards, shop purchases, ban/unban events, and record resets. Webhook URL configured in
server/server_config.lua. - Persistent MySQL records —
metaden_fight_clubtable auto-created on resource start. Stores level, XP, wins, losses, total earnings, and blocked status percitizenid.blockedcolumn added viaALTER TABLE … ADD COLUMN IF NOT EXISTSfor safe upgrades. playerDroppedcleanup — ongoing fight state cleared when a fighter disconnects mid-fight, freeing the arena for the next challenger.- Server exports:
IsBlockedFromFightClub(src)andGetPlayerFighting(src)available for inter-resource use. - Server callbacks registered via
ox_lib:GetPlayerFighting,GetPlayerDamageModifier,GetSellerPosition.
