FiveM Docs
es_extendedConfig

Main Config

Every key in es_extended shared/config/main.lua for ESX Legacy 1.16.4 with type, default value and effect. Accounts, spawns, paychecks, permissions and convars.

The main es_extended config controls accounts, starting money and items, spawn points, command permissions, paychecks, weight and a few framework switches. It lives in es_extended/shared/config/main.lua and is loaded on both server and client. You can read it from other resources with ESX.GetConfig().

Overview

FactValue
Filees_extended/shared/config/main.lua
SideShared (server and client)
Read from other resourcesESX.GetConfig() or ESX.GetConfig("MaxWeight")
Other config filesweapons, adjustments, logs
Apply changesRestart the server

Do not edit other core files. The config files are meant to be changed; logic files get overwritten on every update. Keep a copy of your config so you can merge it after updating. See updating ESX.

Reading the config

local maxWeight = ESX.GetConfig("MaxWeight")
local config = ESX.GetConfig() -- the whole Config table

ESX.GetConfig(key) returns Config[key], or the whole table without a key. See shared functions.

Convars

Some values are read from convars, so you set them in server.cfg instead of the Lua file. Use setr so the client can read them too.

ConvarDefaultSetsDescription
esx:localenot setConfig.LocaleLanguage code, for example en, de, fr. Falls back to the txAdmin-locale convar, then en.
esx:localeFallback"true"Config.LocaleFallbackFill missing translation keys from English. Set to "false" while writing a new translation.
esx:identifier"license"Config.IdentifierIdentifier type used to store characters (license, license2, steam, discord, fivem, ...).
server.cfg
setr esx:locale "en"
setr esx:identifier "license"

Framework

KeyTypeDefaultDescription
Localestringfrom convarsActive language. Set it with the esx:locale convar.
LocaleFallbackbooleantrueUse English for missing translation keys.
CustomInventoryfalse or stringfalseLeave false. Set to "ox" automatically when the ox_inventory resource exists. Other values only for inventories that ship their own ESX bridge.
EnableDebugbooleanfalseEnables ESX.Trace output and extra error messages (for example in getMeta). Keep it off in production.
Multicharbooleanautotrue when the esx_multicharacter resource exists. Do not set it by hand unless a third-party multicharacter resource tells you to.
IdentitybooleantrueLoad firstname, lastname, dateofbirth, sex and height from users. Always active with multicharacter.
Identifierstring"license"From the esx:identifier convar. Do not change it in the file.
EnableDefaultInventorybooleanautotrue when CustomInventory is false. Enables the default F2 inventory. Do not change.
OxInventorybooleanautoBackwards compatibility flag, equals CustomInventory == "ox". Defined in shared/main.lua.

Accounts

Accounts

Config.Accounts defines the money accounts every character has. Each key is the account name.

FieldTypeDefaultDescription
labelstringDisplay name, usually a translation.
roundbooleantrueRound amounts to whole numbers. Set to false for accounts with decimals.
transferableboolean?trueSet to false to stop players from giving or dropping this account through the default inventory. bank is not transferable by default.
shared/config/main.lua
Config.Accounts = {
    bank = { label = TranslateCap("account_bank"), round = true, transferable = false },
    black_money = { label = TranslateCap("account_black_money"), round = true },
    money = { label = TranslateCap("account_money"), round = true },
    crypto = { label = "Crypto", round = false, transferable = false }, -- custom account
}

New accounts appear for all characters on their next load, with the starting value from StartingAccountMoney or 0. Learn more in the money and accounts guide.

StartingAccountMoney

TypeDefault
table<string, number>{ bank = 50000 }

Balances for new characters. Also used as the starting value when an existing character is missing an account. With ox_inventory, accounts stored as items (money, black_money) are given as items on creation.

Config.StartingAccountMoney = { bank = 50000, money = 500 }

StartingInventoryItems

TypeDefault
table<string, number> or falsefalse

Items for new characters (default inventory), as { [itemName] = count }.

Config.StartingInventoryItems = { bread = 2, water = 2, phone = 1 }

Spawning

