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.
Requiring a server password
Section titled “Requiring a server password”[server]password=your shared passwordPasswords 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.
Choosing the gamemode
Section titled “Choosing the gamemode”[server]gamemode=script\gamemodes\my-mode.tsThe 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.
Nearby-player marker settings
Section titled “Nearby-player marker settings”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]marker_mode=globalmarker_radius=unlimitedmarker_size=2The 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.
The story’s parked vehicles
Section titled “The story’s parked vehicles”[server]car_generators=offThe 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.
A test server’s world rules
Section titled “A test server’s world rules”[server]rules=testing
[rules]wanted=offrules=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.
Reloading as you save
Section titled “Reloading as you save”[server]watch=trueOr 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.
playerConnecteddoes not run again for players who are already online. Useplayers.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.