Page cover

Set Up your Server

We will see how and what we have to do to leave our server to perfection, we will learn how to touch the server.cfg and we will see what to touch and what not to touch.

Server.cfg

The server.cfg is a file that contains all the basic configuration of the server, in it we will start the scripts, directories and configure various server parameters such as the name, sql string, logo, banner, keys, slots, onesync...

You can find more info here: FiveM Server Cfg Guide

Endpoints and Build

Endpoints should normally not be touched unless we use another port to enter, in which case both the udp and tcp should be changed, the GameBuild refers to the dlc we will be in, currently the default one will be "The Contract", this activates the vanilla cars and other additions.

cfgendpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
set sv_enforceGameBuild 2545 #-- Game Build

Sets and Basic Config

I think some of them don't need to be explained as they are basically the server name, logos and banners, we will go into detail with the sql string and the sv_maxclients.

sv_licenseKey "YOUR KEYMASTER KEY" #-- Create yours on https://keymaster.fivem.net/
sets banner_detail "https://imgur.com/lJQlWR7"
sets banner_connecting "https://imgur.com/LWCsdVZ"
load_server_icon logo.png
sv_hostname "i-Legacy ESX Server"
sets sv_projectName "i-Legacy ESX Server"
sets sv_projectDesc "i-Legacy ESX Server"
set mysql_connection_string "mysql://root@localhost/es_extended?charset=utf8mb4"
sets tags "esx, legacy, roleplay"
sv_maxclients 4

About mysql_connection_string

The stringsql connection is essential, we must set it correctly with several values, now we will explain them.

By default we will use "mysql://root@localhost/en_extended?charset=utf8mb4". Which indicates that we use a root user on the ip localhost, the database that will connect will be called "es_extended", if we call it for example "iker_sql", we will need to change the name of the table and the connection.

If we want to add password or configure it in the mariadb setup, we will have to add it after the first ROOT, example; mysql://root:password@localhost/en_extended?charset=utf8mb4

Resources

To start a directory we will put it like this; ensure [directory] , it has to be inside the folder "resources". To start a script, we will do it in the following way; ensure scriptname we can use ensure or start, preferably I use ensure but it is the same.

Starting Cmd

Once we have everything done, we will start the start-server.cmd If we have done all the steps correctly, it will appear as follows once everything is opened correctly.

How to Fix Server List Query Error

FW PORT ERROR

Last updated