Server.cfg

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:22, 4 November 2017
Romz (Talk | contribs)
(Settings)
← Previous diff
Revision as of 04:28, 5 November 2017
Freaksken (Talk | contribs)
(Rewrite and categorize the different settings (much more readable now imo))
Next diff →
Line 1: Line 1:
[[Image:SA-MP_Wiki_Windows_3.png|thumb|right|A Working Server!]] [[Image:SA-MP_Wiki_Windows_3.png|thumb|right|A Working Server!]]
-{{Description|'''server.cfg''' is a server configuration file which allows you to change settings of your sa-mp server, like e.g. its hostname, filterscripts or plugins to load or even a password you want to set.<br/>This file is necessary for every server and has to be located in the server directory next to the server application.}}+{{Description|''server.cfg'' is a server configuration file which allows you to change all kinds of settings of your sa-mp server.<br/>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==
 +{| class="wikitable" style="width:100%;"
 +|-
 + ! style="white-space: nowrap;" | Setting
 + ! style="white-space: nowrap;" | Type
 + ! style="white-space: nowrap;" | Default value
 + ! style="white-space: nowrap;" | Read-only
 + ! style="white-space: nowrap;" | Rule
 + ! Effect
 +|-
 + | style="white-space: nowrap;" | echo
 + | style="white-space: nowrap;" |
 + | style="white-space: nowrap;" | Executing Server Config...
 + | style="white-space: nowrap; background-color: #b82e2e;" | Yes
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | What ''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.
-==Settings== 
-The following table will explain the use of every single setting in detail: 
-{| class="wikitable" 
|- |-
- ! Setting+ | rcon_password
- ! Default value+ | string
- ! Read only+ | changeme
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | The 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!
 + 
 +|-
 + | rcon
 + | bool
 + | 1
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | Toggles if the [[Remote Console]] feature should be used. Set to '''1''' to enable or '''0''' to disable.
 +|}
 + 
 +==Scripts==
 +{| class="wikitable" style="width:100%;"
 +|-
 + ! style="white-space: nowrap;" | Setting
 + ! style="white-space: nowrap;" | Type
 + ! style="white-space: nowrap;" | Default value
 + ! style="white-space: nowrap;" | Read-only
 + ! style="white-space: nowrap;" | Rule
! Effect ! Effect
 +
 +|-
 + | style="white-space: nowrap;" | gamemode(n) (N) (t)
 + | style="white-space: nowrap;" | string
 + | style="white-space: nowrap;" | gamemode0 grandlarc 1
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | The ''.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.
|- |-
- | echo+ | filterscripts (N)
 + | string
| |
- | style="background-color: #b82e2e;" | Yes+ | style="background-color: #b82e2e;" | Yes
- | This is what the sampserver.exe echos when executing server.cfg, there is no need to change this at all as you'll be the only one who sees the the console. By default this says '''Executing Server Config...'''+ | style="background-color: #2eb82e;" | No
 + | The ''.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''.
 + 
|- |-
- | lanmode+ | plugins (N)
- | 0+ | string
- | style="background-color: #2eb82e;" | No+ |
- | Deprecated variable, has no effect.+ | style="background-color: #b82e2e;" | Yes
 + | style="background-color: #2eb82e;" | No
 + | The ''.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''.
 +* For more information on plugin development, see [http://forum.sa-mp.com/showthread.php?t=295798 this topic].
 +|}
 + 
 +==Server browser==
 +{| class="wikitable" style="width:100%;"
|- |-
- | maxplayers+ ! style="white-space: nowrap;" | Setting
- | 50+ ! style="white-space: nowrap;" | Type
- | style="background-color: #b82e2e;" | Yes+ ! style="white-space: nowrap;" | Default value
- | This is the 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'''.+ ! style="white-space: nowrap;" | Read-only
 + ! style="white-space: nowrap;" | Rule
 + ! Effect
 + 
|- |-
- | announce+ | style="white-space: nowrap;" | announce
- | 0+ | style="white-space: nowrap;" | bool
- | style="background-color: #2eb82e;" | No+ | style="white-space: nowrap;" | 1
- | Toggle server to be announced to SA-MP masterlist. Set to '''1''' to enable announcing or '''0''' to disable.+ | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | Toggles if the server should be announced to SA-MP masterlist. Set to '''1''' to enable or '''0''' to disable.
 + 
|- |-
| query | query
 + | bool
| 1 | 1
- | style="background-color: #2eb82e;" | No+ | style="background-color: #2eb82e;" | No
- | Toggle querying of server. If this is disabled, the server information will not be displayed in the server browser. Set to '''1''' to enable querying or '''0''' to disable. (Players can still join a server that has disabled querying!)+ | style="background-color: #2eb82e;" | No
-|-+ | Toggles 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.
- | port+ 
- | 7777+
- | style="background-color: #b82e2e;" | Yes+
- | The port in which the server will use to communicate can be specified here, you will need to [http://www.portforward.com Port Forward] in order to run the server.+
|- |-
| hostname | hostname
- | SA-MP 0.3 Server+ | string
- | style="background-color: #2eb82e;" | No+ | SA-MP Server
- | This is the name that will display in the server browser for other users to see.+ | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | The name that will be shown in the server browser and when the player connects to the server.
 + 
|- |-
- | gamemode(n)&nbsp;(N)&nbsp;(t)+ | language
- | gamemode0 grandlarc 1+ | string
- | style="background-color: #2eb82e;" | No+ |
- | It's possible to set the gamemode that plays, how many times it plays and when it plays by editing the values here. To use this correctly you must understand how it works, '''(n)''' is the gamemode number, '''(N)''' is the gamemode name*, and '''(t)''' is the times played before switching onto the next mode.+ | style="background-color: #2eb82e;" | No
-*''The gamemode name is the gamemode compiled name in your gamemodes folder, all must match exactly except you must leave the .amx extension off''.+ | style="background-color: #2eb82e;" | No
 + | The language that appears in the server browser. Players can use this to filter servers by language in the server browser. '''English''' is very common.
 +* '''NOTE:''' This server var was added in 0.3.7 and will have no effect in previous versions.
 + 
 +|-
 + | mapname
 + | string
 + | San Andreas
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #b82e2e;" | Yes
 + | The mapname that appears in the server browser. This can be anything, e.g. '''My Stunt Map'''.
 + 
 +|-
 + | gamemodetext
 + | string
 + | Unknown
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | The mode that will be shown in the server browser. Using [[SetGameModeText]] has the same effect.
 + 
 +|-
 + | weather
 + | string'''*'''
 + | 10
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #b82e2e;" | Yes
 + | The global weather that the server uses and will be shown in the server browser. Using [[SetWeather]] has the same effect.
 + 
 +|-
 + | worldtime
 + | string'''*'''
 + | 12:00
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #b82e2e;" | Yes
 + | The global time that the server uses and will be shown in the server browser. Using [[SetWorldTime]] has the same effect.
 + 
 +|-
 + | gravity
 + | string'''*'''
 + | 0.008
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | The global gravity that the server uses. Using [[SetGravity]] has the same effect.
 + 
|- |-
| weburl | weburl
 + | string
| www.sa-mp.com | www.sa-mp.com
- | style="background-color: #2eb82e;" | No+ | style="background-color: #2eb82e;" | No
- | This is the website people can visit to gain more information about the server, a web url is not needed.+ | style="background-color: #b82e2e;" | Yes
 + | The website people can visit to gain more information about the server.
 + 
|- |-
- | rcon_password+ | version
- | + | string
- | style="background-color: #2eb82e;" | No+ |
- | This is the password used to administrate the server and use the rcon, you must make sure you change this to something hard to crack so that others cannot take control of your server. By default this is set to '''changeme'''. Your server will NOT start if "changeme" is the RCON password!+ | style="background-color: #b82e2e;" | Yes
 + | style="background-color: #b82e2e;" | Yes
 + | The SA-MP version that the server uses and will be shown in the server browser.
 + 
|- |-
- | filterscripts&nbsp;(N)+ | maxplayers
- | + | int
- | style="background-color: #b82e2e;" | Yes+ | 50
- | 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's very useful if you want to carry a specific property to more than one gamemode. To use this you must find the folder in your server folder named '''filterscripts''' and place your filterscripts (.amx) in there. (N) symbolizes the filterscript name*. If you have multiple filterscripts you want to load, put them all in a row separated by "space", e.g. ''filterscripts script1 script2''.+ | style="background-color: #b82e2e;" | Yes
-*''The filterscript name is the filterscript compiled name in your filterscripts folder, all must match exactly except you must leave the .amx extension off''.+ | style="background-color: #2eb82e;" | No
-|-+ | The 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'''.
- | plugins&nbsp;(N)+ 
- | +
- | style="background-color: #b82e2e;" | Yes+
- | The plugins directive allows you to specify plugins which are designed to enhance gamemodes and filterscripts. (N) symbolizes the plugin's name. If you have multiple plugins you want to load, put them all in a row separated by "space", e.g. ''plugins plugin1 plugin2''.+
-* Linux users have to put .so behind the plugin name in order for it to work+
-* You may find more information about plugin development in [http://forum.sa-mp.com/showthread.php?t=295798 this topic].+
|- |-
- | password&nbsp;(p)+ | password
 + | string
| |
- | style="background-color: #2eb82e;" | No+ | style="background-color: #2eb82e;" | No
- | Locking your server is another option that is available for the root server administrator. You can use this to lock unwanted visitors from the server. (p) symbolizes the password that will be used. (to remove it change it to "0")+ | style="background-color: #2eb82e;" | No
 + | The 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==
 +{| class="wikitable" style="width:100%;"
|- |-
- | mapname&nbsp;(m)+ ! style="white-space: nowrap;" | Setting
- | San Andreas+ ! style="white-space: nowrap;" | Type
- | style="background-color: #2eb82e;" | No+ ! style="white-space: nowrap;" | Default value
- | The mapname appears in the server browser. (m) symbolizes the mapname.+ ! style="white-space: nowrap;" | Read-only
-*Replace(m) to anything you want, e.g. '''My Stunt Map'''+ ! style="white-space: nowrap;" | Rule
 + ! Effect
 + 
|- |-
- | language+ | style="white-space: nowrap;" | sleep
- | English+ | style="white-space: nowrap;" | int
- | style="background-color: #2eb82e;" | No+ | style="white-space: nowrap;" | 5
- | Specifies the language that is used on the server so players can filter servers by language in the server browser. If not set, it is left blank.+ | style="white-space: nowrap; background-color: #2eb82e;" | No
-* '''NOTE:''' This server var was added in 0.3.7 and will have no effect in previous versions.+ | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | The 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.
 + 
 +|-
 + | lanmode
 + | bool
 + | 0
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | Deprecated variable, has no effect.
 + 
|- |-
| bind | bind
 + | string
| |
- | style="background-color: #b82e2e;" | Yes+ | style="background-color: #b82e2e;" | Yes
- | Force the server to use a specific IP on a server. This IP 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.+ | style="background-color: #2eb82e;" | No
 + | The IP address the server should use. The server will be forced to use this IP address instead of automaticlly 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.
|- |-
- | rcon+ | port
 + | int
 + | 8192 (previously 7777)
 + | style="background-color: #b82e2e;" | Yes
 + | style="background-color: #2eb82e;" | No
 + | The port the server should use. You will need to [http://www.portforward.com Port Forward] in order for players to join your server from outside your LAN.
 + 
 +|-
 + | conncookies
 + | int'''*'''
| 1 | 1
- | style="background-color: #2eb82e;" | No+ | style="background-color: #2eb82e;" | No
- | If 0 is specified the [[Remote Console]] feature is disabled.+ | style="background-color: #2eb82e;" | No
 + | Toggles 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.
 + 
|- |-
- | maxnpc+ | cookielogging
 + | int'''*'''
| 0 | 0
- | style="background-color: #2eb82e;" | No+ | style="background-color: #2eb82e;" | No
- | The maximum number of NPCs that can join your server.+ | style="background-color: #2eb82e;" | No
 + | Toggles 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.
|- |-
- | onfoot_rate'''*'''+ | connseedtime
- | 40+ | int
- | style="background-color: #b82e2e;" | Yes+ | 300000
- | The minimum time in milliseconds a client updates the server with new data while running/walking.+ | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | The 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.
 + 
|- |-
- | incar_rate+ | minconnectiontime
- | 40+ | int
- | style="background-color: #b82e2e;" | Yes+ | 0
- | The minimum time in milliseconds a client updates the server with new data while in a vehicle.+ | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | The 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.
 + 
|- |-
- | weapon_rate+ | messageslimit
- | 40+ | int
- | style="background-color: #b82e2e;" | Yes+ | 500
- | The minimum time in milliseconds a client updates the server with new data while firing a weapon.+ | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | The maximum number of messages a user can send per second.
 + 
|- |-
- | stream_distance'''**'''+ | messageholelimit
- | 300.0+ | int
- | style="background-color: #2eb82e;" | No+ | 3000
- | The distance on the X,Y plane which server entities will stream in for connected players. The maximum is '''400.0''' and the minimum is '''50.0'''.+ | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | See [http://forum.sa-mp.com/showpost.php?p=2868955&postcount=14 here].
 + 
|- |-
- | stream_rate'''***'''+ | ackslimit
- | 1000+ | int
- | style="background-color: #2eb82e;" | No+ | 3000
- | The number of milliseconds that must elapse before server entities stream distance is retested for each player. The maximum is '''5000''' and the minimum is '''500'''.+ | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | See [http://forum.sa-mp.com/showpost.php?p=2989045&postcount=1 here].
 + 
 +|-
 + | playertimeout
 + | int
 + | 10000
 + | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | The time in miliseconds after which a player will timeout when not sending any data to the server.
 +|}
 +['''*'''] Some settings are a different type than you might think.
 + 
 +==Logging==
 +{| class="wikitable" style="width:100%;"
 +|-
 + ! style="white-space: nowrap;" | Setting
 + ! style="white-space: nowrap;" | Type
 + ! style="white-space: nowrap;" | Default value
 + ! style="white-space: nowrap;" | Read-only
 + ! style="white-space: nowrap;" | Rule
 + ! Effect
 + 
 +|-
 + | style="white-space: nowrap;" | output
 + | style="white-space: nowrap;" | bool
 + | style="white-space: nowrap;" | 0
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | Toggles 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.
 + 
|- |-
| timestamp | timestamp
 + | bool
| 1 | 1
- | style="background-color: #2eb82e;" | No+ | style="background-color: #2eb82e;" | No
- | Enable/Disable timestamp. (?)+ | style="background-color: #2eb82e;" | No
-|-+ | Toggles if a timestamp should be printed with every console message. Set to '''1''' to enable or '''0''' to disable.
- | logqueries+ 
- | 0+
- | style="background-color: #2eb82e;" | No+
- | 0 to disable, 1 to enable. This logs all queries sent to the server by players, it's considerably useful during a DDoS attack. +
|- |-
| logtimeformat | logtimeformat
 + | string
| [%H:%M:%S] | [%H:%M:%S]
- | style="background-color: #b82e2e;" | Yes+ | style="background-color: #b82e2e;" | Yes
- | Allows you to configure the timestamp format. The format is based on the [http://cplusplus.com/reference/clibrary/ctime/strftime/ strftime] format from C/C++. Here are some examples:+ | style="background-color: #2eb82e;" | No
-*logtimeformat [%H:%M:%S] - (default) This displays only the time, and is the default format for all previous SA-MP server versions.+ | The timestamp format that should be used. The format is based on the [http://cplusplus.com/reference/clibrary/ctime/strftime/ strftime] format from C/C++. Here are some examples:
-*logtimeformat [%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.+* '''[%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.
 + 
|- |-
- | output+ | logqueries
 + | bool
| 0 | 0
- |+ | style="background-color: #2eb82e;" | No
- | Enable/Disable duplication of log messages (e.g. those printed with print/printf from scripts or logprintf from plugins) in server console. If this option is set to '''0''' (default) messages are only printed to server log. This option has effect only on Linux servers.+ | style="background-color: #2eb82e;" | No
-|-+ | Toggles 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.
- | gamemodetext+ 
- | Unknown+
- | style="background-color: #2eb82e;" | No+
- | Set game mode text. Same as if you call [http://wiki.sa-mp.com/wiki/SetGameModeText SetGameModeText ].+
|- |-
| chatlogging | chatlogging
 + | int'''*'''
| 1 | 1
- | style="background-color: #2eb82e;" | No+ | style="background-color: #2eb82e;" | No
- | Enable/disable player chat to the server log. Useful to disable to stop the log becoming bloated, or if you have another scripted chat logging solution.+ | style="background-color: #2eb82e;" | No
-* 0: Set to '''0''' to disable logging.+ | Toggles 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.
-* 1: Set to '''1''' to explicitely enable logging.+
* '''NOTE:''' This server var was added in 0.3e R2 and will have no effect in previous versions. * '''NOTE:''' This server var was added in 0.3e R2 and will have no effect in previous versions.
|- |-
- | messageholelimit+ | db_logging
- | 3000+ | int'''*'''
- | style="background-color: #2eb82e;" | No+ | 0
- | [http://forum.sa-mp.com/showpost.php?p=2868955&postcount=14 See here.]+ | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | Logs ''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.
 + 
|- |-
- | messageslimit+ | db_log_queries
- | 500+ | int'''*'''
- | style="background-color: #2eb82e;" | No+ | 0
- | The maximum number of messages a user can send per second.+ | style="background-color: #2eb82e;" | No
 + | style="background-color: #2eb82e;" | No
 + | Logs 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==
 +{| class="wikitable" style="width:100%;"
|- |-
- | lagcompmode+ ! style="white-space: nowrap;" | Setting
- | 1+ ! style="white-space: nowrap;" | Type
- | style="background-color: #b82e2e;" | Yes+ ! style="white-space: nowrap;" | Default value
- | + ! style="white-space: nowrap;" | Read-only
-* 0: Setting this to 0 will fully disable lag compensation.+ ! style="white-space: nowrap;" | Rule
-* 1: Setting it to 1 will enable lag compensation.+ ! Effect
-* 2: Setting it to 2 will enable position-only lag compensation. This means player rotation won't be lag comp'd.+ 
|- |-
- | ackslimit+ | style="white-space: nowrap;" | onfoot_rate'''*'''
- | 3000+ | style="white-space: nowrap;" | int
- | style="background-color: #2eb82e;" | No+ | style="white-space: nowrap;" | 30
- | [http://forum.sa-mp.com/showpost.php?p=2989045&postcount=1 See here.]+ | style="white-space: nowrap; background-color: #b82e2e;" | Yes
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | The time in milliseconds a client should update the server with new data while on foot.
 + 
|- |-
- | playertimeout+ | incar_rate
- | 10000+ | int
- | style="background-color: #2eb82e;" | No+ | 30
- | Time in miliseconds after which player will timeout when not sending any data to the server.+ | style="background-color: #b82e2e;" | Yes
-|-+ | style="background-color: #2eb82e;" | No
- | minconnectiontime+ | The time in milliseconds a client should update the server with new data while in a vehicle.
- | 0+
- | style="background-color: #2eb82e;" | No+
- | Time in milliseconds that server will wait before accepting another incoming connection.+
-|-+
- | connseedtime+
- | 300000+
- | style="background-color: #2eb82e;" | No+
- | Use to specify how often the connection cookie seed value updates.+
-* '''NOTE:''' This server var was added in 0.3.7 and will have no effect in previous versions.+
|- |-
- | sleep+ | weapon_rate
- | 5+ | int
- | style="background-color: #2eb82e;" | No+ | 30
- | Time in milliseconds for which the main sa-mp and raknet networking thread will "sleep" idly during each sync cycle. Using a higher value, the server will require fewer CPU, but the quality of sync will suffer greatly. By using a lower value, the server will consume more cpu resources but will improve server sync performance - at cost of cpu power. It is not advisable to change this value ever unless your player count is very high and you have server fps stability issues.+ | style="background-color: #b82e2e;" | Yes
 + | style="background-color: #2eb82e;" | No
 + | The time in milliseconds a client should update the server with new data while firing a weapon.
|- |-
- | conncookies+ | stream_distance'''*'''
- | 1+ | float
- | style="background-color: #2eb82e;" | No+ | 200.0
- | If 0 is specified it will disable the 0.3.7 connection cookie system.+ | style="background-color: #2eb82e;" | No
-* '''NOTE:''' This server var was added in 0.3.7 R2 and will have no effect in previous versions.+ | style="background-color: #2eb82e;" | No
 + | The 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.
|- |-
- | cookielogging+ | stream_rate'''*'''
- | 1+ | int
- | style="background-color: #2eb82e;" | No+ | 1000
- | If 0 is specified it will disable logging of connection cookies requested by newly connecting players.+ | style="background-color: #2eb82e;" | No
-* '''NOTE:''' This server var was added in 0.3.7 R2 and will have no effect in previous versions.+ | style="background-color: #2eb82e;" | No
 + | The 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==
 +{| class="wikitable" style="width:100%;"
|- |-
- | db_logging+ ! style="white-space: nowrap;" | Setting
- | 1+ ! style="white-space: nowrap;" | Type
- | style="background-color: #2eb82e;" | No+ ! style="white-space: nowrap;" | Default value
- | Logs sqlite db_* function errors to the main server_log.+ ! style="white-space: nowrap;" | Read-only
-* '''NOTE:''' This server var was added in 0.3.7 R2 and will have no effect in previous versions.+ ! style="white-space: nowrap;" | Rule
 + ! Effect
|- |-
- | db_log_queries+ | style="white-space: nowrap;" | maxnpc
- | 1+ | style="white-space: nowrap;" | int
- | style="background-color: #2eb82e;" | No+ | style="white-space: nowrap;" | 0
- | Logs all sqlite db_query() calls including the query string.+ | style="white-space: nowrap; background-color: #2eb82e;" | No
-* '''NOTE:''' This server var was added in 0.3.7 R2 and will have no effect in previous versions.+ | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | The 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==
 +{| class="wikitable" style="width:100%;"
|- |-
- | lagcomp+ ! style="white-space: nowrap;" | Setting
- | On+ ! style="white-space: nowrap;" | Type
- | style="background-color: #b82e2e;" | Yes+ ! style="white-space: nowrap;" | Default value
- | Probably set automatically to "On" depending on the "lagcompmode" setting.+ ! style="white-space: nowrap;" | Read-only
 + ! style="white-space: nowrap;" | Rule
 + ! Effect
|- |-
- | myriad+ | style="white-space: nowrap;" | lagcompmode
- | 0+ | style="white-space: nowrap;" | int
- | style="background-color: #2eb82e;" | No+ | style="white-space: nowrap;" | 1
- | Unused. It probably enabled some compatibility with an old GTA San Andreas mod called "Myriad Islands" years ago, probably earlier than year 2008.+ | style="white-space: nowrap; background-color: #b82e2e;" | Yes
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + |
 +* 0: 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.
|- |-
- | nosign+ | lagcomp
- |+ | string
- | style="background-color: #b82e2e;" | Yes+ | On
- |+ | style="background-color: #b82e2e;" | Yes
 + | style="background-color: #b82e2e;" | Yes
 + | Probably set automatically to '''On''' or '''Off''' depending on the '''lagcompmode''' setting.
 +|}
 +==Custom models==
 +{| class="wikitable" style="width:100%;"
|- |-
- | useartwork + ! style="white-space: nowrap;" | Setting
- | 0+ ! style="white-space: nowrap;" | Type
- | style="background-color: #b82e2e;" | Yes+ ! style="white-space: nowrap;" | Default value
- | Switches the loading of textures. Set to '''1''' to enable or '''0''' to disable.+ ! style="white-space: nowrap;" | Read-only
-|+ ! style="white-space: nowrap;" | Rule
 + ! Effect
|- |-
- | mtu+ | style="white-space: nowrap;" | useartwork
- | 576+ | style="white-space: nowrap;" | bool
- | style="background-color: #b82e2e;" | Yes+ | style="white-space: nowrap;" | 0
- |+ | style="white-space: nowrap; background-color: #b82e2e;" | Yes
-|+ | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | Toggles 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.
|- |-
- | artwork+ | artwork
 + | string
| No | No
- | style="background-color: #b82e2e;" | Yes+ | style="background-color: #b82e2e;" | Yes
- | Probably set automatically to "No" depending on the "useartwork" setting.+ | style="background-color: #b82e2e;" | Yes
-|+ | Probably 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.
|- |-
- | artpath+ | artpath
 + | string
| models | models
- | style="background-color: #b82e2e;" | Yes+ | style="background-color: #b82e2e;" | Yes
- | Specifies the path to the folder where the textures lie.+ | style="background-color: #2eb82e;" | No
-|+ | The 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.
|} |}
-['''*'''] Lower values of onfoot_rate incar_rate weapon_rate increase sync performance although increase bandwidth.+==Others==
 +{| class="wikitable" style="width:100%;"
 +|-
 + ! style="white-space: nowrap;" | Setting
 + ! style="white-space: nowrap;" | Type
 + ! style="white-space: nowrap;" | Default value
 + ! style="white-space: nowrap;" | Read-only
 + ! style="white-space: nowrap;" | Rule
 + ! Effect
-['''**'''] stream_distance With larger values, players can see server entities at a greater distance although will require more client processing and potentially more bandwidth.+|-
 + | style="white-space: nowrap;" | myriad
 + | style="white-space: nowrap;" | bool
 + | style="white-space: nowrap;" | 0
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | style="white-space: nowrap; background-color: #2eb82e;" | No
 + | Unused. It probably enabled some compatibility with an old GTA San Andreas mod called "Myriad Islands" years ago, probably earlier than year 2008.
-['''***'''] stream_rate Lower values increase server CPU as it has to recheck streaming conditions more frequently for each player.+|-
 + | nosign
 + | string
 + |
 + | style="background-color: #b82e2e;" | Yes
 + | style="background-color: #2eb82e;" | No
 + |
 +|-
 + | mtu
 + | int
 + | 576
 + | style="background-color: #b82e2e;" | Yes
 + | style="background-color: #2eb82e;" | No
 + |
 +* '''NOTE:''' This server var was added in 0.3.8 and will have no effect in previous versions.
 +|}
-===Notes===+==Notes==
-* Values marked as "Read only" can not be changed during runtime, all other values can be (temporarily) changed by passing them to SendRconCommand.+* 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.
-* The stream_distance and stream_rate can be changed while the server is running e.g. /rcon stream_distance 300.0 or /rcon stream_rate 1000. +* Values marked as "Rule" (as shown by ''/rcon varlist'') are displayed in the server browser in the Rules section.
-* (Game-)Modes (and Filterscripts) do not have to be in "gamemodes/" or "filterscripts/". The information in server.cfg is a path, and can use "..": <sup>([http://forum.sa-mp.com/showthread.php?t=191239 Quote] by [http://forum.sa-mp.com/member.php?u=29176 Y_Less])</sup>+* Scripts do not have to be in the ''gamemodes'' or ''filterscripts'' folders. The information in server.cfg is a path, and can therefore use "..". Quote by [http://forum.sa-mp.com/member.php?u=29176 Y_Less].
<pawn>filterscripts ../scriptfiles/first ../minimodes/second</pawn> <pawn>filterscripts ../scriptfiles/first ../minimodes/second</pawn>

Revision as of 04:28, 5 November 2017

A Working Server!
Enlarge
A Working Server!

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).


Contents

Console

Setting Type Default value Read-only Rule Effect
echo Executing Server Config... Yes No What 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_password string changeme No No The 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!
rcon bool 1 No No Toggles if the Remote Console feature should be used. Set to 1 to enable or 0 to disable.

Scripts

Setting Type Default value Read-only Rule Effect
gamemode(n) (N) (t) string gamemode0 grandlarc 1 No No The .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) string Yes No The .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) string Yes No The .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.
  • For more information on plugin development, see this topic.

Server browser

Setting Type Default value Read-only Rule Effect
announce bool 1 No No Toggles if the server should be announced to SA-MP masterlist. Set to 1 to enable or 0 to disable.
query bool 1 No No Toggles 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.
hostname string SA-MP Server No No The name that will be shown in the server browser and when the player connects to the server.
language string No No The language that appears in the server browser. Players can use this to filter servers by language in the server browser. English is very common.
  • NOTE: This server var was added in 0.3.7 and will have no effect in previous versions.
mapname string San Andreas No Yes The mapname that appears in the server browser. This can be anything, e.g. My Stunt Map.
gamemodetext string Unknown No No The mode that will be shown in the server browser. Using SetGameModeText has the same effect.
weather string* 10 No Yes The global weather that the server uses and will be shown in the server browser. Using SetWeather has the same effect.
worldtime string* 12:00 No Yes The global time that the server uses and will be shown in the server browser. Using SetWorldTime has the same effect.
gravity string* 0.008 No No The global gravity that the server uses. Using SetGravity has the same effect.
weburl string www.sa-mp.com No Yes The website people can visit to gain more information about the server.
version string Yes Yes The SA-MP version that the server uses and will be shown in the server browser.
maxplayers int 50 Yes No The 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.
password string No No The 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

Setting Type Default value Read-only Rule Effect
sleep int 5 No No The 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.
lanmode bool 0 No No Deprecated variable, has no effect.
bind string Yes No The IP address the server should use. The server will be forced to use this IP address instead of automaticlly 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.
port int 8192 (previously 7777) Yes No The port the server should use. You will need to Port Forward in order for players to join your server from outside your LAN.
conncookies int* 1 No No Toggles 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.
cookielogging int* 0 No No Toggles 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.
connseedtime int 300000 No No The 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.
minconnectiontime int 0 No No The 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.
messageslimit int 500 No No The maximum number of messages a user can send per second.
messageholelimit int 3000 No No See here.
ackslimit int 3000 No No See here.
playertimeout int 10000 No No The time in miliseconds after which a player will timeout when not sending any data to the server.

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

Logging

Setting Type Default value Read-only Rule Effect
output bool 0 No No Toggles 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.
timestamp bool 1 No No Toggles if a timestamp should be printed with every console message. Set to 1 to enable or 0 to disable.
logtimeformat string [%H:%M:%S] Yes No The 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.
logqueries bool 0 No No Toggles 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.
chatlogging int* 1 No No Toggles 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_logging int* 0 No No Logs 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_queries int* 0 No No Logs 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

Setting Type Default value Read-only Rule Effect
onfoot_rate* int 30 Yes No The time in milliseconds a client should update the server with new data while on foot.
incar_rate int 30 Yes No The time in milliseconds a client should update the server with new data while in a vehicle.
weapon_rate int 30 Yes No The time in milliseconds a client should update the server with new data while firing a weapon.
stream_distance* float 200.0 No No The 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* int 1000 No No The 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

Setting Type Default value Read-only Rule Effect
maxnpc int 0 No No The 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

Setting Type Default value Read-only Rule Effect
lagcompmode int 1 Yes No
  • 0: 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.
lagcomp string On Yes Yes Probably set automatically to On or Off depending on the lagcompmode setting.

Custom models

Setting Type Default value Read-only Rule Effect
useartwork bool 0 Yes No Toggles 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.
artwork string No Yes Yes Probably 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.
artpath string models Yes No The 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

Setting Type Default value Read-only Rule Effect
myriad bool 0 No No Unused. It probably enabled some compatibility with an old GTA San Andreas mod called "Myriad Islands" years ago, probably earlier than year 2008.
nosign string Yes No
mtu int 576 Yes No
  • NOTE: This server var was added in 0.3.8 and will have no effect in previous versions.

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 "..". Quote by Y_Less.
filterscripts ../scriptfiles/first ../minimodes/second
Personal tools
In other languages