Skip to content

Configuration

dev2alert edited this page Mar 8, 2022 · 3 revisions

Home ▸ Configuration

The server configuration can be defined:

  • By default: via the samp-conf.[json|json5|yml|yaml] file in the package root.
  • Explicitly using the -c flag in nodesamp.

The configuration file supports three formats: JSON, JSON5 и YAML.

Parameters:

Name Type Default value Description
lanMode boolean false Local network connection.
maxPlayers number 50 The maximum number of players on the server.
announce boolean false Allows servers to be displayed in the SA-MP master list (the "Internet" tab).
query boolean true Allows you to send requests to the server. If this is disabled, the server information will not be displayed in the server browser.
port number 7777 The port that the server will use for communication can be changed here.
hostName string SA-MP 0.3 Server This is the name that will be displayed in the server browser for other users to view.
webUrl string www.sa-mp.com This is a website that people can visit to get more information about the server.
rconPassword string This is the password used to administer the server and use rcon.
plugins ({platform: string, path: string} | string)[] [] List of plugins used.
pluginsPath string ./plugins The path to the plugins folder.
password string Locking the server with a password is another option that is available to the rcon server administrator. You can use this feature to prevent unwanted visitors from entering the server.
mapName string San Andreas The name of the map that will be displayed in the server browser.
language string English Defines the language used on the server. This way players can filter servers by language in the server browser.
bind string Forces the server to start only from a specific IP. This IP must match the IP assigned by the server's network card. This is useful for running multiple servers on the same port on the same computer.
rcon boolean true If set to false, the remote control function via the console will be disabled.
maxNpc number 0 The maximum number of NPCs (bots) that can join your server.
onfootRate number 40 The minimum time in milliseconds after which the client will update the server with new data while running/walking.
incarRate number 40 The minimum time in milliseconds after which the client will update the server with new data while in transport.
weaponRate number 40 The minimum time in milliseconds after which the client will update the server with new data during the firing of weapons.
streamDistance number 300 The distance along the X, Y axes of the planes on which server objects will be displayed for connected players.
streamRate number 1000 The number of milliseconds that must elapse before the server updates the streaming data for each player again.
timeStamp boolean true Enabling/Disabling time marking.
logQueries boolean false This logs all requests sent by players to the server, which is significantly useful during DDoS attacks.
logTimeFormat string [%H:%M:%S] Allows you to configure the timestamp format.
output boolean false Enabling/Disabling duplication of log messages (for example, printed with print/printf from game modes or logprintf from plugins) in the server console.
gameModeText string Unknown Set the text of the game mode.
chatLogging boolean true Enabling/disabling game chat logging. It is useful to disable it to prevent an increase in the size of server logs or if you have your own logging solution.
messageHoleLimit number 3000 More detailed...
messagesLimit number 500 The maximum number of messages a user can send in one second.
lagcompMode number 1
  • 0 - completely disables lagcomp.
  • 1 - enables lagcomp.
  • 2 - enables lagcomp for position only. This means that lagcomp mode will not work for player rotation.
acksLimit number 3000 More detailed...
playerTimeout number 10000 The time in milliseconds after which the player will be disconnected from the server with the reason "timeout", if during this time he does not send any data to the server.
minConnectionTime number 0 The time in milliseconds that the server will wait before accepting another incoming connection.
connseedTime number 300000 Use to set how often the cookie connection value will be updated.
sleep number 5 The time in milliseconds during which the main sa-mp and raknet network stream will "sleep" (do nothing during each synchronization cycle).
connCookies boolean true If set to false, this will disable the cookie connection system added in 0.3.7.
cookieLogging boolean true If set to false, this will disable the logging of cookies requested by newly connected players.
nodeOptions string Node.js options.
More detailed...

Example:

{
    hostName: "Node.js server",
    webUrl: "github.com/dev2alert/node-samp",
    gameModeText: "NodeSamp Starter",
    port: 7777,
    maxPlayers: 1000,
    rconPassword: "qwerty123",
    pluginsPath: "./plugins",
    plugins: [
        {
            platform: "win32",
            path: "./streamer.dll"
        },
        {
            platform: "linux",
            path: "./streamer.so"
        }
    ]
}

Clone this wiki locally