Preskoči na vsebino

config.json

Description

  • config.json is a server configuration file which allows you to change all kinds of settings of your open.mp server.
  • You can still use server.cfg file in your open.mp server, but it is recommended to use config.json because there are more settings!



namig

You can simply convert your server.cfg to config.json.

Open a command prompt in your server directory and type the following command, then press Enter:

# Windows
omp-server --dump-config

# Linux
./omp-server --dump-config

Note: If you have a config.json file in the directory, you may need to delete it before executing the above command.


namig

To generate a default config.json enter the following command:

# Windows
omp-server --default-config

# Linux
./omp-server --default-config

Announce

KeyTypeDefault valueRead-onlyRuleEffect
announcebooltrueToggles if the server should be announced to open.mp masterlist. Set to 'true' to enable or 'false' to disable.

Custom Models (Artwork)

KeyTypeDefault valueRead-onlyRuleEffect
artwork.cdnstringAn http address for a remote model server.
artwork.enablebooltrueToggles if the server uses custom models from the /models folder. Set to 'true' to enable or 'false' to disable.
artwork.models_pathstringmodelsThe path where the custom models are located.
artwork.portint7777
artwork.web_server_bindstring

Chat Filter

KeyTypeDefault valueRead-onlyRuleEffect
chat_input_filterbooltrueToggles the chat input filter. Disable it to use of chars like % in the chat. You can also use the ToggleChatTextReplacement function.

Query Server Information

KeyTypeDefault valueRead-onlyRuleEffect
enable_querybooltrueToggles if the server information should be displayed in the server browser. Set to 'true' to enable or 'false' to disable. Players can still join a server that has disabled querying, but the server browser will not display any information.

Game

KeyTypeDefault valueRead-onlyRuleEffect
game.allow_interior_weaponsbooltrueToggles whether the usage of weapons in interiors is allowed or not. 'true' to enable weapons in interiors, 'false' to disable.
game.chat_radiusfloat200.0Set a radius limitation for the chat. Only players at a certain distance from the player will see their message in the chat. Also changes the distance at which a player can see other players on the map at the same distance.
game.death_drop_amountint0
game.gravityfloat0.008The global gravity that the server uses.
game.group_player_objectsboolfalsePer-player and global objects share an ID pool in SA:MP. If an ID was "assigned" to players each player could have a unique object with that ID, but if you created the maximum global objects you couldn't then create any per-player objects.
If player objects grouping is enables the server will try to find an already used player object slot by another player.
game.lag_compensation_modeint10: 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.
game.mapstringThe mapname that appears in the server browser. This can be anything, e.g. My Stunt Map.
game.modestringThe mode that will be shown in the server browser. Using SetGameModeText has the same effect and overrides the value used in config.json. If you have multiple gamemodes that require different gamemode texts, use that function.
game.nametag_draw_radiusfloat70.0Set the maximum distance to display the names of players.
game.player_marker_draw_radiusfloat250.0Set the marker radius for all players.
game.player_marker_modeint10: Marker mode off

1: Marker mode global

2: Marker mode streamed

