server.cfg

Description

  • server.cfg is a server configuration file which allows you to change all kinds of settings of your sa-mp server.
  • This file is necessary for every server and has to be located in the server directory next to the server application (samp-server.exe).

Console

SettingTypeDefault valueRead-onlyRuleEffect
echostringExecuting Server Config...YesNoWhat samp-server.exe prints in the server console when executing server.cfg. There is no need to change this at all as you'll be the only one who sees the console.
rcon_passwordstringchangemeNoNoThe password used to administrate the server and use the remote console (rcon). You must make sure to change this to something hard to crack so that others cannot take control of your server. Your server will NOT start if changeme is the RCON password!
rconbool1NoNoToggles if the Remote Console feature should be used. Set to 1 to enable or 0 to disable.

Scripts

SettingTypeDefault valueRead-onlyRuleEffect
gamemode(n) (N) (t)stringgamemode0 grandlarc 1NoNoThe .amx file in the gamemodes folder, the server should use to run as a gamemode. (n) is the gamemode number, (N) is the gamemode name without the .amx extension, and (t) is the amount of times the gamemode should be played before switching to the next gamemode.
filterscripts (N)stringYesNoThe .amx file in the filterscripts folder, the server should use to run as a filterscript. (N) is the filterscript name without the .amx extension. Filterscripts are scripts that run in the background of your gamemode. They are there to add extras to the server without editing the gamemode. It is very useful if you want to carry a specific property to more than one gamemode. If you have multiple filterscripts you want to load, put them all in a row separated by "space", e.g. filterscripts script1 script2.
plugins (N)stringYesNoThe .dll or .so file in the plugins folder, the server should use to run as a plugin. On Windows (N) is the plugin name without the .dll extension. However, on Linux the .so extension is needed! Plugins are scripts which are designed to enhance gamemodes and filterscripts. If you have multiple plugins you want to load, put them all in a row separated by "space", e.g. plugins plugin1 plugin2.

Server browser

SettingTypeDefault valueRead-onlyRuleEffect
announcebool1NoNoToggles if the server should be announced to SA-MP masterlist. Set to 1 to enable or 0 to disable.
querybool1NoNoToggles if the server information should be displayed in the server browser. Set to 1 to enable or 0 to disable. Players can still join a server that has disabled querying, but the server browser will not display any information.
hostnamestringSA-MP ServerNoNoThe name that will be shown in the server browser and when the player connects to the server.
languagestringNoNoThe language that appears in the server browser. Players can use this to filter servers by language in the server browser.

NOTE: This server var was added in 0.3.7 and will have no effect in previous versions.
mapnamestringSan AndreasNoYesThe mapname that appears in the server browser. This can be anything, e.g. My Stunt Map.
gamemodetextstringUnknownNoNoThe mode that will be shown in the server browser. Using SetGameModeText has the same effect and overrides the value used in server.cfg. If you have multiple gamemodes that require different gamemode texts, use that function.
weatherstring*10NoYesThe global weather that the server uses and will be shown in the server browser. Using this setting in the server.cfg file will crash the server application on startup. Use SetWeather instead to change this setting.
worldtimestring*12:00NoYesThe global time that the server uses and will be shown in the server browser. Using this setting in the server.cfg file has no effect. Use SetWorldTime instead to change this setting.
gravitystring*0.008NoNoThe global gravity that the server uses. Using this setting in the server.cfg file will crash the server application on startup. Use SetGravity instead to change this setting.
weburlstringiorp.inNoYesThe website people can visit to gain more information about the server.
versionstringYesYesThe SA-MP version that the server uses and will be shown in the server browser. Using this setting in the server.cfg file has no effect.
maxplayersint50YesNoThe maximum amount of players your server can hold. By changing this number you can alter how many players can enter the server. The maximum is 1000 and the minimum is 1.
passwordstringNoNoThe password used to lock the server. When using this, only players that know this password will be able to join the server.

[*] Some settings are a different type than you might think.

Networking

SettingTypeDefault valueRead-onlyRuleEffect
sleepint5NoNoThe time in milliseconds the main sa-mp and raknet networking thread will "sleep" idly during each sync cycle. Higher values decreases server processing, but reduces sync quality. Lower values increases server processing, but improves sync quality. It is not advisable to change this value unless your player count is very high and you have server fps stability issues.
lanmodebool0NoNoDeprecated variable, has no effect.
bindstringYesNoThe IP address the server should use. The server will be forced to use this IP address instead of automatically choosing a free IP address. This IP address must match one assigned to a network card on the server. This is useful for running multiple servers on the same port on the same box.
portint8192 (7777 is also commonly used)YesNoThe port the server should use. You will need to Port Forward in order for players to join your server from outside your LAN.
conncookiesint*1NoNoToggles the 0.3.7 connection cookie system. Set to 1 to enable or 0 to disable.

NOTE: This server var was added in 0.3.7 R2 and will have no effect in previous versions.
cookieloggingint*0NoNoToggles logging of connection cookies requested by newly connecting players. Set to 1 to enable or 0 to disable.

NOTE: This server var was added in 0.3.7 R2 and will have no effect in previous versions.
connseedtimeint300000NoNoThe time in milliseconds the connection cookie seed value updates.

