UNPKG

rock-mod

Version:

Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.

22 lines (21 loc) 801 B
import { RageWorldObjectsManager } from "../worldObject/RageWorldObjectsManager"; import { RageMarker } from "./RageMarker"; export class RageMarkersManager extends RageWorldObjectsManager { constructor() { super({ baseObjectsType: "marker", }); } create(options) { const { type, scale, color, position, dimension, rotation } = options; const mpEntity = mp.markers.new(type, new mp.Vector3(position), scale, { color: [color.r, color.g, color.b, color.a || 255], dimension, rotation: new mp.Vector3(rotation), }); mpEntity.isExists = () => mp.markers.exists(mpEntity); const marker = new RageMarker({ mpEntity }); this.registerBaseObject(marker); return marker; } }