Marker Modes
game.timeint12The global time that the server uses and will be shown in the server browser.
game.use_all_animationsboolfalseAllow use of the animations missing from some versions. 'true' to enable all animations, 'false' to disable.
game.use_chat_radiusboolfalseEnable/Disable chat radius.
game.use_entry_exit_markersbooltrueEnable/Disable all the interior entrances and exits in the game (the yellow arrows at doors).
game.use_instagibboolfalseinstagib is an old configurable variable that is not available in sa-mp client anymore, the name is probably taken from Quake game, instagib is basically instakill or instant kill, enables one shot one kill feature in game (it's not available at the moment because sa-mp removed this on client side)
game.use_manual_engine_and_lightsboolfalseControl vehicle engines and lights. false: prevents the game automatically turning the engine on/off when players enter/exit vehicles and headlights automatically coming on when it is dark.
game.use_nametag_losbooltrueToggles the Line-Of-Sight of nametags, health bars and armor bars above players.
game.use_nametagsbooltrueToggles the drawing of nametags, health bars and armor bars above players.
game.use_player_marker_draw_radiusboolfalseToggles player markers (blips on the radar).
game.use_player_ped_animsboolfalseUses standard player walking animation (animation of the CJ skin) instead of custom animations for every skin (e.g. skating for skater skins).
game.use_stunt_bonusesbooltrueEnables or disables stunt bonuses for all players. If enabled, players will receive monetary rewards when performing a stunt in a vehicle (e.g. a wheelie).
game.use_vehicle_friendly_fireboolfalseEnable friendly fire for team vehicles. Players will be unable to damage teammates' vehicles.
game.use_zone_namesboolfalseAllows to turn on zone / area names such as the "Vinewood" or "Doherty" text at the bottom-right of the screen as they enter the area.
game.validate_animationsbooltrueValidate animations for the players.
game.vehicle_respawn_timeint10000Set vehicles respawn time in milliseconds. (Default 10 seconds)
game.weatherint10The global weather that the server uses and will be shown in the server browser.

Language

KeyTypeDefault valueRead-onlyRuleEffect
languagestringThe language that appears in the server browser. Players can use this to filter servers by language in the server browser.

Logging

KeyTypeDefault valueRead-onlyRuleEffect
logging.enablebooltrueEnable/Disable logging.
logging.filestringlog.txtThe path and file name to save the server log.
logging.log_chatbooltrueToggles 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 'true' to enable or 'false' to disable.
logging.log_connection_messagesbooltrueEnable/Disable player and NPC join messages.
logging.log_cookiesboolfalseToggles logging of connection cookies requested by newly connecting players. Set to 'true' to enable or 'false' to disable.
logging.log_deathsbooltrueToggles if player death should be shown in the server console. Set to 'true' to enable or 'false' to disable.
logging.log_queriesboolfalseToggles if all queries sent to the server by players should be logged. Set to 'true' to enable or 'false' to disable. It is considerably useful during a DDoS attack.
logging.log_sqliteboolfalseLogs sqlite DB_* function errors in the server console.
logging.log_sqlite_queriesboolfalseLogs all sqlite DB_Query calls, including the query string.
logging.timestamp_formatstring[%Y-%m-%dT%H:%M:%S%z]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.

[%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.
logging.use_prefixbooltrueToggles if prefixes such as [Info] should be printed with every console message. Set to 'true' to enable or 'false' to disable.
logging.use_timestampbooltrueToggles if a timestamp should be printed with every console message. Set to 'true' to enable or 'false' to disable.

NPCs and Players

KeyTypeDefault valueRead-onlyRuleEffect
max_botsint0The 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.
max_playersint50The 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.

Hostname

KeyTypeDefault valueRead-onlyRuleEffect
namestringopen.mp serverThe name that will be shown in the server browser and when the player connects to the server.

Network

KeyTypeDefault valueRead-onlyRuleEffect
network.acks_limitint3000
network.aiming_sync_rate*int30The time in milliseconds a client should update the server with new data while firing a weapon.
network.allow_037_clientsbooltrueToggles if players with 0.3.7 client allowed to join the server.
network.bindstringThe 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.
network.cookie_reseed_timeint300000The time in milliseconds the connection cookie seed value updates.
network.grace_periodint5000This is a grace period to allow unlimited connections from the same IP after starting the server, mainly used for NPCs.
By default: 5 Seconds
network.http_threadsint50
network.in_vehicle_sync_rate*int30The time in milliseconds a client should update the server with new data while in a vehicle.
network.limits_ban_timeint60000Sets the raknet ban time for bad connect packets in milliseconds. (When acks/message limit is reached.)
network.message_hole_limitint3000A network level setting to deal with DoS attacks.
network.messages_limitint500The maximum number of messages a user can send per second.
network.minimum_connection_timeint0The 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.
network.mtuint576Keep it the default value, you don't really need or should change this if you have no idea what this is, because if you don't know, then you don't have anything on your server requiring higher MTU, but if you are still interested: https://en.wikipedia.org/wiki/Maximum_transmission_unit
network.multiplierint10
network.on_foot_sync_rate*int30The time in milliseconds a client should update the server with new data while on foot.
network.player_marker_sync_rateint2500The time in milliseconds a client should update the server with new data while moving.
network.player_timeoutint10000The time in milliseconds after which a player will timeout when not sending any data to the server.
network.portint7777The port the server should use. You will need to Port Forward in order for players to join your server from outside your LAN.
network.public_addrstringSome machines you run your server on can have different IPs, this is used so if the address you set in bind config is different, you set a new one. this config variable is only used for DL servers, because in open.mp, it will host a webserver for downloading models
network.stream_radiusfloat200.0The 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.
network.stream_rateint1000The 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.
network.time_sync_rateint30000The rate at which a player's game time is updated in milliseconds.
network.use_lan_modeboolfalseDeprecated variable, has no effect.

[*] Lower values of aiming_sync_rate, in_vehicle_sync_rate and on_foot_sync_rate increases sync performance, but uses more bandwidth.

Server Lock

KeyTypeDefault valueRead-onlyRuleEffect
passwordstringThe password used to lock the server. When using this, only players that know this password will be able to join the server.

Pawn

KeyTypeDefault valueRead-onlyRuleEffect
pawn.legacy_pluginslist, string[]The .dll or .so file in the /plugins folder, the server should use to run as a plugin. Plugins are scripts which are designed to enhance gamemodes and filterscripts.
Example: ["mysql", "streamer"]
pawn.main_scriptslist, string["test 1"]The .amx file in the /gamemodes folder, the server should use to run as a gamemode.
pawn.side_scriptslist, string[]The .amx file in the /filterscripts folder, the server should use to run as a filterscript. 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.
Example: ["filterscripts/Race_System"]

RCON

KeyTypeDefault valueRead-onlyRuleEffect
rcon.allow_teleportboolfalseDetermine whether RCON admins will be teleported to their waypoint when they set one. Set to 'true' to enable or 'false' to disable.
rcon.enableboolfalseToggles if the Remote Console feature should be used. Set to 'true' to enable or 'false' to disable.
rcon.passwordstringchangemeThe 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!

Sleep and Ticks

KeyTypeDefault valueRead-onlyRuleEffect
sleepfloat5.0The time in milliseconds the main open.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.
use_dyn_ticksbooltruedynticks config is basically for keeping your server's tickrate at a constant count by using cpu more to cover the gap if there's any drop.
It is calculated using provided sleep value so if sleep is 5, constant tick count would be 1000 / 5 = 200 ticks per second.
open.mp modifies internal sleep value on the fly based on each tick's code execution time, just to keep it steady at 200 ticks, and lower sleep means more cpu usage (which is not a massive difference if server code is written well)

Web URL

KeyTypeDefault valueRead-onlyRuleEffect
websitestringopen.mpThe website people can visit to gain more information about the server.

Discord

KeyTypeDefault valueRead-onlyRuleEffect
discord.invitestringhttps://discord.gg/sampThe address of your server discord that appears in the omp launcher.

Banners

KeyTypeDefault valueRead-onlyRuleEffect
banners.lightstringYour server's light banner url address that appears in the omp launcher.
banners.darkstringYour server's dark banner url address that appears in the omp launcher.

KeyTypeDefault valueRead-onlyRuleEffect
logostringYour server's logo url address that appears in the omp launcher and discord status.


opomba
  • Values marked as "Read-only" can not be changed during runtime. All other values can be (temporarily) changed by passing them to SendRconCommand or via server console.

  • Values marked as "Rule" are displayed in the server browser in the Rules section.