rock-mod
Version:
Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.
38 lines (37 loc) • 880 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RageBaseObject = void 0;
// RAGEMP BUG: event 'entityDestroyed' is not callable
const unsupportedRageEntityTypes = new Set([
"blip",
"colshape",
"marker",
"object",
"ped",
"vehicle",
]);
class RageBaseObject {
_mpEntity;
get id() {
return this._mpEntity.id;
}
get type() {
return this._mpEntity.type;
}
get isExists() {
return this._mpEntity.isExists();
}
get mpEntity() {
return this._mpEntity;
}
constructor(options) {
this._mpEntity = options.mpEntity;
}
destroy() {
this._mpEntity.destroy();
if (unsupportedRageEntityTypes.has(this.type)) {
mp.events.call("entityDestroyed", this._mpEntity);
}
}
}
exports.RageBaseObject = RageBaseObject;