Skip to content

Running a local server

nativemp-server.exe reads server.ini from its own folder. A command-line flag of the same name overrides a line in the file: gamemode=... in the file is --gamemode ... on the command line. Set passwords only in this UTF-8 file; command-line password values are rejected because process arguments can be read by other local users. --no-password opens the server to everyone by clearing the configured password.

server.ini
[server]
password=your shared password

Passwords use UTF-8 and can be up to 64 bytes long. Leading and trailing spaces are significant. Three wrong attempts from one address trigger an exponential cooldown, capped at five minutes. Servers that require a password display a lock icon in the server browser.

server.ini
[server]
gamemode=script\gamemodes\my-mode.ts

The path is relative to the folder the server starts in. Without a gamemode line, the server runs script\gamemodes\freeroam.ts.

The server runs the gamemode with the Node.js in its node folder, or else the first node.exe on your PATH, which must be Node.js 22.18 or newer.

The marker policy can be set at startup under the [server] section. The default mode is streamed, the default radius is 100 metres, and the default native radar scale is 1. Use unlimited rather than 6000 when you do not want a distance gate.

server.ini
[server]
marker_mode=global
marker_radius=unlimited
marker_size=2

The command-line equivalents are –marker-mode global, –marker-radius unlimited and –marker-size 2. A gamemode can change all three values later with world.setMarkerMode and world.setMarkerRadius and world.setMarkerSize.

server.ini
[server]
car_generators=off

The cars, bikes, boats and planes the story parks around the map are on by default, as a finished story has them: 182 spots. A taken one comes back a minute later, once no player is near enough to see it appear. car_generators=off (or --car-generators off) leaves them all out. A gamemode can keep single spots empty, or put another vehicle there, with the carGeneratorSpawnRequest decision. The parked cars of the map’s own files come either way.

server.ini
[server]
rules=testing
[rules]
wanted=off

rules=testing (or --rules testing) turns on every world rule except those that fight a shared session, such as the pause menu, slow motion and story missions. A rule a later version adds is on as well once it is marked safe. A line under [rules] wins over it, wherever it stands: here the police stay out.

server.ini
[server]
watch=true

Or start the server with --watch. Saving a .ts, .js or .json file in the gamemode’s folder then restarts the gamemode in about 0.3 seconds. Players stay connected.

A reload starts the gamemode from scratch:

  • Whatever it kept in memory is gone.
  • playerConnected does not run again for players who are already online. Use players.listOnline() at start to pick them up.
  • During the reload, new joins are refused, chat lines and vehicle entries get the server’s defaults, and events are not delivered.

A save that doesn’t load prints its error, and the server waits for the next save.