Server.cfg

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:19, 11 July 2015
IstuntmanI (Talk | contribs)
(Adds the new 0.3.7 R2 variables)
← Previous diff
Revision as of 08:58, 12 July 2015
Dugi (Talk | contribs)

Next diff →
Line 223: Line 223:
| If 0 is specified it will disable logging of connection cookies requested by newly connecting players. | If 0 is specified it will disable logging of connection cookies requested by newly connecting players.
* '''NOTE:''' This server var was added in 0.3.7 R2 and will have no effect in previous versions. * '''NOTE:''' This server var was added in 0.3.7 R2 and will have no effect in previous versions.
 +
 +|-
 + | db_logging
 + | 1
 + | style="background-color: #2eb82e;" | No
 + | If 0 is specified it will disable logging of connection cookies requested by newly connecting players.
 +
 +
 +|-
 + | db_log_queries
 + | 1
 + | style="background-color: #2eb82e;" | No
 + | If 0 is specified it will disable logging of connection cookies requested by newly connecting players.
 +
|} |}

Revision as of 08:58, 12 July 2015

A Working Server!
Enlarge
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.
This file is necessary for every server and has to be located in the server directory next to the server application.



Settings

The following table will explain the use of every single setting in detail:

Setting Default value Read only Effect
echo 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...
lanmode 0 No Deprecated variable, has no effect.
maxplayers 50 Yes 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.
announce 0 No Toggle server to be announced to SA-MP masterlist. Set to 1 to enable announcing or 0 to disable.
query 1 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!)
port 7777 Yes The port in which the server will use to communicate can be specified here, you will need to Port Forward in order to run the server.
hostname SA-MP 0.3 Server No This is the name that will display in the server browser for other users to see.
gamemode(n) (N) (t) gamemode0 grandlarc 1 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.
  • The gamemode name is the gamemode compiled name in your gamemodes folder, all must match exactly except you must leave the .amx extension off.
weburl www.sa-mp.com No This is the website people can visit to gain more information about the server, a web url is not needed.
rcon_password 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!
filterscripts (N) Yes 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.
  • The filterscript name is the filterscript compiled name in your filterscripts folder, all must match exactly except you must leave the .amx extension off.
plugins (N) 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 this topic.
password (p) - (None) 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.
mapname (m) San Andreas No The mapname appears in the server browser. (m) symbolizes the mapname.
  • Replace(m) to anything you want, e.g. My Stunt Map
language English No 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.
  • NOTE: This server var was added in 0.3.7 and will have no effect in previous versions.
bind 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.
rcon 1 No If 0 is specified the Remote Console feature is disabled.
maxnpc 0 No The maximum number of NPCs that can join your server.
onfoot_rate* 40 Yes The minimum time in milliseconds a client updates the server with new data while running/walking.
incar_rate 40 Yes The minimum time in milliseconds a client updates the server with new data while in a vehicle.
weapon_rate 40 Yes The minimum time in milliseconds a client updates the server with new data while firing a weapon.
stream_distance** 300.0 No The distance on the X,Y plane which server entities will stream in for connected players.
stream_rate*** 1000 No The number of milliseconds that must elapse before server entities stream distance is retested for each player.
timestamp 1 No Enable/Disable timestamp.
logqueries 0 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 [%H:%M:%S] Yes Allows you to configure the timestamp format. The format is based on the strftime format from C/C++. Here are some examples:
  • logtimeformat [%H:%M:%S] - (default) This displays only the time, and is the default format for all previous SA-MP server versions.
  • 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.
output 0 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.
gamemodetext Unknown No Set game mode text. Same as if you call SetGameModeText .
chatlogging 1 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.
  • 0: Set to 0 to disable logging.
  • 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.
messageholelimit 3000 No See here.
lagcompmode 1 Yes
  • 0: Setting this to 0 will fully disable lag compensation.
  • 1: Setting it to 1 will enable lag compensation.
  • 2: Setting it to 2 will enable position-only lag compensation. This means player rotation won't be lag comp'd.
ackslimit 3000 No See here.
playertimeout 10000 No Time in miliseconds after which player will timeout when not sending any data to the server.
minconnectiontime 0 No Time in milliseconds that server will wait before accepting another incoming connection.
connseedtime 300000 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 5 No 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.
conncookies 1 No If 0 is specified it will disable the 0.3.7 connection cookie system.
  • NOTE: This server var was added in 0.3.7 R2 and will have no effect in previous versions.
cookielogging 1 No If 0 is specified it will disable logging of connection cookies requested by newly connecting players.
  • NOTE: This server var was added in 0.3.7 R2 and will have no effect in previous versions.
db_logging 1 No If 0 is specified it will disable logging of connection cookies requested by newly connecting players.


db_log_queries 1 No If 0 is specified it will disable logging of connection cookies requested by newly connecting players.


[*] Lower values of onfoot_rate incar_rate weapon_rate increase sync performance although increase bandwidth.

[**] stream_distance With larger values, players can see server entities at a greater distance although will require more client processing and potentially more bandwidth.

[***] stream_rate Lower values increase server CPU as it has to recheck streaming conditions more frequently for each player.


Notes

  • Values marked as "Read only" 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.
  • (Game-)Modes (and Filterscripts) do not have to be in "gamemodes/" or "filterscripts/". The information in server.cfg is a path, and can use "..": (Quote by Y_Less)
filterscripts ../scriptfiles/first ../minimodes/second
In other languages