rock-mod
Version:
Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.
34 lines (33 loc) • 1.33 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import { RageWorldObjectsManager } from "../worldObject/RageWorldObjectsManager";
import { RageBlip } from "./RageBlip";
export class RageBlipsManager extends RageWorldObjectsManager {
constructor() {
super({
baseObjectsType: "blip",
});
}
create(options) {
var _a;
const { sprite, position, global = false } = options, createOptions = __rest(options, ["sprite", "position", "global"]);
const mpEntity = mp.blips.new(sprite, new mp.Vector3(position), createOptions);
mpEntity.isExists = () => mp.blips.exists(mpEntity);
const blip = new RageBlip({
mpEntity: mpEntity,
global,
name: (_a = options.name) !== null && _a !== void 0 ? _a : "",
});
this.registerBaseObject(blip);
return blip;
}
}