rock-mod 0.3.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -25
- package/dist/server/RockMod.d.ts +8 -1
- package/dist/server/RockMod.js +16 -1
- package/dist/server/entities/altv/blip/AltVBlip.d.ts +8 -4
- package/dist/server/entities/altv/blip/AltVBlip.js +23 -10
- package/dist/server/entities/altv/blip/AltVBlipsManager.js +8 -3
- package/dist/server/entities/altv/colshape/AltVCircleColshape.d.ts +7 -0
- package/dist/server/entities/altv/colshape/AltVCircleColshape.js +10 -0
- package/dist/server/entities/altv/colshape/AltVColshape.d.ts +7 -0
- package/dist/server/entities/altv/colshape/AltVColshape.js +10 -0
- package/dist/server/entities/altv/colshape/AltVColshapesManager.d.ts +26 -0
- package/dist/server/entities/altv/colshape/AltVColshapesManager.js +67 -0
- package/dist/server/entities/altv/colshape/AltVCuboidColshape.d.ts +7 -0
- package/dist/server/entities/altv/colshape/AltVCuboidColshape.js +10 -0
- package/dist/server/entities/altv/colshape/AltVCylinderColshape.d.ts +7 -0
- package/dist/server/entities/altv/colshape/AltVCylinderColshape.js +10 -0
- package/dist/server/entities/altv/colshape/AltVRectangleColshape.d.ts +7 -0
- package/dist/server/entities/altv/colshape/AltVRectangleColshape.js +10 -0
- package/dist/server/entities/altv/colshape/AltVSphereColshape.d.ts +7 -0
- package/dist/server/entities/altv/colshape/AltVSphereColshape.js +10 -0
- package/dist/server/entities/altv/marker/AltVMarker.d.ts +12 -0
- package/dist/server/entities/altv/marker/AltVMarker.js +23 -0
- package/dist/server/entities/altv/marker/AltVMarkersManager.d.ts +9 -0
- package/dist/server/entities/altv/marker/AltVMarkersManager.js +25 -0
- package/dist/server/entities/common/baseObject/IBaseObject.d.ts +2 -0
- package/dist/server/entities/common/baseObject/IBaseObject.js +2 -0
- package/dist/server/entities/common/blip/IBlip.d.ts +9 -4
- package/dist/server/entities/common/blip/IBlipsManager.d.ts +7 -1
- package/dist/server/entities/common/colshape/ICircleColshape.d.ts +5 -0
- package/dist/server/entities/common/colshape/ICircleColshape.js +2 -0
- package/dist/server/entities/common/colshape/IColshape.d.ts +5 -0
- package/dist/server/entities/common/colshape/IColshape.js +2 -0
- package/dist/server/entities/common/colshape/IColshapesManager.d.ts +35 -0
- package/dist/server/entities/common/colshape/IColshapesManager.js +2 -0
- package/dist/server/entities/common/colshape/ICuboidColshape.d.ts +5 -0
- package/dist/server/entities/common/colshape/ICuboidColshape.js +2 -0
- package/dist/server/entities/common/colshape/ICylinderColshape.d.ts +5 -0
- package/dist/server/entities/common/colshape/ICylinderColshape.js +2 -0
- package/dist/server/entities/common/colshape/IRectangleColshape.d.ts +5 -0
- package/dist/server/entities/common/colshape/IRectangleColshape.js +2 -0
- package/dist/server/entities/common/colshape/ISphereColshape.d.ts +5 -0
- package/dist/server/entities/common/colshape/ISphereColshape.js +2 -0
- package/dist/server/entities/common/colshape/index.d.ts +7 -0
- package/dist/server/entities/common/colshape/index.js +23 -0
- package/dist/server/entities/common/index.d.ts +2 -0
- package/dist/server/entities/common/index.js +2 -0
- package/dist/server/entities/common/marker/IMarker.d.ts +9 -0
- package/dist/server/entities/common/marker/IMarker.js +2 -0
- package/dist/server/entities/common/marker/IMarkersManager.d.ts +59 -0
- package/dist/server/entities/common/marker/IMarkersManager.js +51 -0
- package/dist/server/entities/common/marker/index.d.ts +2 -0
- package/dist/server/entities/common/marker/index.js +18 -0
- package/dist/server/entities/ragemp/blip/RageBlip.d.ts +8 -4
- package/dist/server/entities/ragemp/blip/RageBlip.js +22 -10
- package/dist/server/entities/ragemp/blip/RageBlipsManager.js +2 -5
- package/dist/server/entities/ragemp/colshape/RageCircleColshape.d.ts +7 -0
- package/dist/server/entities/ragemp/colshape/RageCircleColshape.js +10 -0
- package/dist/server/entities/ragemp/colshape/RageColshape.d.ts +6 -0
- package/dist/server/entities/ragemp/colshape/RageColshape.js +10 -0
- package/dist/server/entities/ragemp/colshape/RageColshapesManager.d.ts +26 -0
- package/dist/server/entities/ragemp/colshape/RageColshapesManager.js +62 -0
- package/dist/server/entities/ragemp/colshape/RageCuboidColshape.d.ts +7 -0
- package/dist/server/entities/ragemp/colshape/RageCuboidColshape.js +10 -0
- package/dist/server/entities/ragemp/colshape/RageCylinderColshape.d.ts +7 -0
- package/dist/server/entities/ragemp/colshape/RageCylinderColshape.js +10 -0
- package/dist/server/entities/ragemp/colshape/RageRectangleColshape.d.ts +7 -0
- package/dist/server/entities/ragemp/colshape/RageRectangleColshape.js +10 -0
- package/dist/server/entities/ragemp/colshape/RageSphereColshape.d.ts +7 -0
- package/dist/server/entities/ragemp/colshape/RageSphereColshape.js +10 -0
- package/dist/server/entities/ragemp/marker/RageMarker.d.ts +11 -0
- package/dist/server/entities/ragemp/marker/RageMarker.js +22 -0
- package/dist/server/entities/ragemp/marker/RageMarkersManager.d.ts +9 -0
- package/dist/server/entities/ragemp/marker/RageMarkersManager.js +25 -0
- package/dist/server/entities/ragemp/player/RagePlayersManager.d.ts +2 -1
- package/dist/server/entities/ragemp/player/RagePlayersManager.js +3 -4
- package/dist/server/factories/altv/AltVManagersFactory.d.ts +6 -0
- package/dist/server/factories/altv/AltVManagersFactory.js +12 -0
- package/dist/server/factories/common/IManagersFactory.d.ts +6 -2
- package/dist/server/factories/ragemp/RageManagersFactory.d.ts +7 -1
- package/dist/server/factories/ragemp/RageManagersFactory.js +14 -2
- package/dist/server/utils/altv/AltVUtilsManager.d.ts +4 -0
- package/dist/server/utils/altv/AltVUtilsManager.js +9 -0
- package/dist/server/utils/common/IUtilsManager.d.ts +3 -0
- package/dist/server/utils/common/IUtilsManager.js +2 -0
- package/dist/server/utils/common/index.d.ts +1 -0
- package/dist/server/utils/common/index.js +17 -0
- package/dist/server/utils/index.d.ts +1 -0
- package/dist/server/utils/index.js +17 -0
- package/dist/server/utils/ragemp/RageUtilsManager.d.ts +4 -0
- package/dist/server/utils/ragemp/RageUtilsManager.js +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# Rock-Mod
|
|
2
|
-
|
|
3
|
-
**Rock-Mod** is a versatile and powerful framework designed for cross-platform mod development for Grand Theft Auto (GTA) servers. It supports both **RageMP** and **AltV** multiplayer platforms, allowing you to build and manage mods seamlessly across these environments.
|
|
4
|
-
|
|
5
|
-
### Installation
|
|
6
|
-
|
|
7
|
-
To get started, simply install the package:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install rock-mod
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Usage
|
|
14
|
-
|
|
15
|
-
On the server-side, initialize Rock-Mod with the appropriate multiplayer type:
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
const rockMod = await RockMod.create({
|
|
19
|
-
multiplayer: "RageMP", // or "AltV"
|
|
20
|
-
});
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Please note that client-side implementation is not yet available in this version.
|
|
24
|
-
|
|
25
|
-
Rock-Mod simplifies multiplayer mod development by providing unified tools for managing game entities, networking, and more across different platforms.
|
|
1
|
+
# Rock-Mod
|
|
2
|
+
|
|
3
|
+
**Rock-Mod** is a versatile and powerful framework designed for cross-platform mod development for Grand Theft Auto (GTA) servers. It supports both **RageMP** and **AltV** multiplayer platforms, allowing you to build and manage mods seamlessly across these environments.
|
|
4
|
+
|
|
5
|
+
### Installation
|
|
6
|
+
|
|
7
|
+
To get started, simply install the package:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install rock-mod
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
On the server-side, initialize Rock-Mod with the appropriate multiplayer type:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const rockMod = await RockMod.create({
|
|
19
|
+
multiplayer: "RageMP", // or "AltV"
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Please note that client-side implementation is not yet available in this version.
|
|
24
|
+
|
|
25
|
+
Rock-Mod simplifies multiplayer mod development by providing unified tools for managing game entities, networking, and more across different platforms.
|
package/dist/server/RockMod.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { INetManager } from "./net/common/INetManager";
|
|
2
|
-
import { IBlipsManager, IObjectsManager, IPedsManager, IPlayersManager, IVehiclesManager } from "./entities";
|
|
2
|
+
import { IBlipsManager, IColshapesManager, IMarkersManager, IObjectsManager, IPedsManager, IPlayersManager, IVehiclesManager } from "./entities";
|
|
3
|
+
import { IUtilsManager } from "./utils";
|
|
3
4
|
type MultiplayerType = "RageMP" | "AltV";
|
|
4
5
|
export interface RockModOptions {
|
|
5
6
|
multiplayer: MultiplayerType;
|
|
@@ -11,15 +12,21 @@ export declare class RockMod {
|
|
|
11
12
|
private static _initManagersFactory;
|
|
12
13
|
private readonly _net;
|
|
13
14
|
private readonly _blips;
|
|
15
|
+
private readonly _colshapes;
|
|
16
|
+
private readonly _markers;
|
|
14
17
|
private readonly _objects;
|
|
15
18
|
private readonly _peds;
|
|
16
19
|
private readonly _players;
|
|
20
|
+
private readonly _utils;
|
|
17
21
|
private readonly _vehicles;
|
|
18
22
|
get net(): INetManager;
|
|
19
23
|
get blips(): IBlipsManager;
|
|
24
|
+
get colshapes(): IColshapesManager;
|
|
25
|
+
get markers(): IMarkersManager;
|
|
20
26
|
get objects(): IObjectsManager;
|
|
21
27
|
get peds(): IPedsManager;
|
|
22
28
|
get players(): IPlayersManager;
|
|
29
|
+
get utils(): IUtilsManager;
|
|
23
30
|
get vehicles(): IVehiclesManager;
|
|
24
31
|
private constructor();
|
|
25
32
|
}
|
package/dist/server/RockMod.js
CHANGED
|
@@ -55,9 +55,12 @@ class RockMod {
|
|
|
55
55
|
}
|
|
56
56
|
_net;
|
|
57
57
|
_blips;
|
|
58
|
+
_colshapes;
|
|
59
|
+
_markers;
|
|
58
60
|
_objects;
|
|
59
61
|
_peds;
|
|
60
62
|
_players;
|
|
63
|
+
_utils;
|
|
61
64
|
_vehicles;
|
|
62
65
|
get net() {
|
|
63
66
|
return this._net;
|
|
@@ -65,6 +68,12 @@ class RockMod {
|
|
|
65
68
|
get blips() {
|
|
66
69
|
return this._blips;
|
|
67
70
|
}
|
|
71
|
+
get colshapes() {
|
|
72
|
+
return this._colshapes;
|
|
73
|
+
}
|
|
74
|
+
get markers() {
|
|
75
|
+
return this._markers;
|
|
76
|
+
}
|
|
68
77
|
get objects() {
|
|
69
78
|
return this._objects;
|
|
70
79
|
}
|
|
@@ -74,15 +83,21 @@ class RockMod {
|
|
|
74
83
|
get players() {
|
|
75
84
|
return this._players;
|
|
76
85
|
}
|
|
86
|
+
get utils() {
|
|
87
|
+
return this._utils;
|
|
88
|
+
}
|
|
77
89
|
get vehicles() {
|
|
78
90
|
return this._vehicles;
|
|
79
91
|
}
|
|
80
92
|
constructor(managersFactory) {
|
|
81
93
|
this._net = managersFactory.createNetManager();
|
|
82
94
|
this._blips = managersFactory.createBlipsManager();
|
|
95
|
+
this._colshapes = managersFactory.createColshapesManager();
|
|
96
|
+
this._markers = managersFactory.createMarkersManager();
|
|
83
97
|
this._objects = managersFactory.createObjectsManager();
|
|
84
98
|
this._peds = managersFactory.createPedsManager();
|
|
85
|
-
this._players = managersFactory.createPlayersManager();
|
|
99
|
+
this._players = managersFactory.createPlayersManager(this._net);
|
|
100
|
+
this._utils = managersFactory.createUtilsManager();
|
|
86
101
|
this._vehicles = managersFactory.createVehiclesManager();
|
|
87
102
|
}
|
|
88
103
|
}
|
|
@@ -3,13 +3,17 @@ import { IBlip, IBlipColor, IBlipSprite } from "../../common";
|
|
|
3
3
|
export interface IAltVBlipOptions extends IAltVWorldObjectOptions<AltVServer.Blip> {
|
|
4
4
|
}
|
|
5
5
|
export declare class AltVBlip extends AltVWorldObject<AltVServer.Blip> implements IBlip {
|
|
6
|
-
get sprite(): IBlipSprite;
|
|
7
|
-
get alpha(): number;
|
|
8
6
|
get name(): string;
|
|
7
|
+
get sprite(): IBlipSprite;
|
|
9
8
|
get color(): IBlipColor;
|
|
9
|
+
get alpha(): number;
|
|
10
|
+
get scale(): number;
|
|
11
|
+
get drawDistance(): number;
|
|
12
|
+
get shortRange(): boolean;
|
|
13
|
+
get rotation(): number;
|
|
10
14
|
constructor(options: IAltVBlipOptions);
|
|
11
|
-
setSprite(value: IBlipSprite): void;
|
|
12
|
-
setAlpha(value: number): void;
|
|
13
15
|
setName(value: string): void;
|
|
16
|
+
setSprite(value: IBlipSprite): void;
|
|
14
17
|
setColor(value: IBlipColor): void;
|
|
18
|
+
setAlpha(value: number): void;
|
|
15
19
|
}
|
|
@@ -3,32 +3,45 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AltVBlip = void 0;
|
|
4
4
|
const AltVWorldObject_1 = require("../worldObject/AltVWorldObject");
|
|
5
5
|
class AltVBlip extends AltVWorldObject_1.AltVWorldObject {
|
|
6
|
+
get name() {
|
|
7
|
+
return this.mpEntity.name;
|
|
8
|
+
}
|
|
6
9
|
get sprite() {
|
|
7
10
|
return this.mpEntity.sprite;
|
|
8
11
|
}
|
|
12
|
+
get color() {
|
|
13
|
+
return this.mpEntity.color;
|
|
14
|
+
}
|
|
9
15
|
get alpha() {
|
|
10
16
|
return this.mpEntity.alpha;
|
|
11
17
|
}
|
|
12
|
-
get
|
|
13
|
-
return this.mpEntity.
|
|
18
|
+
get scale() {
|
|
19
|
+
return this.mpEntity.scale;
|
|
14
20
|
}
|
|
15
|
-
get
|
|
16
|
-
|
|
21
|
+
get drawDistance() {
|
|
22
|
+
console.log("[RockMod] AltVBlip drawDistance is not implemented");
|
|
23
|
+
return 0;
|
|
17
24
|
}
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
get shortRange() {
|
|
26
|
+
return this.mpEntity.shortRange;
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
this.mpEntity.
|
|
28
|
+
get rotation() {
|
|
29
|
+
return this.mpEntity.heading;
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
constructor(options) {
|
|
32
|
+
super(options);
|
|
26
33
|
}
|
|
27
34
|
setName(value) {
|
|
28
35
|
this.mpEntity.name = value;
|
|
29
36
|
}
|
|
37
|
+
setSprite(value) {
|
|
38
|
+
this.mpEntity.sprite = value;
|
|
39
|
+
}
|
|
30
40
|
setColor(value) {
|
|
31
41
|
this.mpEntity.color = value;
|
|
32
42
|
}
|
|
43
|
+
setAlpha(value) {
|
|
44
|
+
this.mpEntity.alpha = value;
|
|
45
|
+
}
|
|
33
46
|
}
|
|
34
47
|
exports.AltVBlip = AltVBlip;
|
|
@@ -12,11 +12,16 @@ class AltVBlipsManager extends AltVWorldObjectsManager_1.AltVWorldObjectsManager
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
create(options) {
|
|
15
|
-
const {
|
|
15
|
+
const { alpha, color, dimension, name, position, rotation, scale, shortRange, sprite } = options;
|
|
16
16
|
const mpEntity = new PointBlip(new Vector3(position), true);
|
|
17
|
-
mpEntity.
|
|
17
|
+
mpEntity.alpha = alpha ?? 255;
|
|
18
|
+
mpEntity.color = color ?? 1;
|
|
18
19
|
mpEntity.dimension = dimension;
|
|
19
|
-
mpEntity.
|
|
20
|
+
mpEntity.name = name ?? "";
|
|
21
|
+
mpEntity.heading = rotation ?? 0;
|
|
22
|
+
mpEntity.scale = scale ?? 1;
|
|
23
|
+
mpEntity.shortRange = shortRange ?? false;
|
|
24
|
+
mpEntity.sprite = sprite;
|
|
20
25
|
const blip = new AltVBlip_1.AltVBlip({ mpEntity });
|
|
21
26
|
this.registerBaseObject(blip);
|
|
22
27
|
return blip;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICircleColshape } from "../../common";
|
|
2
|
+
import { AltVColshape, IAltVColshapeOptions } from "./AltVColshape";
|
|
3
|
+
export interface IAltVCircleColshapeOptions extends IAltVColshapeOptions {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVCircleColshape extends AltVColshape implements ICircleColshape {
|
|
6
|
+
constructor(options: IAltVCircleColshapeOptions);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVCircleColshape = void 0;
|
|
4
|
+
const AltVColshape_1 = require("./AltVColshape");
|
|
5
|
+
class AltVCircleColshape extends AltVColshape_1.AltVColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AltVCircleColshape = AltVCircleColshape;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AltVWorldObject, IAltVWorldObjectOptions } from "../worldObject/AltVWorldObject";
|
|
2
|
+
import Colshape = AltVServer.Colshape;
|
|
3
|
+
export interface IAltVColshapeOptions extends IAltVWorldObjectOptions<Colshape> {
|
|
4
|
+
}
|
|
5
|
+
export declare abstract class AltVColshape extends AltVWorldObject<Colshape> {
|
|
6
|
+
protected constructor(options: IAltVColshapeOptions);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVColshape = void 0;
|
|
4
|
+
const AltVWorldObject_1 = require("../worldObject/AltVWorldObject");
|
|
5
|
+
class AltVColshape extends AltVWorldObject_1.AltVWorldObject {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AltVColshape = AltVColshape;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ICircleColshapeCreateOptions, IColshapesManager, ICuboidColshapeCreateOptions, ICylinderColshapeCreateOptions, IRectangleColshapeCreateOptions, ISphereColshapeCreateOptions } from "../../common";
|
|
2
|
+
import { AltVWorldObjectsManager } from "../worldObject/AltVWorldObjectsManager";
|
|
3
|
+
import { AltVColshape } from "./AltVColshape";
|
|
4
|
+
import { AltVCircleColshape } from "./AltVCircleColshape";
|
|
5
|
+
import { AltVCuboidColshape } from "./AltVCuboidColshape";
|
|
6
|
+
import { AltVCylinderColshape } from "./AltVCylinderColshape";
|
|
7
|
+
import { AltVRectangleColshape } from "./AltVRectangleColshape";
|
|
8
|
+
import { AltVSphereColshape } from "./AltVSphereColshape";
|
|
9
|
+
export interface IAltVCircleColshapeCreateOptions extends ICircleColshapeCreateOptions {
|
|
10
|
+
}
|
|
11
|
+
export interface IAltVCuboidColshapeCreateOptions extends ICuboidColshapeCreateOptions {
|
|
12
|
+
}
|
|
13
|
+
export interface IAltVCylinderColshapeCreateOptions extends ICylinderColshapeCreateOptions {
|
|
14
|
+
}
|
|
15
|
+
export interface IAltVRectangleColshapeCreateOptions extends IRectangleColshapeCreateOptions {
|
|
16
|
+
}
|
|
17
|
+
export interface IAltVSphereColshapeCreateOptions extends ISphereColshapeCreateOptions {
|
|
18
|
+
}
|
|
19
|
+
export declare class AltVColshapesManager extends AltVWorldObjectsManager<AltVColshape> implements IColshapesManager {
|
|
20
|
+
constructor();
|
|
21
|
+
createCircle(options: IAltVCircleColshapeCreateOptions): AltVCircleColshape;
|
|
22
|
+
createCuboid(options: IAltVCuboidColshapeCreateOptions): AltVCuboidColshape;
|
|
23
|
+
createCylinder(options: IAltVCylinderColshapeCreateOptions): AltVCylinderColshape;
|
|
24
|
+
createRectangle(options: IAltVRectangleColshapeCreateOptions): AltVRectangleColshape;
|
|
25
|
+
createSphere(options: IAltVSphereColshapeCreateOptions): AltVSphereColshape;
|
|
26
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVColshapesManager = void 0;
|
|
4
|
+
const AltVWorldObjectsManager_1 = require("../worldObject/AltVWorldObjectsManager");
|
|
5
|
+
const AltVCircleColshape_1 = require("./AltVCircleColshape");
|
|
6
|
+
const AltVCuboidColshape_1 = require("./AltVCuboidColshape");
|
|
7
|
+
const AltVCylinderColshape_1 = require("./AltVCylinderColshape");
|
|
8
|
+
const AltVRectangleColshape_1 = require("./AltVRectangleColshape");
|
|
9
|
+
const AltVSphereColshape_1 = require("./AltVSphereColshape");
|
|
10
|
+
var ColshapeCircle = AltVServer.ColshapeCircle;
|
|
11
|
+
var ColshapeCuboid = AltVServer.ColshapeCuboid;
|
|
12
|
+
var ColshapeCylinder = AltVServer.ColshapeCylinder;
|
|
13
|
+
var ColshapeRectangle = AltVServer.ColshapeRectangle;
|
|
14
|
+
var ColshapeSphere = AltVServer.ColshapeSphere;
|
|
15
|
+
class AltVColshapesManager extends AltVWorldObjectsManager_1.AltVWorldObjectsManager {
|
|
16
|
+
constructor() {
|
|
17
|
+
super({
|
|
18
|
+
baseObjectsType: "colshape",
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
createCircle(options) {
|
|
22
|
+
const { range, position, dimension } = options;
|
|
23
|
+
const { x, y } = position;
|
|
24
|
+
const mpEntity = new ColshapeCircle(x, y, range);
|
|
25
|
+
mpEntity.dimension = dimension;
|
|
26
|
+
const colshape = new AltVCircleColshape_1.AltVCircleColshape({ mpEntity });
|
|
27
|
+
this.registerBaseObject(colshape);
|
|
28
|
+
return colshape;
|
|
29
|
+
}
|
|
30
|
+
createCuboid(options) {
|
|
31
|
+
const { width, depth, height, position, dimension } = options;
|
|
32
|
+
const { x, y, z } = position;
|
|
33
|
+
const mpEntity = new ColshapeCuboid(x, y, z, x + width, y + depth, z + height);
|
|
34
|
+
mpEntity.dimension = dimension;
|
|
35
|
+
const colshape = new AltVCuboidColshape_1.AltVCuboidColshape({ mpEntity });
|
|
36
|
+
this.registerBaseObject(colshape);
|
|
37
|
+
return colshape;
|
|
38
|
+
}
|
|
39
|
+
createCylinder(options) {
|
|
40
|
+
const { height, range, position, dimension } = options;
|
|
41
|
+
const { x, y, z } = position;
|
|
42
|
+
const mpEntity = new ColshapeCylinder(x, y, z, range, height);
|
|
43
|
+
mpEntity.dimension = dimension;
|
|
44
|
+
const colshape = new AltVCylinderColshape_1.AltVCylinderColshape({ mpEntity });
|
|
45
|
+
this.registerBaseObject(colshape);
|
|
46
|
+
return colshape;
|
|
47
|
+
}
|
|
48
|
+
createRectangle(options) {
|
|
49
|
+
const { width, height, position, dimension } = options;
|
|
50
|
+
const { x, y } = position;
|
|
51
|
+
const mpEntity = new ColshapeRectangle(x, y, x + width, y + height);
|
|
52
|
+
mpEntity.dimension = dimension;
|
|
53
|
+
const colshape = new AltVRectangleColshape_1.AltVRectangleColshape({ mpEntity });
|
|
54
|
+
this.registerBaseObject(colshape);
|
|
55
|
+
return colshape;
|
|
56
|
+
}
|
|
57
|
+
createSphere(options) {
|
|
58
|
+
const { range, position, dimension } = options;
|
|
59
|
+
const { x, y, z } = position;
|
|
60
|
+
const mpEntity = new ColshapeSphere(x, y, z, range);
|
|
61
|
+
mpEntity.dimension = dimension;
|
|
62
|
+
const colshape = new AltVSphereColshape_1.AltVSphereColshape({ mpEntity });
|
|
63
|
+
this.registerBaseObject(colshape);
|
|
64
|
+
return colshape;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.AltVColshapesManager = AltVColshapesManager;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICuboidColshape } from "../../common";
|
|
2
|
+
import { AltVColshape, IAltVColshapeOptions } from "./AltVColshape";
|
|
3
|
+
export interface IAltVCuboidColshapeOptions extends IAltVColshapeOptions {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVCuboidColshape extends AltVColshape implements ICuboidColshape {
|
|
6
|
+
constructor(options: IAltVCuboidColshapeOptions);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVCuboidColshape = void 0;
|
|
4
|
+
const AltVColshape_1 = require("./AltVColshape");
|
|
5
|
+
class AltVCuboidColshape extends AltVColshape_1.AltVColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AltVCuboidColshape = AltVCuboidColshape;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICylinderColshape } from "../../common";
|
|
2
|
+
import { AltVColshape, IAltVColshapeOptions } from "./AltVColshape";
|
|
3
|
+
export interface IAltVCylinderColshapeOptions extends IAltVColshapeOptions {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVCylinderColshape extends AltVColshape implements ICylinderColshape {
|
|
6
|
+
constructor(options: IAltVCylinderColshapeOptions);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVCylinderColshape = void 0;
|
|
4
|
+
const AltVColshape_1 = require("./AltVColshape");
|
|
5
|
+
class AltVCylinderColshape extends AltVColshape_1.AltVColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AltVCylinderColshape = AltVCylinderColshape;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IRectangleColshape } from "../../common";
|
|
2
|
+
import { AltVColshape, IAltVColshapeOptions } from "./AltVColshape";
|
|
3
|
+
export interface IAltVRectangleColshapeOptions extends IAltVColshapeOptions {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVRectangleColshape extends AltVColshape implements IRectangleColshape {
|
|
6
|
+
constructor(options: IAltVRectangleColshapeOptions);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVRectangleColshape = void 0;
|
|
4
|
+
const AltVColshape_1 = require("./AltVColshape");
|
|
5
|
+
class AltVRectangleColshape extends AltVColshape_1.AltVColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AltVRectangleColshape = AltVRectangleColshape;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ISphereColshape } from "../../common";
|
|
2
|
+
import { AltVColshape, IAltVColshapeOptions } from "./AltVColshape";
|
|
3
|
+
export interface IAltVSphereColshapeOptions extends IAltVColshapeOptions {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVSphereColshape extends AltVColshape implements ISphereColshape {
|
|
6
|
+
constructor(options: IAltVSphereColshapeOptions);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVSphereColshape = void 0;
|
|
4
|
+
const AltVColshape_1 = require("./AltVColshape");
|
|
5
|
+
class AltVSphereColshape extends AltVColshape_1.AltVColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AltVSphereColshape = AltVSphereColshape;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AltVWorldObject, IAltVWorldObjectOptions } from "../worldObject/AltVWorldObject";
|
|
2
|
+
import Marker = AltVServer.Marker;
|
|
3
|
+
import { IMarker } from "../../common";
|
|
4
|
+
export interface IAltVMarkerOptions extends IAltVWorldObjectOptions<Marker> {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVMarker extends AltVWorldObject<Marker> implements IMarker {
|
|
7
|
+
get visible(): boolean;
|
|
8
|
+
get scale(): number;
|
|
9
|
+
constructor(options: IAltVMarkerOptions);
|
|
10
|
+
setVisible(value: boolean): void;
|
|
11
|
+
setScale(value: number): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVMarker = void 0;
|
|
4
|
+
const AltVWorldObject_1 = require("../worldObject/AltVWorldObject");
|
|
5
|
+
var Vector3 = AltVShared.Vector3;
|
|
6
|
+
class AltVMarker extends AltVWorldObject_1.AltVWorldObject {
|
|
7
|
+
get visible() {
|
|
8
|
+
return this.mpEntity.visible;
|
|
9
|
+
}
|
|
10
|
+
get scale() {
|
|
11
|
+
return this.mpEntity.scale.z;
|
|
12
|
+
}
|
|
13
|
+
constructor(options) {
|
|
14
|
+
super(options);
|
|
15
|
+
}
|
|
16
|
+
setVisible(value) {
|
|
17
|
+
this.mpEntity.visible = value;
|
|
18
|
+
}
|
|
19
|
+
setScale(value) {
|
|
20
|
+
this.mpEntity.scale = new Vector3(0, 0, value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.AltVMarker = AltVMarker;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IMarkerCreateOptions, IMarkersManager } from "../../common";
|
|
2
|
+
import { AltVWorldObjectsManager } from "../worldObject/AltVWorldObjectsManager";
|
|
3
|
+
import { AltVMarker } from "./AltVMarker";
|
|
4
|
+
export interface IAltVMarkerCreateOptions extends IMarkerCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVMarkersManager extends AltVWorldObjectsManager<AltVMarker> implements IMarkersManager {
|
|
7
|
+
constructor();
|
|
8
|
+
create(options: IAltVMarkerCreateOptions): AltVMarker;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVMarkersManager = void 0;
|
|
4
|
+
const AltVWorldObjectsManager_1 = require("../worldObject/AltVWorldObjectsManager");
|
|
5
|
+
const AltVMarker_1 = require("./AltVMarker");
|
|
6
|
+
var alt = AltVServer;
|
|
7
|
+
var Vector3 = AltVShared.Vector3;
|
|
8
|
+
class AltVMarkersManager extends AltVWorldObjectsManager_1.AltVWorldObjectsManager {
|
|
9
|
+
constructor() {
|
|
10
|
+
super({
|
|
11
|
+
baseObjectsType: "marker",
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
create(options) {
|
|
15
|
+
const { type, scale, color, position, dimension, rotation } = options;
|
|
16
|
+
const mpEntity = new alt.Marker(type, new Vector3(position), color);
|
|
17
|
+
mpEntity.scale = new Vector3(scale, scale, scale);
|
|
18
|
+
mpEntity.dimension = dimension;
|
|
19
|
+
mpEntity.rot = new Vector3(rotation);
|
|
20
|
+
const marker = new AltVMarker_1.AltVMarker({ mpEntity });
|
|
21
|
+
this.registerBaseObject(marker);
|
|
22
|
+
return marker;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.AltVMarkersManager = AltVMarkersManager;
|
|
@@ -4,6 +4,8 @@ exports.BaseObjectType = void 0;
|
|
|
4
4
|
var BaseObjectType;
|
|
5
5
|
(function (BaseObjectType) {
|
|
6
6
|
BaseObjectType["Blip"] = "blip";
|
|
7
|
+
BaseObjectType["Colshape"] = "colshape";
|
|
8
|
+
BaseObjectType["Marker"] = "marker";
|
|
7
9
|
BaseObjectType["Object"] = "object";
|
|
8
10
|
BaseObjectType["Ped"] = "ped";
|
|
9
11
|
BaseObjectType["Player"] = "player";
|
|
@@ -800,12 +800,17 @@ export declare enum IBlipColor {
|
|
|
800
800
|
export interface IBlipOptions extends IWorldObjectOptions {
|
|
801
801
|
}
|
|
802
802
|
export interface IBlip extends IWorldObject {
|
|
803
|
+
get name(): string;
|
|
803
804
|
get sprite(): IBlipSprite;
|
|
805
|
+
get color(): number;
|
|
804
806
|
get alpha(): number;
|
|
805
|
-
get
|
|
806
|
-
get
|
|
807
|
-
|
|
808
|
-
|
|
807
|
+
get scale(): number;
|
|
808
|
+
get drawDistance(): number;
|
|
809
|
+
get shortRange(): boolean;
|
|
810
|
+
get rotation(): number;
|
|
811
|
+
get dimension(): number;
|
|
809
812
|
setName(value: string): void;
|
|
813
|
+
setSprite(value: IBlipSprite): void;
|
|
810
814
|
setColor(value: IBlipColor): void;
|
|
815
|
+
setAlpha(value: number): void;
|
|
811
816
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { IWorldObjectCreateOptions, IWorldObjectsManager } from "../worldObject";
|
|
2
2
|
import { IBlip } from "./IBlip";
|
|
3
3
|
export interface IBlipCreateOptions extends IWorldObjectCreateOptions {
|
|
4
|
+
alpha?: number;
|
|
5
|
+
color?: number;
|
|
6
|
+
drawDistance?: number;
|
|
7
|
+
name?: string;
|
|
8
|
+
rotation?: number;
|
|
9
|
+
scale?: number;
|
|
10
|
+
shortRange?: boolean;
|
|
4
11
|
sprite: number;
|
|
5
|
-
alpha: number;
|
|
6
12
|
}
|
|
7
13
|
export interface IBlipsManager extends IWorldObjectsManager<IBlip> {
|
|
8
14
|
create(options: IBlipCreateOptions): IBlip;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IWorldObjectCreateOptions, IWorldObjectsManager } from "../worldObject";
|
|
2
|
+
import { IColshape } from "./IColshape";
|
|
3
|
+
import { IVector2D } from "../../../common/utils";
|
|
4
|
+
import { ICircleColshape } from "./ICircleColshape";
|
|
5
|
+
import { ICuboidColshape } from "./ICuboidColshape";
|
|
6
|
+
import { ICylinderColshape } from "./ICylinderColshape";
|
|
7
|
+
import { IRectangleColshape } from "./IRectangleColshape";
|
|
8
|
+
import { ISphereColshape } from "./ISphereColshape";
|
|
9
|
+
export interface ICircleColshapeCreateOptions extends Omit<IWorldObjectCreateOptions, "position"> {
|
|
10
|
+
position: IVector2D;
|
|
11
|
+
range: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ICuboidColshapeCreateOptions extends IWorldObjectCreateOptions {
|
|
14
|
+
width: number;
|
|
15
|
+
depth: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ICylinderColshapeCreateOptions extends IWorldObjectCreateOptions {
|
|
19
|
+
range: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
export interface IRectangleColshapeCreateOptions extends IWorldObjectCreateOptions {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ISphereColshapeCreateOptions extends IWorldObjectCreateOptions {
|
|
27
|
+
range: number;
|
|
28
|
+
}
|
|
29
|
+
export interface IColshapesManager extends IWorldObjectsManager<IColshape> {
|
|
30
|
+
createCircle(options: ICircleColshapeCreateOptions): ICircleColshape;
|
|
31
|
+
createCuboid(options: ICuboidColshapeCreateOptions): ICuboidColshape;
|
|
32
|
+
createCylinder(options: ICylinderColshapeCreateOptions): ICylinderColshape;
|
|
33
|
+
createRectangle(options: IRectangleColshapeCreateOptions): IRectangleColshape;
|
|
34
|
+
createSphere(options: ISphereColshapeCreateOptions): ISphereColshape;
|
|
35
|
+
}
|