Docs / Treino: servidor FiveM (GTA V)
Configure server.cfg
The essential settings of the configuration file, explained line by line.
Por agora, esta documentação só existe em inglês e em francês.
Training on GTA V: this page covers FiveM, the GTA V roleplay platform. No tool to create a GTA 6 server has been announced: what you learn here is the best preparation.
The server.cfg file is read at startup. txAdmin creates one; here are the lines that matter.
Commented example
# Network: the port players use
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
# Server identity in the FiveM list
sv_hostname "My RP server"
sets sv_projectName "My RP server"
sets sv_projectDesc "Serious RP, whitelist, English-speaking community"
sets locale "en-US"
sets tags "roleplay, en, serious"
# License key (portal.cfx.re) and slot count
sv_licenseKey "your_key_here"
sv_maxclients 48
# Player synchronisation
set onesync on
# Base resources, then yours
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure hardcap
# Administrators
add_ace group.admin command allow
add_principal identifier.fivem:YOUR_ID group.admin
The important lines
| Line | What it does |
|---|---|
endpoint_add_tcp / endpoint_add_udp |
The listening port. Open it in TCP and UDP |
sv_hostname |
The name shown in the server list |
sets sv_projectName / sv_projectDesc |
The title and description of the server listing |
sv_licenseKey |
Your license key, never publish it |
sv_maxclients |
The maximum number of players |
set onesync on |
Enables OneSync (server-side sync), needed for large servers |
ensure name |
Starts a resource, in the written order |
To be checked: the number of slots allowed depends on your Cfx.re account (some limits require an Element Club subscription). Check the current terms on portal.cfx.re before setting
sv_maxclients.
The order of "ensure"
Resources start in file order. Put the dependencies first (database, libraries), then the framework, then your scripts. Example:
ensure oxmysql
ensure ox_lib
ensure es_extended
ensure my_scripts
Never publish
Your license key, the database password and your Discord webhooks. If you share your configuration, remove them first.
What about GTA 6?
To be confirmed: the configuration format of a GTA 6 server is not known. The concepts will remain: server name, slot count, license, script start order and secrets to protect.