NOTE: This server var was added in 0.3.7 and will have no effect in previous versions.
minconnectiontimeint0NoNoThe time in milliseconds the server will wait before accepting another incoming connection. It is not recommended that you use this variable unless your server is under a connection flood attack.

NOTE: This server var was added in 0.3z and will have no effect in previous versions.
messageslimitint500NoNoThe maximum number of messages a user can send per second.
messageholelimitint3000NoNoSee here.
ackslimitint3000NoNoSee here.
playertimeoutint10000NoNoThe time in miliseconds after which a player will timeout when not sending any data to the server.
mtuint576YesNoSee here.

NOTE: This server var was added in 0.3.8 and will have no effect in previous versions.

[*] Some settings are a different type than you might think.

Logging

SettingTypeDefault valueRead-onlyRuleEffect
outputbool0NoNoToggles if log messages (e.g. print/printf from scripts or logprintf from plugins) should be duplicated in the server console. Set to 1 to enable or 0 to disable. This option has effect only on Linux servers.
timestampbool1NoNoToggles if a timestamp should be printed with every console message. Set to 1 to enable or 0 to disable.
logtimeformatstring[%H:%M:%S]YesNoThe timestamp format that should be used. The format is based on the strftime format from C/C++. Here are some examples:

[%H:%M:%S] This displays only the time, and is the default format for all previous SA-MP server versions.

[%d/%m/%Y %H:%M:%S] This would display the date in dd/mm/yyyy format followed by the time in hour:minute:second format.
logqueriesbool0NoNoToggles if all queries sent to the server by players should be logged. Set to 1 to enable or 0 to disable. It is considerably useful during a DDoS attack.
chatloggingint*1NoNoToggles if player chat should be shown in the server console. Useful to stop the log from becoming bloated, or if you have another scripted chat logging solution. Set to 1 to enable or 0 to disable.

NOTE: This server var was added in 0.3e R2 and will have no effect in previous versions.
db_loggingint*0NoNoLogs sqlite db_* function errors in the server console.

NOTE: This server var was added in 0.3.7 R2 and will have no effect in previous versions.
db_log_queriesint*0NoNoLogs all sqlite db_query calls, including the query string.

NOTE: This server var was added in 0.3.7 R2 and will have no effect in previous versions.

[*] Some settings are a different type than you might think.

Client

SettingTypeDefault valueRead-onlyRuleEffect
onfoot_rate*int30YesNoThe time in milliseconds a client should update the server with new data while on foot.
incar_rateint30YesNoThe time in milliseconds a client should update the server with new data while in a vehicle.
weapon_rateint30YesNoThe time in milliseconds a client should update the server with new data while firing a weapon.
stream_distance*float200.0NoNoThe distance on the X,Y plane players will stream in server entities. The maximum is 400.0 and the minimum is 50.0. Higher values makes players see server entities at a greater distance, but requires more client processing and potentially more bandwidth.
stream_rate*int1000NoNoThe time in milliseconds before the streaming in of server entities is retested for each player. The maximum is 5000 and the minimum is 500. Lower values increases server processing as it has to recheck streaming conditions more frequently for each player.

[*] Lower values of onfoot_rate, incar_rate and weapon_rate increases sync performance, but uses more bandwidth.

NPCs

SettingTypeDefault valueRead-onlyRuleEffect
maxnpcint0NoNoThe maximum amount of NPCs your server can hold. By changing this number you can alter how many of the player slots can be used by NPCs.

Lag compensation

SettingTypeDefault valueRead-onlyRuleEffect
lagcompmodeint1YesNo0: Fully disable lag compensation.

1: Fully enable lag compensation.

2: Enable position-only lag compensation. This means player rotation won't be lag compensated for.

NOTE: This server var was added in 0.3z and will have no effect in previous versions.
lagcompstringOnYesYesProbably set automatically to On or Off depending on the lagcompmode setting.

Custom models

SettingTypeDefault valueRead-onlyRuleEffect
useartworkbool0YesNoToggles if the server uses custom models from the models folder. Set to 1 to enable or 0 to disable.

NOTE: This server var was added in 0.3.8 and will have no effect in previous versions.
artworkstringNoYesYesProbably set automatically to No or Yes depending on the useartwork setting.

NOTE: This server var was added in 0.3.8 and will have no effect in previous versions.
artpathstringmodelsYesNoThe path where the custom models are located.

NOTE: This server var was added in 0.3.8 and will have no effect in previous versions.

Others

SettingTypeDefault valueRead-onlyRuleEffect
myriadbool0NoNoUnused. It probably enabled some compatibility with an old GTA San Andreas mod called "Myriad Islands" years ago, probably earlier than year 2008.
nosignstringYesNoUnused.

Notes

  • Values marked as "Read-only" (as shown by /rcon varlist) can not be changed during runtime. All other values can be (temporarily) changed by passing them to SendRconCommand.
  • Values marked as "Rule" (as shown by /rcon varlist) are displayed in the server browser in the Rules section.
  • Scripts do not have to be in the gamemodes or filterscripts folders. The information in server.cfg is a path, and can therefore use "..".