KeyTypeDefaultDescription
DefaultSpawnstable[]one spawn at Legion SquareList of { x, y, z, heading }. One is picked at random for new characters and when a saved position is invalid.
PlayerCoordinateLimitnumber10000.0Maximum absolute x, y and z that ESX accepts for player positions. Raise it if you use maps far outside the default world.
Config.DefaultSpawns = {
    { x = 222.2027, y = -864.0162, z = 30.2922, heading = 1.0 },
    { x = -1037.5, y = -2737.6, z = 20.2, heading = 330.0 }, -- airport
}

DefaultSpawns must contain at least one valid position. Without one, new players are dropped with the error code invalid-spawn-config.

Permissions

CommandPermissions

TypeDefault
table<string, string[]>see below

Maps every built-in command to the groups that may use it. Commands without an entry are limited to admin. Aliases use the entry of their main command.

GroupsCommands
owner, adminsetcoords, setjob, car, cardel, fix, setaccountmoney, giveaccountmoney, removeaccountmoney, giveitem, giveweapon, giveammo, giveweaponcomponent, clearall, refreshjobs, refreshitems, clearinventory, clearloadout, setgroup, save, saveall, goto, bring, kill, freeze, unfreeze, setdim, players, noclip, tpm, coords
user, admin, ownerclear, group, job, info, playtime

See the commands page for what each command does.

AdminGroups

TypeDefault
table<string, boolean>{ owner = true, admin = true }

Deprecated

Marked deprecated in favor of CommandPermissions (the comment says it will be removed in 1.15, but it is still present and used in 1.16.4). ESX still uses it in xPlayer.isAdmin() and the esx:isUserAdmin callback, which /tpm and /noclip rely on.

ValidCharacterSets

TypeDefault
table<string, boolean>all false

Extra alphabets that ESX.IsValidLocaleString accepts, for example in character names. Basic Latin and the alphabet of the active locale are always allowed. Keys: el (Greek), sr (Cyrillic), he (Hebrew), ar (Arabic), zh-cn (Chinese, Japanese, Korean).

Config.ValidCharacterSets = { ["el"] = false, ["sr"] = true, ["he"] = false, ["ar"] = false, ["zh-cn"] = false }

Paychecks

KeyTypeDefaultDescription
EnablePaycheckbooleantruePay salaries at a fixed interval.
PaycheckIntervalnumber7 * 60000Interval in milliseconds (7 minutes).
PaycheckBatchSizenumber100Players paid before the loop yields.
PaycheckBatchDelaynumber250Milliseconds to wait between batches.
PaycheckJitternumber30 * 1000Up to this many extra milliseconds of random delay per run, so servers do not pay at the exact same moment.
OffDutyPaycheckMultipliernumber0.5Share of the salary paid to off-duty players (0.5 = 50 %).
EnableSocietyPayoutsbooleanfalsePay salaries from the job's society account (needs esx_society and esx_addonaccount). If the society cannot pay, the player gets nothing.
LogPaycheckbooleanfalseLog paychecks to the Paycheck webhook in the logs config.

Unemployed players receive their unemployed grade salary as welfare. Salaries are always paid to the bank account. Use xPlayer.togglePaycheck(false) to skip single players.

Jobs

KeyTypeDefaultDescription
DefaultJobDutybooleantrueDuty state after setJob when no duty is passed, and for characters without a saved duty state. unemployed is always off duty.

Player

KeyTypeDefaultDescription
MaxWeightnumber24Inventory weight limit without a backpack. With ox_inventory it sets the inventory:weight convar (MaxWeight * 1000 grams).
SaveDeathStatusbooleantrueRestore a saved health of 0 on reconnect, so players who log out dead are still dead.
DistanceGivenumber4.0Maximum distance for giving items, money and weapons to another player.

Logging

KeyTypeDefaultDescription
AdminLoggingbooleanfalseSend admin command usage to the UserActions webhook.

Frequently asked questions

Independent documentation

esx-fivem.com is a community project and is not affiliated with the ESX Framework team. Facts on this page were checked against the upstream source. Official resources: docs.esx-framework.org and github.com/esx-framework.
Edit on GitHub

Last updated on

On this page