TIPS TO MAKE YOUR SERVER.cfg LOOK NICE AND CLEAN

Tutoriale, ghiduri de optimizare si suport pentru crearea serverelor.
Post Reply
User avatar
greenie
Full Member
Full Member
Posts: 2948
Joined: Sun Nov 21, 2021 4:55 pm
Jucator SA:MP ?: Nu
Nick:: greenie
Jucator CS ?: Da

TIPS TO MAKE YOUR SERVER.cfg LOOK NICE AND CLEAN

Post by greenie »

Sections
Section Headers
Removing permissions from server.cfg
Section 1: Section Headers
Creating section headers in your server.cfg is a great way to organize the file and make it more readable. You can do this however you like — whether it’s simple tags or fancy ASCII art.

Basic Section Header Example:
# THIS IS AN EXAMPLE OF A HEADER
ensure RESOURCE_1
ensure RESOURCE_2
ensure RESOURCE_3
Or, if you’d like something more interesting, you can use a tool like ASCII GEN to generate custom ASCII art. Then, you can use it in your server.cfg like this:
## .__
## ____ ___ ________ _____ ______ | | ____
## _/ __ \\ \/ /\__ \ / \\____ \| | _/ __ \
## \ ___/ > < / __ \| Y Y \ |_> > |_\ ___/
## \___ >__/\_ \(____ /__|_| / __/|____/\___ >
## \/ \/ \/ \/|__| \/
ensure RESOURCE_1
ensure RESOURCE_2
ensure RESOURCE_3
Section 2: Using exec to Organize Files
Did you know you can use exec within your server.cfg to make things even cleaner? This lets you move most of your configuration out of the main file and into separate ones.

Important: You can only use up to 5 exec files in your `server.cfg’ .

Example (Without Subfolders):
First, create a file inside your server directory (e.g., Keys.cfg):

Image

Then, add this line to the top of your server.cfg:

exec Keys.cfg
Inside your Keys.cfg file, you can include any settings you want. For example, this is where you might store API keys or other sensitive information:

## ____ __.________________.___. _________
## | |/ _|\_ _____/\__ | |/ _____/
## | < | __)_ / | |\_____ \
## | | \ | \ \____ |/ \
## |____|__ \/_______ / / ______/_______ /
## \/ \/ \/ \/

set steam_webApiKey "REPLACE"
sv_licenseKey "REPLACE"
sv_tebexSecret "REPLACE"

set resources_useSystemChat false
set mysql_connection_string "REPLACE"
This keeps your server.cfg file more organized by separating keys and settings into their own file.

Example (With Subfolders):
If you prefer using subfolders to keep your configuration files even more organized, it’s easy to do. For instance, if your configuration files are inside a folder called server, you would use the following:

exec server/help.cfg
Check out this image for a better idea of how it would look:

Image
𝑴𝒂𝒚𝒃𝒆 𝒕𝒉𝒆 𝑬𝒂𝒓𝒕𝒉 𝒊𝒔 𝒕𝒉𝒆 𝑯𝒆𝒍𝒍 𝒐𝒇 𝑨𝒏𝒐𝒕𝒉𝒆𝒓 𝑷𝒍𝒂𝒏𝒆𝒕... ☢️

✅ GAZDUIRE JOCURI / VPS / GAZDUIRE WEB / SERVERE DEDICATE - Stock NELIMITAT / Valabil comandati pe https://www.zonek.ro/
Post Reply

Return to “Server Development”