SixL server API / world-entities / MarkerMpPool
Interface: MarkerMpPool
The pool of markers: mp.markers.
Example
mp.markers.forEach((m) => m.destroy());
Extends
Properties
length
readonlylength:number
The number of entities in the pool.
Example
const count = mp.blips.length;
Inherited from
Methods
at()
at(id):MarkerMp
Finds an entity by id.
Parameters
id
number
The entity's id.
Returns
The entity, or null when there is none.
Example
const blip = mp.blips.at(1);
Inherited from
exists()
exists(entity):boolean
Whether an entity (or an id) is still in the pool.
Parameters
entity
number | MarkerMp
An entity or its id.
Returns
boolean
True when it exists.
Example
if (mp.blips.exists(blip)) { }
Inherited from
forEach()
forEach(callingFunction):void
Calls a function for every entity.
Parameters
callingFunction
(entity) => void
Called with each entity.
Returns
void
Example
mp.blips.forEach((b) => b.destroy());
Inherited from
forEachFast()
forEachFast(callingFunction):void
Calls a function for every entity; the same as forEach in SixL.
Parameters
callingFunction
(entity) => void
Called with each entity.
Returns
void
Example
mp.blips.forEachFast((b) => b.destroy());
Inherited from
new()
new(type,position,scale,options?):MarkerMp
Creates a marker.
Parameters
type
number
The marker kind.
position
Where (metres).
scale
number
The size, in metres.
options?
Optional: color (an [r, g, b, a] array or { r, g, b, a }; default white), direction, rotation, visible (default true) and dimension (default 0).
color?
dimension?
number
direction?
rotation?
visible?
boolean
Returns
The marker.
Remarks
Partial: see MarkerMp.
Example
const m = mp.markers.new(1, new mp.Vector3(0, 0, 70), 2, { color: [0, 255, 0, 100] });
toArray()
toArray(): MarkerMp[]
A snapshot of all entities.
Returns
MarkerMp[]
A new array; changing it does not change the pool.
Example
const all = mp.blips.toArray();