SixL client API / world-entities / MarkerMpPool
Interface: MarkerMpPool
The pool of markers: mp.markers. It holds the markers the server has sent to this client, and the ones a script made.
Example
mp.markers.forEach((marker) => mp.console.logInfo(String(marker.visible)));
Constructors
Constructor
new MarkerMpPool(type,position,scale,options?):MarkerMp
Makes a marker, drawn by the overlay until it is destroyed.
Parameters
type
number
The shape (the marker types of RAGE MP), an integer.
position
Where it stands, metres.
scale
number
Its size, as a multiple of its normal size.
options?
color ([r, g, b, a], white by default), direction and rotation (vectors, zero by default), visible (true by default), bobUpAndDown (false by default) and dimension.
bobUpAndDown?
boolean
color?
dimension?
number
direction?
rotation?
visible?
boolean
Returns
The new marker.
Remarks
It is not streamed: no stream-in event is raised for it.
Example
const marker = mp.markers.new(1, new mp.Vector3(10, 20, 30), 2, { color: [255, 0, 0, 200] });
Properties
length
readonlylength:number
The number of markers the client holds now.
Example
const count = mp.markers.length;
Methods
at()
at(id):MarkerMp
The marker with this client id, or undefined.
Parameters
id
number
The client's own number for the marker (from 1, reused after a marker is removed). It is not the server's id.
Returns
The marker, or undefined when there is none with that id.
Example
const marker = mp.markers.at(1);
exists()
exists(entity):boolean
Whether a marker is still held by this client.
Parameters
entity
number | MarkerMp
A marker, or the client id of one (the id of MarkerMpPool.at).
Returns
boolean
True while the marker is held; false once the server has removed it from this client, or a script has destroyed it.
Example
if (mp.markers.exists(marker)) { }
forEach()
forEach(callingFunction):void
Calls a function for every marker held by this client.
Parameters
callingFunction
(entity) => void
Called with each marker.
Returns
void
Example
mp.markers.forEach((marker) => mp.console.logInfo(String(marker.scale)));
toArray()
toArray(): MarkerMp[]
The markers held by this client, as an array.
Returns
MarkerMp[]
A new array of the markers at the time of the call.
Example
const all = mp.markers.toArray();