world.getPlayerMarkerSettings
Reads how players show on each other’s radar: the marker mode, the range, and the blip size. The settings start from server.ini and can change while the server runs.
Renamed in 0.28 from world.markerSettings, world.markerMode, world.markerRadius and world.markerSize; see
renamed names.
Signature
Section titled “Signature”world.getPlayerMarkerSettings(): PlayerMarkerSettingsworld.getPlayerMarkerMode(): PlayerMarkerModeworld.getPlayerMarkerRadius(): number | nullworld.getPlayerMarkerRadarScale(): numberThe last three read one field of the first.
Parameters
Section titled “Parameters”None.
Returns
Section titled “Returns”A PlayerMarkerSettings:
| Field | Type | Description |
|---|---|---|
mode |
"off" | "global" | "streamed" |
See modes. |
radius |
number or null |
How far away, in metres, a player’s marker shows; a player exactly on the radius counts. null: no limit. |
radarScale |
number |
The blip size, the game’s own: 1 (default) to 16. |
| Mode | What players see |
|---|---|
off |
No player markers. |
global |
A marker at each player’s position as the server knows it, at any distance within radius. |
streamed |
A marker on each player the viewer’s game shows: in the same interior and within 350 m, and within radius. |
In every mode a marker shows only for a living player in the same interior as the viewer, and your
playerMarkerVisibilityRequest can still hide it.
Example
Section titled “Example”import { server, world } from "nativemp";
server.on("playerConnected", ({ player }) => { const { mode, radius, radarScale } = world.getPlayerMarkerSettings(); server.log(`${player.name}: ${mode}, ${radius === null ? "no limit" : `${radius} m`}, scale ${radarScale}`);});Configuration
Section titled “Configuration”Without settings the mode is streamed and the radius 100. In server.ini:
[server]marker_mode=globalmarker_radius=unlimitedmarker_size=2or on the command line: --marker-mode global --marker-radius unlimited --marker-size 2.
Related
Section titled “Related”world.setPlayerMarkerMode,world.setPlayerMarkerRadiusandworld.setPlayerMarkerRadarScale: change themplayerMarkerVisibilityRequest: hide a player from a viewer