Skip to content

Configure

Dependencies, database, server.cfg order, and a quick test.

Configuration#

Almost everything is controlled from config.lua.

config_defaults.lua holds internal defaults. Prefer changing config.lua only.

Framework and language#

lua
Config.Core = "QBCore"   -- QBCore or ESX
Config.Locale = "en"     -- locales/<code>.json

Built-in languages:

  • en — English
  • tr — Turkish
  • pt — Portuguese
  • es — Spanish
  • de — German

To add a language: copy locales/en.json → locales/xx.json, translate it, then set Config.Locale = "xx".

Notifications and target#

lua
Config.Bridge = {
    Notify = "ox_lib", -- ox_lib | qbcore | esx | auto
    Target = "auto",   -- auto | ox_target | qb-target | qtarget
}
  • Notify — how messages are shown to players
  • Target — how players interact with the pitch NPC
    "auto" picks the first available target system

Commands#

lua
Config.Commands = {
    OpenMenu = "soccer",
    GoalDebugToggle = "soccer_goaldebug",
}

Change OpenMenu if you want a different chat command.

Match length#

lua
Config.MatchDuration = 20 -- minutes (default lobby match length)

Hosts can still change lobby settings in-game (time, format, etc.).

Host keys (during a match)#

These use FiveM control IDs:

lua
Config.HostKeys = {
    StartMatch = 166,  -- F5
    TogglePause = 311, -- K
    EndMatch = 182,    -- L
    ToggleDoors = 29,  -- B
}

Player keys#

lua
Config.PlayerKeys = {
    Steal = 38,     -- E (soft steal with sprint)
    HardSteal = 45, -- R (slide tackle)
}

Typical controls:

  • E — goalkeeper actions (when in GK role / zone)
  • Shift + E — soft steal
  • R — slide tackle

Invite / celebration / scoreboard keys can also be rebound in GTA Settings → Key Bindings.

Map blips#

lua
Config.MapBlips = {
    Enabled = true,
    Sprite = 58,
    Color = 2,
    Scale = 1.0,
    Label = false,     -- false = use pitch name
    ShortRange = false,
}

Pitches#

Each entry in Config.Pitches is one playable field.

lua
{
    id     = "broker_park",
    name   = "Broker Park",
    coords = vector3(771.29, -234.16, 65.22),
    radius = 50.0,
    image  = "area1.png",
    npc = {
        enabled = true,
        model   = "a_m_y_dhill_01",
        coords  = vector4(800.04, -232.21, 66.22, 165.80),
    },
    doors = {},
    goals = {
        {
            center      = vector3(...),
            halfExtents = vector3(2.4, 3.1, 2.5),
            scoringTeam = 2,
            side        = "West goal",
        },
        -- second goal...
    },
}

Pitch fields (simple)#

FieldMeaning
idUnique ID (used by exports and saves)
nameDisplay name
coordsCenter of the pitch
radiusPlay / lobby area size
npcTarget ped for the menu
doorsOptional gates the host can lock
goalsGoal boxes used for scoring

The script ships with Broker Park and Vespucci Beach ready to use. You can add more pitches the same way.

Balls#

Balls shown in the lobby creator:

lua
Config.Balls = {
    {
        id = "classic",
        name = "Classic Soccer Ball",
        model = "p_ld_soc_ball_01",
        image = "default.png", -- file in web/dist/assets
        rollRadius = 0.11,
    },
}

Team kits (uniforms)#

Kits are applied directly to the ped (no clothing script required).

Edit Config.Uniforms in config.lua to change drawable indexes for home / away teams.

Jersey number limits:

lua
-- from defaults / override in config.lua
Config.UniformNumbers = {
    Min = 1,
    Max = 10,
    Default = 5,
}

Assists and leaderboard#

lua
Config.Assists = {
    Enabled = true,
    WindowMs = 5000,           -- assist time window
    LeaderboardOrderBy = "goals", -- goals | assists | matches
}

API / match history#

lua
Config.API = {
    SaveMatchHistory = true,
    LeaderboardDefaultLimit = 10,
    LeaderboardMaxLimit = 100,
    MatchHistoryDefaultLimit = 20,
    MatchHistoryMaxLimit = 100,
    EnableServerEvents = true,
    EnableNetEvents = true,
}

Set SaveMatchHistory = false if you do not want matches written to the database.

Stadium scoreboard (DUI)#

Controlled by Config.FootballScoreboard.

Important options:

OptionMeaning
EnabledTurn stadium boards on/off
ScoreboardDriver"soccer" (default) = driven by this script
DuiWidth / DuiHeightDUI resolution
DrawDistanceHow far the board is drawn
BoardsList of physical scoreboard props

Each board can have:

  • coords, heading
  • model (example: prop_huge_display_01)
  • renderTarget (example: big_disp)
  • screenRotation — rotate the image on the screen (0 or 180)
  • optional support pole (supportModel, supportOffset, …)

If a board looks upside down, try changing that board’s screenRotation between 0 and 180.

Goalkeeper and slide tackle#

You can enable / tweak these in config.lua (or rely on defaults):

lua
-- Example overrides
Config.Goalkeeper = { Enabled = true }
Config.SlideTackle = {
    EnableKnockdown = true,
    DurationMs = 700,
    StealDistance = 2.15,
}

Advanced steal / physics settings live in config_defaults.lua. Override only what you need in config.lua.

Locales for config names#

Pitch names, ball names, door labels, and similar strings can be localized in locales/*.json under the config section.

If a locale key is missing, the script falls back to the name written in config.lua.