rock-mod 0.1.0 → 0.3.0
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/LICENSE +21 -21
- package/README.md +25 -3
- package/dist/server/RockMod.d.ts +9 -6
- package/dist/server/RockMod.js +17 -7
- package/dist/server/common/utils/color/RGBA.d.ts +17 -0
- package/dist/server/common/utils/color/RGBA.js +28 -0
- package/dist/server/common/utils/color/index.d.ts +1 -0
- package/dist/server/common/utils/color/index.js +17 -0
- package/dist/server/common/utils/index.d.ts +1 -0
- package/dist/server/common/utils/index.js +1 -0
- package/dist/server/entities/altv/baseObject/AltVBaseObject.d.ts +1 -0
- package/dist/server/entities/altv/baseObject/AltVBaseObject.js +3 -0
- package/dist/server/entities/altv/baseObject/AltVBaseObjectsManager.js +2 -2
- package/dist/server/entities/altv/blip/AltVBlip.d.ts +15 -0
- package/dist/server/entities/altv/blip/AltVBlip.js +34 -0
- package/dist/server/entities/altv/blip/AltVBlipsManager.d.ts +9 -0
- package/dist/server/entities/altv/blip/AltVBlipsManager.js +25 -0
- package/dist/server/entities/altv/entity/AltVEntity.d.ts +3 -0
- package/dist/server/entities/altv/entity/AltVEntity.js +9 -0
- package/dist/server/entities/altv/object/AltVObject.d.ts +9 -0
- package/dist/server/entities/altv/object/AltVObject.js +16 -0
- package/dist/server/entities/altv/object/AltVObjectsManager.d.ts +9 -0
- package/dist/server/entities/altv/object/AltVObjectsManager.js +22 -0
- package/dist/server/entities/altv/ped/AltVPed.d.ts +8 -0
- package/dist/server/entities/altv/ped/AltVPed.js +10 -0
- package/dist/server/entities/altv/ped/AltVPedsManager.d.ts +9 -0
- package/dist/server/entities/altv/ped/AltVPedsManager.js +22 -0
- package/dist/server/entities/altv/player/AltVPlayer.d.ts +4 -4
- package/dist/server/entities/altv/player/AltVPlayer.js +6 -9
- package/dist/server/entities/altv/vehicle/AltVVehicle.d.ts +21 -0
- package/dist/server/entities/altv/vehicle/AltVVehicle.js +74 -0
- package/dist/server/entities/altv/vehicle/AltVVehiclesManager.js +5 -2
- package/dist/server/entities/common/baseObject/IBaseObject.d.ts +6 -2
- package/dist/server/entities/common/baseObject/IBaseObject.js +3 -0
- package/dist/server/entities/common/baseObject/IBaseObjectsManager.d.ts +2 -0
- package/dist/server/entities/common/blip/IBlip.d.ts +811 -0
- package/dist/server/entities/common/blip/IBlip.js +803 -0
- package/dist/server/entities/common/blip/IBlipsManager.d.ts +9 -0
- package/dist/server/entities/common/blip/index.d.ts +2 -0
- package/dist/server/entities/common/blip/index.js +18 -0
- package/dist/server/entities/common/entity/IEntitiesManager.d.ts +6 -1
- package/dist/server/entities/common/entity/IEntity.d.ts +3 -0
- package/dist/server/entities/common/index.d.ts +3 -0
- package/dist/server/entities/common/index.js +3 -0
- package/dist/server/entities/common/object/IObject.d.ts +7 -0
- package/dist/server/entities/common/object/IObject.js +2 -0
- package/dist/server/entities/common/object/IObjectsManager.d.ts +8 -0
- package/dist/server/entities/common/object/IObjectsManager.js +2 -0
- package/dist/server/entities/common/object/index.d.ts +2 -0
- package/dist/server/entities/common/object/index.js +18 -0
- package/dist/server/entities/common/ped/IPed.d.ts +5 -0
- package/dist/server/entities/common/ped/IPed.js +2 -0
- package/dist/server/entities/common/ped/IPedsManager.d.ts +7 -0
- package/dist/server/entities/common/ped/IPedsManager.js +2 -0
- package/dist/server/entities/common/ped/index.d.ts +2 -0
- package/dist/server/entities/common/ped/index.js +18 -0
- package/dist/server/entities/common/player/IPlayer.d.ts +4 -3
- package/dist/server/entities/common/player/index.d.ts +0 -1
- package/dist/server/entities/common/player/index.js +0 -1
- package/dist/server/entities/common/vehicle/IVehicle.d.ts +21 -0
- package/dist/server/entities/common/vehicle/IVehiclesManager.d.ts +4 -6
- package/dist/server/entities/common/worldObject/IWorldObject.d.ts +2 -2
- package/dist/server/entities/common/worldObject/IWorldObjectsManager.d.ts +6 -1
- package/dist/server/entities/ragemp/baseObject/RageBaseObject.d.ts +1 -0
- package/dist/server/entities/ragemp/baseObject/RageBaseObject.js +3 -0
- package/dist/server/entities/ragemp/blip/RageBlip.d.ts +15 -0
- package/dist/server/entities/ragemp/blip/RageBlip.js +34 -0
- package/dist/server/entities/ragemp/blip/RageBlipsManager.d.ts +9 -0
- package/dist/server/entities/ragemp/blip/RageBlipsManager.js +26 -0
- package/dist/server/entities/ragemp/entity/RageEntity.d.ts +3 -0
- package/dist/server/entities/ragemp/entity/RageEntity.js +8 -0
- package/dist/server/entities/ragemp/object/RageObject.d.ts +9 -0
- package/dist/server/entities/ragemp/object/RageObject.js +16 -0
- package/dist/server/entities/ragemp/object/RageObjectsManager.d.ts +9 -0
- package/dist/server/entities/ragemp/object/RageObjectsManager.js +25 -0
- package/dist/server/entities/ragemp/ped/RagePed.d.ts +7 -0
- package/dist/server/entities/ragemp/ped/RagePed.js +10 -0
- package/dist/server/entities/ragemp/ped/RagePedsManager.d.ts +9 -0
- package/dist/server/entities/ragemp/ped/RagePedsManager.js +24 -0
- package/dist/server/entities/ragemp/player/RagePlayer.d.ts +4 -4
- package/dist/server/entities/ragemp/player/RagePlayer.js +6 -9
- package/dist/server/entities/ragemp/player/RagePlayersManager.js +1 -0
- package/dist/server/entities/ragemp/vehicle/RageVehicle.d.ts +21 -0
- package/dist/server/entities/ragemp/vehicle/RageVehicle.js +70 -0
- package/dist/server/entities/ragemp/vehicle/RageVehiclesManager.js +9 -2
- package/dist/server/entities/ragemp/worldObject/RageWorldObject.js +1 -1
- package/dist/server/entities/ragemp/worldObject/RageWorldObjectsManager.d.ts +1 -1
- 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 +4 -2
- package/dist/server/factories/ragemp/RageManagersFactory.d.ts +6 -0
- package/dist/server/factories/ragemp/RageManagersFactory.js +12 -0
- package/dist/server/net/altv/events/AltVEventsManager.d.ts +8 -8
- package/dist/server/net/altv/events/AltVEventsManager.js +6 -6
- package/dist/server/net/altv/rpc/AltVRPCManager.d.ts +7 -6
- package/dist/server/net/altv/rpc/AltVRPCManager.js +7 -2
- package/dist/server/net/common/events/IEventsManager.d.ts +5 -4
- package/dist/server/net/common/rpc/IRPCManager.d.ts +7 -3
- package/dist/server/net/ragemp/events/RageEventsManager.d.ts +8 -8
- package/dist/server/net/ragemp/events/RageEventsManager.js +6 -7
- package/dist/server/net/ragemp/rpc/RageRPCManager.d.ts +8 -4
- package/dist/server/net/ragemp/rpc/RageRPCManager.js +6 -2
- package/package.json +62 -59
- package/dist/server/entities/altv/player/AltVPlayerNetManager.d.ts +0 -8
- package/dist/server/entities/altv/player/AltVPlayerNetManager.js +0 -16
- package/dist/server/entities/common/player/IPlayerNetManager.d.ts +0 -4
- package/dist/server/entities/ragemp/player/RagePlayerNetManager.d.ts +0 -7
- package/dist/server/entities/ragemp/player/RagePlayerNetManager.js +0 -16
- /package/dist/server/entities/common/{player/IPlayerNetManager.js → blip/IBlipsManager.js} +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Carter
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Carter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Rock-Mod is a powerful framework designed for
|
|
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,6 +1,5 @@
|
|
|
1
1
|
import { INetManager } from "./net/common/INetManager";
|
|
2
|
-
import { IPlayersManager } from "./entities
|
|
3
|
-
import { IVehiclesManager } from "./entities/common/vehicle/IVehiclesManager";
|
|
2
|
+
import { IBlipsManager, IObjectsManager, IPedsManager, IPlayersManager, IVehiclesManager } from "./entities";
|
|
4
3
|
type MultiplayerType = "RageMP" | "AltV";
|
|
5
4
|
export interface RockModOptions {
|
|
6
5
|
multiplayer: MultiplayerType;
|
|
@@ -10,14 +9,18 @@ export declare class RockMod {
|
|
|
10
9
|
static create(options: RockModOptions): Promise<RockMod>;
|
|
11
10
|
static get instance(): RockMod;
|
|
12
11
|
private static _initManagersFactory;
|
|
13
|
-
private readonly _managersFactory;
|
|
14
12
|
private readonly _net;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
13
|
+
private readonly _blips;
|
|
14
|
+
private readonly _objects;
|
|
15
|
+
private readonly _peds;
|
|
16
|
+
private readonly _players;
|
|
17
|
+
private readonly _vehicles;
|
|
17
18
|
get net(): INetManager;
|
|
19
|
+
get blips(): IBlipsManager;
|
|
20
|
+
get objects(): IObjectsManager;
|
|
21
|
+
get peds(): IPedsManager;
|
|
18
22
|
get players(): IPlayersManager;
|
|
19
23
|
get vehicles(): IVehiclesManager;
|
|
20
24
|
private constructor();
|
|
21
|
-
init(): void;
|
|
22
25
|
}
|
|
23
26
|
export {};
|
package/dist/server/RockMod.js
CHANGED
|
@@ -53,13 +53,24 @@ class RockMod {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
_managersFactory;
|
|
57
56
|
_net;
|
|
57
|
+
_blips;
|
|
58
|
+
_objects;
|
|
59
|
+
_peds;
|
|
58
60
|
_players;
|
|
59
61
|
_vehicles;
|
|
60
62
|
get net() {
|
|
61
63
|
return this._net;
|
|
62
64
|
}
|
|
65
|
+
get blips() {
|
|
66
|
+
return this._blips;
|
|
67
|
+
}
|
|
68
|
+
get objects() {
|
|
69
|
+
return this._objects;
|
|
70
|
+
}
|
|
71
|
+
get peds() {
|
|
72
|
+
return this._peds;
|
|
73
|
+
}
|
|
63
74
|
get players() {
|
|
64
75
|
return this._players;
|
|
65
76
|
}
|
|
@@ -67,13 +78,12 @@ class RockMod {
|
|
|
67
78
|
return this._vehicles;
|
|
68
79
|
}
|
|
69
80
|
constructor(managersFactory) {
|
|
70
|
-
this._managersFactory = managersFactory;
|
|
71
81
|
this._net = managersFactory.createNetManager();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this._players =
|
|
76
|
-
this._vehicles =
|
|
82
|
+
this._blips = managersFactory.createBlipsManager();
|
|
83
|
+
this._objects = managersFactory.createObjectsManager();
|
|
84
|
+
this._peds = managersFactory.createPedsManager();
|
|
85
|
+
this._players = managersFactory.createPlayersManager();
|
|
86
|
+
this._vehicles = managersFactory.createVehiclesManager();
|
|
77
87
|
}
|
|
78
88
|
}
|
|
79
89
|
exports.RockMod = RockMod;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface IRGBA {
|
|
2
|
+
get r(): number;
|
|
3
|
+
get g(): number;
|
|
4
|
+
get b(): number;
|
|
5
|
+
get a(): number | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare class RGBA implements IRGBA {
|
|
8
|
+
private readonly _r;
|
|
9
|
+
private readonly _g;
|
|
10
|
+
private readonly _b;
|
|
11
|
+
private readonly _a;
|
|
12
|
+
get r(): number;
|
|
13
|
+
get g(): number;
|
|
14
|
+
get b(): number;
|
|
15
|
+
get a(): number | undefined;
|
|
16
|
+
constructor(r: number, g: number, b: number, a?: number | undefined);
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RGBA = void 0;
|
|
4
|
+
class RGBA {
|
|
5
|
+
_r;
|
|
6
|
+
_g;
|
|
7
|
+
_b;
|
|
8
|
+
_a;
|
|
9
|
+
get r() {
|
|
10
|
+
return this._r;
|
|
11
|
+
}
|
|
12
|
+
get g() {
|
|
13
|
+
return this._g;
|
|
14
|
+
}
|
|
15
|
+
get b() {
|
|
16
|
+
return this._b;
|
|
17
|
+
}
|
|
18
|
+
get a() {
|
|
19
|
+
return this._a;
|
|
20
|
+
}
|
|
21
|
+
constructor(r, g, b, a) {
|
|
22
|
+
this._r = r;
|
|
23
|
+
this._g = g;
|
|
24
|
+
this._b = b;
|
|
25
|
+
this._a = a;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.RGBA = RGBA;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RGBA";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./RGBA"), exports);
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./color"), exports);
|
|
17
18
|
__exportStar(require("./math"), exports);
|
|
@@ -7,6 +7,7 @@ export declare abstract class AltVBaseObject<T extends BaseObject> implements IB
|
|
|
7
7
|
private readonly _mpEntity;
|
|
8
8
|
get id(): number;
|
|
9
9
|
get type(): BaseObjectType;
|
|
10
|
+
get isExists(): boolean;
|
|
10
11
|
protected get mpEntity(): T;
|
|
11
12
|
protected constructor(options: IAltVBaseObjectOptions<T>);
|
|
12
13
|
destroy(): void;
|
|
@@ -34,13 +34,13 @@ class AltVBaseObjectsManager {
|
|
|
34
34
|
throw new Error(`BaseObject [${this._baseObjectsType}] with id ${baseObject.id} already exists`);
|
|
35
35
|
}
|
|
36
36
|
this._baseObjects.set(baseObject.id, baseObject);
|
|
37
|
-
RockMod_1.RockMod.instance.net.events.emit("entityCreated", baseObject);
|
|
37
|
+
RockMod_1.RockMod.instance.net.events.emit("rm::entityCreated", baseObject);
|
|
38
38
|
}
|
|
39
39
|
unregisterBaseObject(baseObject) {
|
|
40
40
|
if (!this._baseObjects.delete(baseObject.id)) {
|
|
41
41
|
throw new Error(`BaseObject [${this._baseObjectsType}] with id ${baseObject.id} not found`);
|
|
42
42
|
}
|
|
43
|
-
RockMod_1.RockMod.instance.net.events.emit("
|
|
43
|
+
RockMod_1.RockMod.instance.net.events.emit("rm::entityCreated", baseObject);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.AltVBaseObjectsManager = AltVBaseObjectsManager;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AltVWorldObject, IAltVWorldObjectOptions } from "../worldObject/AltVWorldObject";
|
|
2
|
+
import { IBlip, IBlipColor, IBlipSprite } from "../../common";
|
|
3
|
+
export interface IAltVBlipOptions extends IAltVWorldObjectOptions<AltVServer.Blip> {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVBlip extends AltVWorldObject<AltVServer.Blip> implements IBlip {
|
|
6
|
+
get sprite(): IBlipSprite;
|
|
7
|
+
get alpha(): number;
|
|
8
|
+
get name(): string;
|
|
9
|
+
get color(): IBlipColor;
|
|
10
|
+
constructor(options: IAltVBlipOptions);
|
|
11
|
+
setSprite(value: IBlipSprite): void;
|
|
12
|
+
setAlpha(value: number): void;
|
|
13
|
+
setName(value: string): void;
|
|
14
|
+
setColor(value: IBlipColor): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVBlip = void 0;
|
|
4
|
+
const AltVWorldObject_1 = require("../worldObject/AltVWorldObject");
|
|
5
|
+
class AltVBlip extends AltVWorldObject_1.AltVWorldObject {
|
|
6
|
+
get sprite() {
|
|
7
|
+
return this.mpEntity.sprite;
|
|
8
|
+
}
|
|
9
|
+
get alpha() {
|
|
10
|
+
return this.mpEntity.alpha;
|
|
11
|
+
}
|
|
12
|
+
get name() {
|
|
13
|
+
return this.mpEntity.name;
|
|
14
|
+
}
|
|
15
|
+
get color() {
|
|
16
|
+
return this.mpEntity.color;
|
|
17
|
+
}
|
|
18
|
+
constructor(options) {
|
|
19
|
+
super(options);
|
|
20
|
+
}
|
|
21
|
+
setSprite(value) {
|
|
22
|
+
this.mpEntity.sprite = value;
|
|
23
|
+
}
|
|
24
|
+
setAlpha(value) {
|
|
25
|
+
this.mpEntity.alpha = value;
|
|
26
|
+
}
|
|
27
|
+
setName(value) {
|
|
28
|
+
this.mpEntity.name = value;
|
|
29
|
+
}
|
|
30
|
+
setColor(value) {
|
|
31
|
+
this.mpEntity.color = value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.AltVBlip = AltVBlip;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IBlipCreateOptions, IBlipsManager } from "../../common";
|
|
2
|
+
import { AltVWorldObjectsManager } from "../worldObject/AltVWorldObjectsManager";
|
|
3
|
+
import { AltVBlip } from "./AltVBlip";
|
|
4
|
+
export interface IAltVBlipCreateOptions extends IBlipCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVBlipsManager extends AltVWorldObjectsManager<AltVBlip> implements IBlipsManager {
|
|
7
|
+
constructor();
|
|
8
|
+
create(options: IAltVBlipCreateOptions): AltVBlip;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVBlipsManager = void 0;
|
|
4
|
+
const AltVWorldObjectsManager_1 = require("../worldObject/AltVWorldObjectsManager");
|
|
5
|
+
const AltVBlip_1 = require("./AltVBlip");
|
|
6
|
+
var PointBlip = AltVServer.PointBlip;
|
|
7
|
+
var Vector3 = AltVShared.Vector3;
|
|
8
|
+
class AltVBlipsManager extends AltVWorldObjectsManager_1.AltVWorldObjectsManager {
|
|
9
|
+
constructor() {
|
|
10
|
+
super({
|
|
11
|
+
baseObjectsType: "blip",
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
create(options) {
|
|
15
|
+
const { sprite, position, dimension, alpha } = options;
|
|
16
|
+
const mpEntity = new PointBlip(new Vector3(position), true);
|
|
17
|
+
mpEntity.sprite = sprite;
|
|
18
|
+
mpEntity.dimension = dimension;
|
|
19
|
+
mpEntity.alpha = alpha;
|
|
20
|
+
const blip = new AltVBlip_1.AltVBlip({ mpEntity });
|
|
21
|
+
this.registerBaseObject(blip);
|
|
22
|
+
return blip;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.AltVBlipsManager = AltVBlipsManager;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { IEntity } from "../../common/entity/IEntity";
|
|
2
2
|
import { AltVWorldObject, IAltVWorldObjectOptions } from "../worldObject/AltVWorldObject";
|
|
3
3
|
import Entity = AltVServer.Entity;
|
|
4
|
+
import { Vector3D } from "../../../common/utils";
|
|
4
5
|
export interface IAltVEntityOptions<T extends Entity> extends IAltVWorldObjectOptions<T> {
|
|
5
6
|
}
|
|
6
7
|
export declare abstract class AltVEntity<T extends Entity> extends AltVWorldObject<T> implements IEntity {
|
|
7
8
|
get model(): number;
|
|
9
|
+
get rotation(): Vector3D;
|
|
8
10
|
protected constructor(options: IAltVEntityOptions<T>);
|
|
9
11
|
setModel(value: string): void;
|
|
12
|
+
setRotation(value: Vector3D): void;
|
|
10
13
|
}
|
|
@@ -3,15 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AltVEntity = void 0;
|
|
4
4
|
const AltVWorldObject_1 = require("../worldObject/AltVWorldObject");
|
|
5
5
|
var hash = AltVShared.hash;
|
|
6
|
+
const utils_1 = require("../../../common/utils");
|
|
7
|
+
var Vector3 = AltVShared.Vector3;
|
|
6
8
|
class AltVEntity extends AltVWorldObject_1.AltVWorldObject {
|
|
7
9
|
get model() {
|
|
8
10
|
return this.mpEntity.model;
|
|
9
11
|
}
|
|
12
|
+
get rotation() {
|
|
13
|
+
const { x, y, z } = this.mpEntity.rot;
|
|
14
|
+
return new utils_1.Vector3D(x, y, z);
|
|
15
|
+
}
|
|
10
16
|
constructor(options) {
|
|
11
17
|
super(options);
|
|
12
18
|
}
|
|
13
19
|
setModel(value) {
|
|
14
20
|
this.mpEntity.model = hash(value);
|
|
15
21
|
}
|
|
22
|
+
setRotation(value) {
|
|
23
|
+
this.mpEntity.rot = new Vector3(value);
|
|
24
|
+
}
|
|
16
25
|
}
|
|
17
26
|
exports.AltVEntity = AltVEntity;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AltVEntity, IAltVEntityOptions } from "../entity/AltVEntity";
|
|
2
|
+
import { IObject } from "../../common/object/IObject";
|
|
3
|
+
export interface IAltVObjectOptions extends IAltVEntityOptions<AltVServer.Object> {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVObject extends AltVEntity<AltVServer.Object> implements IObject {
|
|
6
|
+
get alpha(): number;
|
|
7
|
+
constructor(options: IAltVObjectOptions);
|
|
8
|
+
setAlpha(value: number): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVObject = void 0;
|
|
4
|
+
const AltVEntity_1 = require("../entity/AltVEntity");
|
|
5
|
+
class AltVObject extends AltVEntity_1.AltVEntity {
|
|
6
|
+
get alpha() {
|
|
7
|
+
return this.mpEntity.alpha;
|
|
8
|
+
}
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super(options);
|
|
11
|
+
}
|
|
12
|
+
setAlpha(value) {
|
|
13
|
+
this.mpEntity.alpha = value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.AltVObject = AltVObject;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IObjectCreateOptions, IObjectsManager } from "../../common/object/IObjectsManager";
|
|
2
|
+
import { AltVEntitiesManager } from "../entity/AltVEntitiesManager";
|
|
3
|
+
import { AltVObject } from "./AltVObject";
|
|
4
|
+
export interface IAltVObjectCreateOptions extends IObjectCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVObjectsManager extends AltVEntitiesManager<AltVObject> implements IObjectsManager {
|
|
7
|
+
constructor();
|
|
8
|
+
create(options: IAltVObjectCreateOptions): AltVObject;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVObjectsManager = void 0;
|
|
4
|
+
const AltVEntitiesManager_1 = require("../entity/AltVEntitiesManager");
|
|
5
|
+
const AltVObject_1 = require("./AltVObject");
|
|
6
|
+
var alt = AltVServer;
|
|
7
|
+
class AltVObjectsManager extends AltVEntitiesManager_1.AltVEntitiesManager {
|
|
8
|
+
constructor() {
|
|
9
|
+
super({
|
|
10
|
+
baseObjectsType: "object",
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
create(options) {
|
|
14
|
+
const { model, position, dimension, rotation, alpha } = options;
|
|
15
|
+
const mpEntity = new alt.Object(model, position, rotation, alpha);
|
|
16
|
+
mpEntity.dimension = dimension;
|
|
17
|
+
const object = new AltVObject_1.AltVObject({ mpEntity });
|
|
18
|
+
this.registerBaseObject(object);
|
|
19
|
+
return object;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.AltVObjectsManager = AltVObjectsManager;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AltVEntity, IAltVEntityOptions } from "../entity/AltVEntity";
|
|
2
|
+
import Ped = AltVServer.Ped;
|
|
3
|
+
import { IPed } from "../../common";
|
|
4
|
+
export interface IAltVPedOptions extends IAltVEntityOptions<Ped> {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVPed extends AltVEntity<Ped> implements IPed {
|
|
7
|
+
constructor(options: IAltVPedOptions);
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVPed = void 0;
|
|
4
|
+
const AltVEntity_1 = require("../entity/AltVEntity");
|
|
5
|
+
class AltVPed extends AltVEntity_1.AltVEntity {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AltVPed = AltVPed;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPedCreateOptions, IPedsManager } from "../../common";
|
|
2
|
+
import { AltVEntitiesManager } from "../entity/AltVEntitiesManager";
|
|
3
|
+
import { AltVPed } from "./AltVPed";
|
|
4
|
+
export interface IAltVPedCreateOptions extends IPedCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVPedsManager extends AltVEntitiesManager<AltVPed> implements IPedsManager {
|
|
7
|
+
constructor();
|
|
8
|
+
create(options: IAltVPedCreateOptions): AltVPed;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVPedsManager = void 0;
|
|
4
|
+
const AltVEntitiesManager_1 = require("../entity/AltVEntitiesManager");
|
|
5
|
+
const AltVPed_1 = require("./AltVPed");
|
|
6
|
+
var alt = AltVServer;
|
|
7
|
+
class AltVPedsManager extends AltVEntitiesManager_1.AltVEntitiesManager {
|
|
8
|
+
constructor() {
|
|
9
|
+
super({
|
|
10
|
+
baseObjectsType: "ped",
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
create(options) {
|
|
14
|
+
const { model, position, dimension, rotation } = options;
|
|
15
|
+
const mpEntity = new alt.Ped(model, position, rotation);
|
|
16
|
+
mpEntity.dimension = dimension;
|
|
17
|
+
const ped = new AltVPed_1.AltVPed({ mpEntity });
|
|
18
|
+
this.registerBaseObject(ped);
|
|
19
|
+
return ped;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.AltVPedsManager = AltVPedsManager;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { AltVEntity, IAltVEntityOptions } from "../entity/AltVEntity";
|
|
2
2
|
import { ICustomization, IPlayer } from "../../common/player/IPlayer";
|
|
3
|
-
import { AltVPlayerNetManager } from "./AltVPlayerNetManager";
|
|
4
3
|
import { AltVVehicle } from "../vehicle/AltVVehicle";
|
|
5
4
|
import Player = AltVServer.Player;
|
|
6
5
|
import { Vector3D } from "../../../common/utils/math/Vectors";
|
|
6
|
+
import { IAltVClientEvents } from "../../../net/altv/events/AltVEventsManager";
|
|
7
|
+
import { IAltVClientRPC } from "../../../net/altv/rpc/AltVRPCManager";
|
|
7
8
|
interface AltVPlayerOptions extends IAltVEntityOptions<Player> {
|
|
8
9
|
}
|
|
9
10
|
export declare class AltVPlayer extends AltVEntity<Player> implements IPlayer {
|
|
10
|
-
private readonly _net;
|
|
11
|
-
get net(): AltVPlayerNetManager;
|
|
12
11
|
get name(): string;
|
|
13
12
|
get socialClub(): string;
|
|
14
13
|
get heading(): number;
|
|
@@ -22,8 +21,9 @@ export declare class AltVPlayer extends AltVEntity<Player> implements IPlayer {
|
|
|
22
21
|
get weaponAmmo(): number;
|
|
23
22
|
get eyeColor(): number;
|
|
24
23
|
get streamedPlayers(): AltVPlayer[];
|
|
25
|
-
get isExists(): boolean;
|
|
26
24
|
constructor(options: AltVPlayerOptions);
|
|
25
|
+
emitEvent<K extends keyof IAltVClientEvents>(eventName: K, ...args: Parameters<IAltVClientEvents[K]>): void;
|
|
26
|
+
emitRPC<K extends keyof IAltVClientRPC>(rpcName: K, ...args: Parameters<IAltVClientRPC[K]>): Promise<ReturnType<IAltVClientRPC[K]>>;
|
|
27
27
|
spawn(position: Vector3D): void;
|
|
28
28
|
setName(name: string): void;
|
|
29
29
|
setHeading(value: number): void;
|
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AltVPlayer = void 0;
|
|
4
4
|
const AltVEntity_1 = require("../entity/AltVEntity");
|
|
5
|
-
const AltVPlayerNetManager_1 = require("./AltVPlayerNetManager");
|
|
6
5
|
const RockMod_1 = require("../../../RockMod");
|
|
7
6
|
var Player = AltVServer.Player;
|
|
8
7
|
var Vehicle = AltVServer.Vehicle;
|
|
9
8
|
var Vector3 = AltVShared.Vector3;
|
|
10
9
|
var hash = AltVShared.hash;
|
|
11
10
|
class AltVPlayer extends AltVEntity_1.AltVEntity {
|
|
12
|
-
_net;
|
|
13
|
-
get net() {
|
|
14
|
-
return this._net;
|
|
15
|
-
}
|
|
16
11
|
get name() {
|
|
17
12
|
return this.mpEntity.name;
|
|
18
13
|
}
|
|
@@ -62,12 +57,14 @@ class AltVPlayer extends AltVEntity_1.AltVEntity {
|
|
|
62
57
|
}
|
|
63
58
|
return players;
|
|
64
59
|
}
|
|
65
|
-
get isExists() {
|
|
66
|
-
return this.mpEntity.valid;
|
|
67
|
-
}
|
|
68
60
|
constructor(options) {
|
|
69
61
|
super(options);
|
|
70
|
-
|
|
62
|
+
}
|
|
63
|
+
emitEvent(eventName, ...args) {
|
|
64
|
+
return RockMod_1.RockMod.instance.net.events.emitClient(this, eventName, ...args);
|
|
65
|
+
}
|
|
66
|
+
emitRPC(rpcName, ...args) {
|
|
67
|
+
return RockMod_1.RockMod.instance.net.rpc.emitClient(this, rpcName, ...args);
|
|
71
68
|
}
|
|
72
69
|
spawn(position) {
|
|
73
70
|
return this.mpEntity.spawn(position);
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import { AltVEntity, IAltVEntityOptions } from "../entity/AltVEntity";
|
|
2
2
|
import { IVehicle } from "../../common/vehicle/IVehicle";
|
|
3
3
|
import Vehicle = AltVServer.Vehicle;
|
|
4
|
+
import { RGBA } from "../../../common/utils";
|
|
5
|
+
import { AltVPlayer } from "../player/AltVPlayer";
|
|
4
6
|
export interface IAltVVehicleOptions extends IAltVEntityOptions<Vehicle> {
|
|
5
7
|
}
|
|
6
8
|
export declare class AltVVehicle extends AltVEntity<Vehicle> implements IVehicle {
|
|
7
9
|
get bodyHealth(): number;
|
|
10
|
+
get engineHealth(): number;
|
|
11
|
+
get numberPlate(): string;
|
|
12
|
+
get isLocked(): boolean;
|
|
13
|
+
get isDead(): boolean;
|
|
14
|
+
get primaryColor(): number;
|
|
15
|
+
get secondaryColor(): number;
|
|
16
|
+
get customPrimaryColor(): RGBA;
|
|
17
|
+
get customSecondaryColor(): RGBA;
|
|
18
|
+
get driver(): AltVPlayer | null;
|
|
19
|
+
get passengers(): Set<AltVPlayer>;
|
|
8
20
|
constructor(options: IAltVVehicleOptions);
|
|
9
21
|
setBodyHealth(value: number): void;
|
|
22
|
+
setEngineHealth(value: number): void;
|
|
23
|
+
setNumberPlate(value: string): void;
|
|
24
|
+
setLocked(value: boolean): void;
|
|
25
|
+
setPrimaryColor(value: number): void;
|
|
26
|
+
setSecondaryColor(value: number): void;
|
|
27
|
+
setCustomPrimaryColor(value: RGBA): void;
|
|
28
|
+
setCustomSecondaryColor(value: RGBA): void;
|
|
29
|
+
explode(): void;
|
|
30
|
+
repair(): void;
|
|
10
31
|
}
|