UNPKG

rock-mod

Version:

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

26 lines (25 loc) 1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RageMarkersManager = void 0; const RageWorldObjectsManager_1 = require("../worldObject/RageWorldObjectsManager"); const RageMarker_1 = require("./RageMarker"); class RageMarkersManager extends RageWorldObjectsManager_1.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_1.RageMarker({ mpEntity }); this.registerBaseObject(marker); return marker; } } exports.RageMarkersManager = RageMarkersManager;