world.areVehicleMarkersEnabled
Reads, or with setVehicleMarkersEnabled changes, whether empty vehicles show on everyone’s radar by default, as small
grey squares. It starts from vehicle_markers=on|off in server.ini (default on).
Renamed in 0.28 from world.vehicleMarkers and world.setVehicleMarkers; see renamed names.
Signature
Section titled “Signature”world.areVehicleMarkersEnabled(): booleanworld.setVehicleMarkersEnabled(enabled: boolean): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
enabled |
boolean |
true to show empty vehicles by default, false to hide them. |
Returns
Section titled “Returns”areVehicleMarkersEnabled returns the default. setVehicleMarkersEnabled returns a promise of an
ActionResult: applied, or rejected with invalid-value for a value that is not
a boolean.
Example
Section titled “Example”Hide every empty vehicle except your own.
import { server, world } from "nativemp";
await world.setVehicleMarkersEnabled(false);server.on("vehicleMarkerAppearanceRequest", ({ vehicle }) => vehicle.createdByGamemode === true ? true : undefined);Related
Section titled “Related”vehicles.setMarker: one vehicle’s markervehicleMarkerAppearanceRequest: decide each vehicle’s marker