Skip to content

playerMarkerVisibilityRequest

Asks your gamemode whether a viewer may see a target player’s radar marker. It is asked when the target comes within the viewer’s marker range (see player marker settings), not every frame. The answer is kept for that pair: when the target leaves the range and comes back, your last answer applies at once and the server asks again.

Renamed in 0.28 from playerMarkerRequest; see renamed names.

server.on("playerMarkerVisibilityRequest", ({ viewer, target, defaultVisible }) => boolean | Promise<boolean>)
Name Type Description
viewer PlayerSnapshot The player who would see the marker.
target PlayerSnapshot The player the marker shows.
defaultVisible boolean What the server would do without you: true for now.

true shows the marker, false hides it from this viewer. With several handlers, any false hides it. See how decisions work.

Nobody but player 1 sees player 7.

gamemodes/my-mode.ts
import { server } from "nativemp";
server.on("playerMarkerVisibilityRequest", ({ viewer, target }) => viewer.id === 1 || target.id !== 7);

The server asks only when all of these hold:

  • the viewer and the target are two different players, both alive and in the world;
  • both are in the same interior;
  • the target is within the marker radius, unless the radius is null (no limit);
  • in streamed mode, the target is close enough for the viewer’s game to show them (300 m to come in, 350 m to go).

A marker that shows stays until the target is 10% beyond the radius, so it does not flicker at the edge. In off mode nobody is asked. When your gamemode reloads, every pair is asked again.