vehicleMarkerAppearanceRequest
Asks your gamemode how an empty vehicle shows on everyone’s radar: whether it shows at all, and in which color. It is asked once per vehicle, and again after your gamemode reloads or the default changes. Every vehicle is asked about: the story’s parked vehicles, your own, players’ own, the map’s parked cars, and traffic once its driver has left. Every player sees the same marker; each game shows the nearest 64.
Renamed in 0.28 from vehicleMarkerRequest; see renamed names.
Signature
Section titled “Signature”server.on("vehicleMarkerAppearanceRequest", ({ vehicle, isPersistent, defaultVisible, defaultColorRgba }) => VehicleMarkerAppearanceDecision | Promise<VehicleMarkerAppearanceDecision>)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
vehicle |
Entity |
The vehicle. |
isPersistent |
boolean |
false for an ambient vehicle: one of the map’s parked cars, or traffic its driver left. |
defaultVisible |
boolean |
The server’s default (vehicle_markers in server.ini, see world.areVehicleMarkersEnabled). |
defaultColorRgba |
number |
The default color, 0xA0A0A0FF (grey). |
Returns
Section titled “Returns”falsehides the marker. Any handler’sfalsewins over the others.trueshows it.- A
VehicleMarkerAppearance,{ visible?, colorRgba? }, sets those fields; several handlers apply in the order you registered them. - Nothing keeps the default.
See how decisions work.
Example
Section titled “Example”Only persistent vehicles on the radar, and police cars in blue.
import { server } from "nativemp";
server.on("vehicleMarkerAppearanceRequest", ({ vehicle, isPersistent }) => { if (!isPersistent) return false; if (vehicle.model === 596) return { colorRgba: 0x3366CCFF };});Related
Section titled “Related”vehicles.setMarker: one vehicle’s markerworld.setVehicleMarkersEnabled: the default for every vehicleplayerMarkerVisibilityRequest: players’ markers