A Soldier of Fortune II server.cfg is a text file of settings that the server runs when it starts. It sets the server name, player limit, passwords, game type, time and score limits, voting and team rules, and it ends by loading the first map. Put it in the base folder (or your mod’s folder) and start the server with +exec server.cfg.
A complete example
Copy this, change the name, passwords and limits, and save it as server.cfg. Lines starting with // are comments.
// ── Identity ─────────────────────────────
seta sv_hostname "^3My ^7SoF2 Server"
seta g_motd "Welcome! Stats: sof2mp.com"
sets Admin "YourName"
sets Discord "discord.gg/yourinvite"
// ── Players and passwords ─────────────────
seta sv_maxclients "16"
seta g_password "" // set to make the server private
seta rconpassword "change-this-to-something-long"
// ── Game ──────────────────────────────────
seta g_gametype "ctf"
seta timelimit "20"
seta scorelimit "10"
seta g_roundtimelimit "5" // round-based modes (INF, ELIM, DEM)
seta g_friendlyFire "0"
seta g_teamForceBalance "1"
seta g_teamAutoJoin "0"
seta g_warmup "20"
// ── Weapons ───────────────────────────────
seta disable_pickup_weapon_RPG_7 "0"
seta disable_pickup_weapon_MM_1 "0"
// ── Voting ────────────────────────────────
seta g_allowVote "1"
seta g_voteDuration "30"
seta g_failedVoteDelay "1"
// ── Housekeeping ──────────────────────────
seta g_inactivity "180"
seta sv_floodProtect "1"
seta sv_maxPing "0"
seta g_log "games.log"
seta sv_punkbuster "0"
// ── Map rotation and first map ────────────
seta sv_mapcycle "mapcycle.txt"
map mp_shop
The settings explained
Identity
sv_hostname is the name shown in server lists. It can use colour codes, as described in coloured names. sets adds extra public information, such as an admin’s name or a Discord link, that players see in the server’s details.
| CVAR | What it does | Default | Recommended |
|---|---|---|---|
sv_hostname | The server name displayed in the server browser. | noname | — |
sv_maxclients | Maximum number of players (including bots) that can connect to the server. | 8 | — |
Passwords
rconpassword lets you run admin commands remotely. Make it long and never share it in chat. g_password makes the whole server private: leave it empty for a public server. Read more in admin commands.
Game type and limits
g_gametype takes a short code: dm, tdm, ctf, elim, inf or dem. Each is explained in game types. A match ends when the time limit or the score limit is reached, whichever comes first.
| CVAR | What it does | Default | Recommended |
|---|---|---|---|
timelimit | Match time limit in minutes. 0 = no time limit. | 0 | — |
scorelimit | Score required to win the match. 0 = no score limit. | 20 | — |
g_roundtimelimit | Time limit per round in minutes. 0 = no round time limit. | 5 | — |
g_warmup | Duration of the warmup period in seconds before a match begins. | 20 | — |
g_suddenDeath | Enables sudden death when the round is tied at time expiry. | 1 | — |
Teams
| CVAR | What it does | Default | Recommended |
|---|---|---|---|
g_friendlyFire | Enables friendly fire so players can damage teammates. | 0 | — |
g_teamForceBalance | Prevents players from joining a team that already has more players. | 0 | — |
g_teamAutoJoin | Automatically places new players into a team when they connect. | 0 | — |
g_teamkillPenalty | Score adjustment applied to a player for each team kill. | -1 | — |
Voting
| CVAR | What it does | Default | Recommended |
|---|---|---|---|
g_allowVote | Allows players to call votes for map changes, kicks, and other actions. | 1 | 1 |
g_voteDuration | Time in seconds that a vote remains open for players to cast their ballot. | 60 | — |
g_failedVoteDelay | Seconds players must wait before calling another vote after one fails. | 1 | — |
g_voteKickBanTime | Minutes a player kicked by vote is banned from reconnecting. 0 = kick only, no ban. | 0 | — |
Housekeeping
Kick idle players, stop chat spam and keep a log. The log file is useful for your own statistics, and SOF2MP.com builds its stats by asking servers for their status, so no log sharing is needed to be listed.
| CVAR | What it does | Default | Recommended |
|---|---|---|---|
g_inactivity | Seconds of inactivity before a player is moved to spectator. | 180 | — |
sv_floodProtect | Enables flood protection to prevent chat and command spamming. | 1 | 1 |
sv_maxPing | Maximum allowed player ping in milliseconds. 0 = no limit. | 0 | — |
g_log | Filename for the game event log. | games.log | — |
sv_punkbuster | Enables PunkBuster anti-cheat enforcement on the server. | 0 | 0 |
Restricting weapons
Each weapon has its own setting: 0 allows it, 1 stops players picking it up, and 2 removes it from the map entirely. Many servers remove the RPG-7 and MM-1 grenade launcher. The full list is in SoF2 weapons.
Mod settings
Mods such as RoCmod add many settings of their own. Put them in the same server.cfg, inside the mod’s folder, and check the mod’s documentation for names and values.
Applying changes
Most settings take effect on the next map. Run /rcon exec server.cfg to reload the file, then /rcon map_restart. A few, such as sv_maxclients, need a full server restart.
Frequently asked questions
Where does server.cfg go?
In the base folder, or in your mod’s folder when running a mod. Load it with +exec server.cfg on the start command.
What’s the difference between set, seta and sets?
set changes a setting, seta also saves it to the config the game writes, and sets adds it to the public server information players can see.
Why aren’t my settings working?
The file may be in the wrong folder, or a mod’s own config may be overriding it. Check the server console when it starts: it shows each config it runs.
