rock-mod 0.22.0 → 0.23.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/dist/client/entities/ccmp/object/CCMPObject.d.ts +3 -6
- package/dist/client/entities/ccmp/object/CCMPObject.js +33 -102
- package/dist/client/entities/ccmp/player/CCMPPlayer.d.ts +14 -16
- package/dist/client/entities/ccmp/player/CCMPPlayer.js +85 -92
- package/dist/client/entities/ccmp/vehicle/CCMPVehicle.d.ts +32 -49
- package/dist/client/entities/ccmp/vehicle/CCMPVehicle.js +117 -198
- package/dist/client/entities/ccmp/vehicle/CCMPVehiclesManager.js +2 -1
- package/dist/client/game/ccmp/chat/CCMPChatManager.d.ts +2 -22
- package/dist/client/game/ccmp/chat/CCMPChatManager.js +6 -34
- package/dist/client/game/ccmp/graphics/CCMPGraphicsManager.js +7 -17
- package/dist/client/game/ccmp/ui/CCMPUiManager.d.ts +0 -29
- package/dist/client/game/ccmp/ui/CCMPUiManager.js +5 -41
- package/dist/client/net/ccmp/CCMPNetManager.d.ts +0 -7
- package/dist/client/net/ccmp/CCMPNetManager.js +0 -26
- package/dist/client/net/ccmp/events/CCMPEventsBridge.d.ts +3 -1
- package/dist/client/net/ccmp/events/CCMPEventsBridge.js +33 -3
- package/dist/server/entities/altv/colshape/AltVColshape.d.ts +2 -0
- package/dist/server/entities/altv/colshape/AltVColshape.js +6 -0
- package/dist/server/entities/ccmp/player/CCMPPlayersManager.js +15 -0
- package/dist/server/entities/ccmp/vehicle/CCMPVehicle.d.ts +27 -13
- package/dist/server/entities/ccmp/vehicle/CCMPVehicle.js +82 -39
- package/dist/server/entities/common/colshape/IColshape.d.ts +2 -0
- package/dist/server/entities/mock/colshape/MockColshape.d.ts +3 -0
- package/dist/server/entities/mock/colshape/MockColshape.js +8 -0
- package/dist/server/entities/ragemp/colshape/RageColshape.d.ts +2 -0
- package/dist/server/entities/ragemp/colshape/RageColshape.js +6 -0
- package/dist/server/net/ccmp/CCMPNetManager.js +0 -5
- package/dist/server/net/ccmp/events/CCMPEventsManager.d.ts +6 -2
- package/package.json +2 -2
|
@@ -1,23 +1,9 @@
|
|
|
1
|
+
import { type Vehicle as CcmpVehicle } from "@classic-mp/types/client";
|
|
1
2
|
import { BaseObjectType } from "../../../../shared/entities";
|
|
2
3
|
import { type IRGB, type IVector3D, Vector3D } from "../../../../shared/common/utils";
|
|
3
4
|
import { type IBaseObject } from "../../common/baseObject/IBaseObject";
|
|
4
5
|
import { type ILightState, type IVehicle } from "../../common/vehicle/IVehicle";
|
|
5
|
-
export
|
|
6
|
-
readonly id: number;
|
|
7
|
-
readonly remoteId: number | null;
|
|
8
|
-
readonly isRemote: boolean;
|
|
9
|
-
readonly handle: number;
|
|
10
|
-
readonly model: number;
|
|
11
|
-
readonly dimension: number;
|
|
12
|
-
readonly isAlive: boolean;
|
|
13
|
-
readonly isExists?: boolean;
|
|
14
|
-
readonly position: IVector3D;
|
|
15
|
-
readonly rotation: IVector3D;
|
|
16
|
-
readonly heading: number;
|
|
17
|
-
readonly numberPlateText: string;
|
|
18
|
-
readonly numberPlate: string;
|
|
19
|
-
destroy(): boolean;
|
|
20
|
-
}
|
|
6
|
+
export type ICCMPNativeVehicle = CcmpVehicle;
|
|
21
7
|
export declare class CCMPVehicle implements IVehicle {
|
|
22
8
|
private readonly _ccmpVehicle;
|
|
23
9
|
private readonly _onDestroy;
|
|
@@ -31,20 +17,20 @@ export declare class CCMPVehicle implements IVehicle {
|
|
|
31
17
|
destroy(): void;
|
|
32
18
|
get position(): Vector3D;
|
|
33
19
|
get dimension(): number;
|
|
34
|
-
setPosition(
|
|
35
|
-
setDimension(
|
|
36
|
-
setCoords(
|
|
20
|
+
setPosition(value: IVector3D): void;
|
|
21
|
+
setDimension(value: number): void;
|
|
22
|
+
setCoords(xPos: number, yPos: number, zPos: number, xAxis: boolean, yAxis: boolean, zAxis: boolean, clearArea: boolean): void;
|
|
37
23
|
get model(): number;
|
|
38
24
|
get heading(): number;
|
|
39
|
-
setHeading(
|
|
40
|
-
setModel(
|
|
25
|
+
setHeading(heading: number): void;
|
|
26
|
+
setModel(value: string): void;
|
|
41
27
|
get rotation(): Vector3D;
|
|
42
28
|
get forwardVector(): Vector3D;
|
|
43
|
-
setRotation(
|
|
44
|
-
freezePosition(
|
|
45
|
-
setCollision(
|
|
46
|
-
setInvincible(
|
|
47
|
-
setVisible(
|
|
29
|
+
setRotation(value: IVector3D): void;
|
|
30
|
+
freezePosition(freeze: boolean): void;
|
|
31
|
+
setCollision(collision: boolean, keepPhysics: boolean): void;
|
|
32
|
+
setInvincible(invincible: boolean): void;
|
|
33
|
+
setVisible(visible: boolean): void;
|
|
48
34
|
setAlpha(alpha: number): void;
|
|
49
35
|
get alpha(): number;
|
|
50
36
|
resetAlpha(): void;
|
|
@@ -55,28 +41,28 @@ export declare class CCMPVehicle implements IVehicle {
|
|
|
55
41
|
getSyncedMeta(key: string): unknown | undefined;
|
|
56
42
|
hasSyncedMeta(key: string): boolean;
|
|
57
43
|
getSyncedMetaKeys(): readonly string[];
|
|
58
|
-
attachToEntity(
|
|
59
|
-
detach(
|
|
44
|
+
attachToEntity(target: IBaseObject, boneIndex: number, offset: IVector3D, rotation: IVector3D, p9: boolean, useSoftPinning: boolean, collision: boolean, isPed: boolean, vertexIndex: number, fixedRot: boolean): void;
|
|
45
|
+
detach(useDetachVelocity: boolean, collision: boolean): void;
|
|
60
46
|
getSpeed(): number;
|
|
61
|
-
isPlayingAnim(
|
|
47
|
+
isPlayingAnim(dictionary: string, name: string, taskFlag: number): boolean;
|
|
62
48
|
get bodyHealth(): number;
|
|
63
49
|
get engineHealth(): number;
|
|
64
50
|
get numberPlate(): string;
|
|
65
51
|
get isDead(): boolean;
|
|
66
|
-
setBodyHealth(
|
|
67
|
-
setEngineHealth(
|
|
68
|
-
setNumberPlate(
|
|
52
|
+
setBodyHealth(value: number): void;
|
|
53
|
+
setEngineHealth(value: number): void;
|
|
54
|
+
setNumberPlate(value: string): void;
|
|
69
55
|
explode(): void;
|
|
70
56
|
getPedInSeat(seat: number): number;
|
|
71
|
-
setUndriveable(
|
|
57
|
+
setUndriveable(toggle: boolean): void;
|
|
72
58
|
get maxNumberOfPassengers(): number;
|
|
73
59
|
get gear(): number;
|
|
74
60
|
get speed(): number;
|
|
75
61
|
get isEngineRunning(): boolean;
|
|
76
|
-
setEngineOn(
|
|
62
|
+
setEngineOn(toggle: boolean, instantly: boolean, otherwise: boolean): void;
|
|
77
63
|
get lightsState(): ILightState;
|
|
78
64
|
get isLocked(): boolean;
|
|
79
|
-
setIsLocked(
|
|
65
|
+
setIsLocked(value: boolean): void;
|
|
80
66
|
setCustomPrimaryColour(color: IRGB): void;
|
|
81
67
|
setCustomSecondaryColour(color: IRGB): void;
|
|
82
68
|
get customPrimaryColour(): IRGB;
|
|
@@ -90,20 +76,20 @@ export declare class CCMPVehicle implements IVehicle {
|
|
|
90
76
|
get windowTint(): number;
|
|
91
77
|
setWheelType(wheelType: number): void;
|
|
92
78
|
get wheelType(): number;
|
|
93
|
-
setNumberPlateTextIndex(
|
|
79
|
+
setNumberPlateTextIndex(index: number): void;
|
|
94
80
|
get numberPlateTextIndex(): number;
|
|
95
|
-
setDoorOpen(
|
|
96
|
-
setDoorShut(
|
|
97
|
-
setHandling(
|
|
98
|
-
getHandling(
|
|
99
|
-
setEnginePowerMultiplier(
|
|
100
|
-
setEngineTorqueMultiplier(
|
|
101
|
-
modifyTopSpeed(
|
|
102
|
-
setCheatPowerIncrease(
|
|
81
|
+
setDoorOpen(doorIndex: number, loose: boolean, openInstantly: boolean): void;
|
|
82
|
+
setDoorShut(doorIndex: number, instantly: boolean): void;
|
|
83
|
+
setHandling(field: string, value: number): void;
|
|
84
|
+
getHandling(field: string): number;
|
|
85
|
+
setEnginePowerMultiplier(value: number): void;
|
|
86
|
+
setEngineTorqueMultiplier(value: number): void;
|
|
87
|
+
modifyTopSpeed(value: number): void;
|
|
88
|
+
setCheatPowerIncrease(value: number): void;
|
|
103
89
|
toggleMod(modType: number, toggle: boolean): void;
|
|
104
90
|
setTyreSmokeColor(r: number, g: number, b: number): void;
|
|
105
91
|
setModColor1(paintType: number, color: number, p3: number): void;
|
|
106
|
-
setExtraColours(
|
|
92
|
+
setExtraColours(pearlescentColor: number, wheelColor: number): void;
|
|
107
93
|
setHeadlightColor(colorIndex: number): void;
|
|
108
94
|
setDashboardColor(colorIndex: number): void;
|
|
109
95
|
setInteriorColor(colorIndex: number): void;
|
|
@@ -111,9 +97,6 @@ export declare class CCMPVehicle implements IVehicle {
|
|
|
111
97
|
getAcceleration(): number;
|
|
112
98
|
getMaxTraction(): number;
|
|
113
99
|
getModelMaxSpeed(): number;
|
|
114
|
-
private
|
|
115
|
-
private _withHandleVoid;
|
|
116
|
-
private _setModKit;
|
|
100
|
+
private _normalizeHandle;
|
|
117
101
|
private _getRemoteVehicleExists;
|
|
118
|
-
private _getOffsetFromCachedTransform;
|
|
119
102
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
1
|
import { BaseObjectType } from "../../../../shared/entities";
|
|
3
2
|
import { Vector3D } from "../../../../shared/common/utils";
|
|
4
|
-
const notImplemented = (memberName) => {
|
|
5
|
-
throw new Error(`CCMPVehicle.${memberName}: not implemented`);
|
|
6
|
-
};
|
|
7
3
|
export class CCMPVehicle {
|
|
8
4
|
constructor(_ccmpVehicle, _onDestroy = () => { }) {
|
|
9
5
|
this._ccmpVehicle = _ccmpVehicle;
|
|
@@ -20,17 +16,14 @@ export class CCMPVehicle {
|
|
|
20
16
|
return BaseObjectType.Vehicle;
|
|
21
17
|
}
|
|
22
18
|
get isExists() {
|
|
23
|
-
var _a;
|
|
24
19
|
if (this._destroyed)
|
|
25
20
|
return false;
|
|
26
|
-
if (this._ccmpVehicle.isRemote)
|
|
21
|
+
if (this._ccmpVehicle.isRemote)
|
|
27
22
|
return this._getRemoteVehicleExists();
|
|
28
|
-
|
|
29
|
-
return !this._destroyed && ((_a = this._ccmpVehicle.isExists) !== null && _a !== void 0 ? _a : this._ccmpVehicle.isAlive);
|
|
23
|
+
return this._ccmpVehicle.isExists;
|
|
30
24
|
}
|
|
31
25
|
get handle() {
|
|
32
|
-
|
|
33
|
-
return Number.isFinite(handle) && handle > 0 ? Math.trunc(handle) : 0;
|
|
26
|
+
return this._normalizeHandle(this._ccmpVehicle.handle);
|
|
34
27
|
}
|
|
35
28
|
destroy() {
|
|
36
29
|
if (this._destroyed)
|
|
@@ -46,14 +39,14 @@ export class CCMPVehicle {
|
|
|
46
39
|
get dimension() {
|
|
47
40
|
return this._ccmpVehicle.dimension;
|
|
48
41
|
}
|
|
49
|
-
setPosition(
|
|
50
|
-
|
|
42
|
+
setPosition(value) {
|
|
43
|
+
this._ccmpVehicle.setPosition(value);
|
|
51
44
|
}
|
|
52
|
-
setDimension(
|
|
53
|
-
|
|
45
|
+
setDimension(value) {
|
|
46
|
+
this._ccmpVehicle.setDimension(value);
|
|
54
47
|
}
|
|
55
|
-
setCoords(
|
|
56
|
-
|
|
48
|
+
setCoords(xPos, yPos, zPos, xAxis, yAxis, zAxis, clearArea) {
|
|
49
|
+
this._ccmpVehicle.setCoords(xPos, yPos, zPos, xAxis, yAxis, zAxis, clearArea);
|
|
57
50
|
}
|
|
58
51
|
get model() {
|
|
59
52
|
return this._ccmpVehicle.model;
|
|
@@ -61,332 +54,258 @@ export class CCMPVehicle {
|
|
|
61
54
|
get heading() {
|
|
62
55
|
return this._ccmpVehicle.heading;
|
|
63
56
|
}
|
|
64
|
-
setHeading(
|
|
65
|
-
|
|
57
|
+
setHeading(heading) {
|
|
58
|
+
this._ccmpVehicle.setHeading(heading);
|
|
66
59
|
}
|
|
67
|
-
setModel(
|
|
68
|
-
|
|
60
|
+
setModel(value) {
|
|
61
|
+
this._ccmpVehicle.setModel(value);
|
|
69
62
|
}
|
|
70
63
|
get rotation() {
|
|
71
64
|
const { x, y, z } = this._ccmpVehicle.rotation;
|
|
72
65
|
return new Vector3D(x, y, z);
|
|
73
66
|
}
|
|
74
67
|
get forwardVector() {
|
|
75
|
-
const
|
|
76
|
-
return new Vector3D(
|
|
68
|
+
const { x, y, z } = this._ccmpVehicle.forwardVector;
|
|
69
|
+
return new Vector3D(x, y, z);
|
|
77
70
|
}
|
|
78
|
-
setRotation(
|
|
79
|
-
|
|
71
|
+
setRotation(value) {
|
|
72
|
+
this._ccmpVehicle.setRotation(value);
|
|
80
73
|
}
|
|
81
|
-
freezePosition(
|
|
82
|
-
|
|
74
|
+
freezePosition(freeze) {
|
|
75
|
+
this._ccmpVehicle.freezePosition(freeze);
|
|
83
76
|
}
|
|
84
|
-
setCollision(
|
|
85
|
-
|
|
77
|
+
setCollision(collision, keepPhysics) {
|
|
78
|
+
this._ccmpVehicle.setCollision(collision, keepPhysics);
|
|
86
79
|
}
|
|
87
|
-
setInvincible(
|
|
88
|
-
|
|
80
|
+
setInvincible(invincible) {
|
|
81
|
+
this._ccmpVehicle.setInvincible(invincible);
|
|
89
82
|
}
|
|
90
|
-
setVisible(
|
|
91
|
-
|
|
83
|
+
setVisible(visible) {
|
|
84
|
+
this._ccmpVehicle.setVisible(visible);
|
|
92
85
|
}
|
|
93
86
|
setAlpha(alpha) {
|
|
94
|
-
this.
|
|
95
|
-
ccmp.natives.entity.setEntityAlpha(handle, alpha, false);
|
|
96
|
-
});
|
|
87
|
+
this._ccmpVehicle.setAlpha(alpha);
|
|
97
88
|
}
|
|
98
89
|
get alpha() {
|
|
99
|
-
return this.
|
|
90
|
+
return this._ccmpVehicle.alpha;
|
|
100
91
|
}
|
|
101
92
|
resetAlpha() {
|
|
102
|
-
this.
|
|
103
|
-
ccmp.natives.entity.resetEntityAlpha(handle);
|
|
104
|
-
});
|
|
93
|
+
this._ccmpVehicle.resetAlpha();
|
|
105
94
|
}
|
|
106
95
|
getOffsetFromInWorldCoords(offsetX, offsetY, offsetZ) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return new Vector3D(x, y, z);
|
|
110
|
-
});
|
|
96
|
+
const { x, y, z } = this._ccmpVehicle.getOffsetFromInWorldCoords(offsetX, offsetY, offsetZ);
|
|
97
|
+
return new Vector3D(x, y, z);
|
|
111
98
|
}
|
|
112
99
|
getBoneIndexByName(boneName) {
|
|
113
|
-
return this.
|
|
100
|
+
return this._ccmpVehicle.getBoneIndexByName(boneName);
|
|
114
101
|
}
|
|
115
102
|
getWorldPositionOfBone(boneIndex) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return new Vector3D(x, y, z);
|
|
119
|
-
});
|
|
103
|
+
const { x, y, z } = this._ccmpVehicle.getWorldPositionOfBone(boneIndex);
|
|
104
|
+
return new Vector3D(x, y, z);
|
|
120
105
|
}
|
|
121
106
|
getVariable(name) {
|
|
122
107
|
const remoteId = this.remoteId;
|
|
123
|
-
if (remoteId === null)
|
|
108
|
+
if (remoteId === null)
|
|
124
109
|
return null;
|
|
125
|
-
}
|
|
126
110
|
const value = ccmp.entities.getStreamSyncedMeta(ccmp.entities.ENTITY_TYPE.Vehicle, remoteId, name);
|
|
127
111
|
return value === undefined ? null : value;
|
|
128
112
|
}
|
|
129
113
|
getSyncedMeta(key) {
|
|
130
114
|
const remoteId = this.remoteId;
|
|
131
|
-
if (remoteId === null)
|
|
115
|
+
if (remoteId === null)
|
|
132
116
|
return undefined;
|
|
133
|
-
}
|
|
134
117
|
return ccmp.entities.getStreamSyncedMeta(ccmp.entities.ENTITY_TYPE.Vehicle, remoteId, key);
|
|
135
118
|
}
|
|
136
119
|
hasSyncedMeta(key) {
|
|
137
120
|
const remoteId = this.remoteId;
|
|
138
|
-
if (remoteId === null)
|
|
121
|
+
if (remoteId === null)
|
|
139
122
|
return false;
|
|
140
|
-
}
|
|
141
123
|
return ccmp.entities.hasStreamSyncedMeta(ccmp.entities.ENTITY_TYPE.Vehicle, remoteId, key);
|
|
142
124
|
}
|
|
143
125
|
getSyncedMetaKeys() {
|
|
144
126
|
const remoteId = this.remoteId;
|
|
145
|
-
if (remoteId === null)
|
|
127
|
+
if (remoteId === null)
|
|
146
128
|
return [];
|
|
147
|
-
}
|
|
148
129
|
return ccmp.entities.getStreamSyncedMetaKeys(ccmp.entities.ENTITY_TYPE.Vehicle, remoteId);
|
|
149
130
|
}
|
|
150
|
-
attachToEntity(
|
|
151
|
-
|
|
131
|
+
attachToEntity(target, boneIndex, offset, rotation, p9, useSoftPinning, collision, isPed, vertexIndex, fixedRot) {
|
|
132
|
+
this._ccmpVehicle.attachToEntity(target, boneIndex, offset, rotation, p9, useSoftPinning, collision, isPed, vertexIndex, fixedRot);
|
|
152
133
|
}
|
|
153
|
-
detach(
|
|
154
|
-
|
|
134
|
+
detach(useDetachVelocity, collision) {
|
|
135
|
+
this._ccmpVehicle.detach(useDetachVelocity, collision);
|
|
155
136
|
}
|
|
156
137
|
getSpeed() {
|
|
157
|
-
return
|
|
138
|
+
return this._ccmpVehicle.getSpeed();
|
|
158
139
|
}
|
|
159
|
-
isPlayingAnim(
|
|
160
|
-
return
|
|
140
|
+
isPlayingAnim(dictionary, name, taskFlag) {
|
|
141
|
+
return this._ccmpVehicle.isPlayingAnim(dictionary, name, taskFlag);
|
|
161
142
|
}
|
|
162
143
|
get bodyHealth() {
|
|
163
|
-
return
|
|
144
|
+
return this._ccmpVehicle.bodyHealth;
|
|
164
145
|
}
|
|
165
146
|
get engineHealth() {
|
|
166
|
-
return
|
|
147
|
+
return this._ccmpVehicle.engineHealth;
|
|
167
148
|
}
|
|
168
149
|
get numberPlate() {
|
|
169
|
-
|
|
170
|
-
return (_a = this._ccmpVehicle.numberPlate) !== null && _a !== void 0 ? _a : this._ccmpVehicle.numberPlateText;
|
|
150
|
+
return this._ccmpVehicle.numberPlate;
|
|
171
151
|
}
|
|
172
152
|
get isDead() {
|
|
173
|
-
return
|
|
153
|
+
return this._ccmpVehicle.isDead;
|
|
174
154
|
}
|
|
175
|
-
setBodyHealth(
|
|
176
|
-
|
|
155
|
+
setBodyHealth(value) {
|
|
156
|
+
this._ccmpVehicle.setBodyHealth(value);
|
|
177
157
|
}
|
|
178
|
-
setEngineHealth(
|
|
179
|
-
|
|
158
|
+
setEngineHealth(value) {
|
|
159
|
+
this._ccmpVehicle.setEngineHealth(value);
|
|
180
160
|
}
|
|
181
|
-
setNumberPlate(
|
|
182
|
-
|
|
161
|
+
setNumberPlate(value) {
|
|
162
|
+
this._ccmpVehicle.setNumberPlate(value);
|
|
183
163
|
}
|
|
184
164
|
explode() {
|
|
185
|
-
|
|
165
|
+
this._ccmpVehicle.explode();
|
|
186
166
|
}
|
|
187
167
|
getPedInSeat(seat) {
|
|
188
|
-
return this.
|
|
168
|
+
return this._ccmpVehicle.getPedInSeat(seat);
|
|
189
169
|
}
|
|
190
|
-
setUndriveable(
|
|
191
|
-
|
|
170
|
+
setUndriveable(toggle) {
|
|
171
|
+
this._ccmpVehicle.setUndriveable(toggle);
|
|
192
172
|
}
|
|
193
173
|
get maxNumberOfPassengers() {
|
|
194
|
-
return
|
|
174
|
+
return this._ccmpVehicle.maxNumberOfPassengers;
|
|
195
175
|
}
|
|
196
176
|
get gear() {
|
|
197
|
-
return
|
|
177
|
+
return this._ccmpVehicle.gear;
|
|
198
178
|
}
|
|
199
179
|
get speed() {
|
|
200
|
-
return
|
|
180
|
+
return this._ccmpVehicle.speed;
|
|
201
181
|
}
|
|
202
182
|
get isEngineRunning() {
|
|
203
|
-
return
|
|
183
|
+
return this._ccmpVehicle.isEngineRunning;
|
|
204
184
|
}
|
|
205
|
-
setEngineOn(
|
|
206
|
-
|
|
185
|
+
setEngineOn(toggle, instantly, otherwise) {
|
|
186
|
+
this._ccmpVehicle.setEngineOn(toggle, instantly, otherwise);
|
|
207
187
|
}
|
|
208
188
|
get lightsState() {
|
|
209
|
-
return
|
|
189
|
+
return this._ccmpVehicle.lightsState;
|
|
210
190
|
}
|
|
211
191
|
get isLocked() {
|
|
212
|
-
return
|
|
192
|
+
return this._ccmpVehicle.isLocked;
|
|
213
193
|
}
|
|
214
|
-
setIsLocked(
|
|
215
|
-
|
|
194
|
+
setIsLocked(value) {
|
|
195
|
+
this._ccmpVehicle.setIsLocked(value);
|
|
216
196
|
}
|
|
217
197
|
setCustomPrimaryColour(color) {
|
|
218
|
-
this.
|
|
219
|
-
ccmp.natives.vehicle.setVehicleCustomPrimaryColour(handle, color.r, color.g, color.b);
|
|
220
|
-
});
|
|
198
|
+
this._ccmpVehicle.setCustomPrimaryColour(color);
|
|
221
199
|
}
|
|
222
200
|
setCustomSecondaryColour(color) {
|
|
223
|
-
this.
|
|
224
|
-
ccmp.natives.vehicle.setVehicleCustomSecondaryColour(handle, color.r, color.g, color.b);
|
|
225
|
-
});
|
|
201
|
+
this._ccmpVehicle.setCustomSecondaryColour(color);
|
|
226
202
|
}
|
|
227
203
|
get customPrimaryColour() {
|
|
228
|
-
return this.
|
|
204
|
+
return this._ccmpVehicle.customPrimaryColour;
|
|
229
205
|
}
|
|
230
206
|
get customSecondaryColour() {
|
|
231
|
-
return this.
|
|
207
|
+
return this._ccmpVehicle.customSecondaryColour;
|
|
232
208
|
}
|
|
233
209
|
setMod(modType, modIndex) {
|
|
234
|
-
this.
|
|
235
|
-
this._setModKit(handle);
|
|
236
|
-
ccmp.natives.vehicle.setVehicleMod(handle, modType, modIndex, false);
|
|
237
|
-
});
|
|
210
|
+
this._ccmpVehicle.setMod(modType, modIndex);
|
|
238
211
|
}
|
|
239
212
|
getMod(modType) {
|
|
240
|
-
return this.
|
|
213
|
+
return this._ccmpVehicle.getMod(modType);
|
|
241
214
|
}
|
|
242
215
|
getNumMods(modType) {
|
|
243
|
-
return this.
|
|
216
|
+
return this._ccmpVehicle.getNumMods(modType);
|
|
244
217
|
}
|
|
245
218
|
setNeonLightEnabled(index, toggle) {
|
|
246
|
-
this.
|
|
247
|
-
ccmp.natives.vehicle.setVehicleNeonEnabled(handle, index, toggle);
|
|
248
|
-
});
|
|
219
|
+
this._ccmpVehicle.setNeonLightEnabled(index, toggle);
|
|
249
220
|
}
|
|
250
221
|
setNeonLightsColour(color) {
|
|
251
|
-
this.
|
|
252
|
-
ccmp.natives.vehicle.setVehicleNeonColour(handle, color.r, color.g, color.b);
|
|
253
|
-
});
|
|
222
|
+
this._ccmpVehicle.setNeonLightsColour(color);
|
|
254
223
|
}
|
|
255
224
|
setWindowTint(tintType) {
|
|
256
|
-
this.
|
|
257
|
-
ccmp.natives.vehicle.setVehicleWindowTint(handle, tintType);
|
|
258
|
-
});
|
|
225
|
+
this._ccmpVehicle.setWindowTint(tintType);
|
|
259
226
|
}
|
|
260
227
|
get windowTint() {
|
|
261
|
-
return this.
|
|
228
|
+
return this._ccmpVehicle.windowTint;
|
|
262
229
|
}
|
|
263
230
|
setWheelType(wheelType) {
|
|
264
|
-
this.
|
|
265
|
-
ccmp.natives.vehicle.setVehicleWheelType(handle, wheelType);
|
|
266
|
-
});
|
|
231
|
+
this._ccmpVehicle.setWheelType(wheelType);
|
|
267
232
|
}
|
|
268
233
|
get wheelType() {
|
|
269
|
-
return this.
|
|
234
|
+
return this._ccmpVehicle.wheelType;
|
|
270
235
|
}
|
|
271
|
-
setNumberPlateTextIndex(
|
|
272
|
-
|
|
236
|
+
setNumberPlateTextIndex(index) {
|
|
237
|
+
this._ccmpVehicle.setNumberPlateTextIndex(index);
|
|
273
238
|
}
|
|
274
239
|
get numberPlateTextIndex() {
|
|
275
|
-
return
|
|
240
|
+
return this._ccmpVehicle.numberPlateTextIndex;
|
|
276
241
|
}
|
|
277
|
-
setDoorOpen(
|
|
278
|
-
|
|
242
|
+
setDoorOpen(doorIndex, loose, openInstantly) {
|
|
243
|
+
this._ccmpVehicle.setDoorOpen(doorIndex, loose, openInstantly);
|
|
279
244
|
}
|
|
280
|
-
setDoorShut(
|
|
281
|
-
|
|
245
|
+
setDoorShut(doorIndex, instantly) {
|
|
246
|
+
this._ccmpVehicle.setDoorShut(doorIndex, instantly);
|
|
282
247
|
}
|
|
283
|
-
setHandling(
|
|
284
|
-
|
|
248
|
+
setHandling(field, value) {
|
|
249
|
+
this._ccmpVehicle.setHandling(field, value);
|
|
285
250
|
}
|
|
286
|
-
getHandling(
|
|
287
|
-
return
|
|
251
|
+
getHandling(field) {
|
|
252
|
+
return this._ccmpVehicle.getHandling(field);
|
|
288
253
|
}
|
|
289
|
-
setEnginePowerMultiplier(
|
|
290
|
-
|
|
254
|
+
setEnginePowerMultiplier(value) {
|
|
255
|
+
this._ccmpVehicle.setEnginePowerMultiplier(value);
|
|
291
256
|
}
|
|
292
|
-
setEngineTorqueMultiplier(
|
|
293
|
-
|
|
257
|
+
setEngineTorqueMultiplier(value) {
|
|
258
|
+
this._ccmpVehicle.setEngineTorqueMultiplier(value);
|
|
294
259
|
}
|
|
295
|
-
modifyTopSpeed(
|
|
296
|
-
|
|
260
|
+
modifyTopSpeed(value) {
|
|
261
|
+
this._ccmpVehicle.modifyTopSpeed(value);
|
|
297
262
|
}
|
|
298
|
-
setCheatPowerIncrease(
|
|
299
|
-
|
|
263
|
+
setCheatPowerIncrease(value) {
|
|
264
|
+
this._ccmpVehicle.setCheatPowerIncrease(value);
|
|
300
265
|
}
|
|
301
266
|
toggleMod(modType, toggle) {
|
|
302
|
-
this.
|
|
303
|
-
this._setModKit(handle);
|
|
304
|
-
ccmp.natives.vehicle.toggleVehicleMod(handle, modType, toggle);
|
|
305
|
-
});
|
|
267
|
+
this._ccmpVehicle.toggleMod(modType, toggle);
|
|
306
268
|
}
|
|
307
269
|
setTyreSmokeColor(r, g, b) {
|
|
308
|
-
this.
|
|
309
|
-
ccmp.natives.vehicle.setVehicleTyreSmokeColor(handle, r, g, b);
|
|
310
|
-
});
|
|
270
|
+
this._ccmpVehicle.setTyreSmokeColor(r, g, b);
|
|
311
271
|
}
|
|
312
272
|
setModColor1(paintType, color, p3) {
|
|
313
|
-
this.
|
|
314
|
-
ccmp.natives.vehicle.setVehicleModColor1(handle, paintType, color, p3);
|
|
315
|
-
});
|
|
273
|
+
this._ccmpVehicle.setModColor1(paintType, color, p3);
|
|
316
274
|
}
|
|
317
|
-
setExtraColours(
|
|
318
|
-
|
|
275
|
+
setExtraColours(pearlescentColor, wheelColor) {
|
|
276
|
+
this._ccmpVehicle.setExtraColours(pearlescentColor, wheelColor);
|
|
319
277
|
}
|
|
320
278
|
setHeadlightColor(colorIndex) {
|
|
321
|
-
this.
|
|
322
|
-
ccmp.natives.vehicle.setVehicleXenonLightColorIndex(handle, colorIndex);
|
|
323
|
-
});
|
|
279
|
+
this._ccmpVehicle.setHeadlightColor(colorIndex);
|
|
324
280
|
}
|
|
325
281
|
setDashboardColor(colorIndex) {
|
|
326
|
-
this.
|
|
327
|
-
var _a;
|
|
328
|
-
const vehicleNatives = ccmp.natives.vehicle;
|
|
329
|
-
const setDashboardColor = (_a = vehicleNatives.setVehicleDashboardColor) !== null && _a !== void 0 ? _a : vehicleNatives.setVehicleDashboardColour;
|
|
330
|
-
if (!setDashboardColor)
|
|
331
|
-
return;
|
|
332
|
-
setDashboardColor(handle, colorIndex);
|
|
333
|
-
});
|
|
282
|
+
this._ccmpVehicle.setDashboardColor(colorIndex);
|
|
334
283
|
}
|
|
335
284
|
setInteriorColor(colorIndex) {
|
|
336
|
-
this.
|
|
337
|
-
var _a;
|
|
338
|
-
const vehicleNatives = ccmp.natives.vehicle;
|
|
339
|
-
const setInteriorColor = (_a = vehicleNatives.setVehicleInteriorColor) !== null && _a !== void 0 ? _a : vehicleNatives.setVehicleInteriorColour;
|
|
340
|
-
if (!setInteriorColor)
|
|
341
|
-
return;
|
|
342
|
-
setInteriorColor(handle, colorIndex);
|
|
343
|
-
});
|
|
285
|
+
this._ccmpVehicle.setInteriorColor(colorIndex);
|
|
344
286
|
}
|
|
345
287
|
getMaxBraking() {
|
|
346
|
-
return
|
|
288
|
+
return this._ccmpVehicle.getMaxBraking();
|
|
347
289
|
}
|
|
348
290
|
getAcceleration() {
|
|
349
|
-
return
|
|
291
|
+
return this._ccmpVehicle.getAcceleration();
|
|
350
292
|
}
|
|
351
293
|
getMaxTraction() {
|
|
352
|
-
return
|
|
294
|
+
return this._ccmpVehicle.getMaxTraction();
|
|
353
295
|
}
|
|
354
296
|
getModelMaxSpeed() {
|
|
355
|
-
return
|
|
356
|
-
}
|
|
357
|
-
_withHandle(fallback, callback) {
|
|
358
|
-
const handle = this.handle;
|
|
359
|
-
if (!handle) {
|
|
360
|
-
return fallback;
|
|
361
|
-
}
|
|
362
|
-
return callback(handle);
|
|
363
|
-
}
|
|
364
|
-
_withHandleVoid(callback) {
|
|
365
|
-
const handle = this.handle;
|
|
366
|
-
if (!handle) {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
callback(handle);
|
|
297
|
+
return this._ccmpVehicle.getModelMaxSpeed();
|
|
370
298
|
}
|
|
371
|
-
|
|
372
|
-
|
|
299
|
+
_normalizeHandle(value) {
|
|
300
|
+
const handle = Number(value);
|
|
301
|
+
return Number.isFinite(handle) && handle > 0 ? Math.trunc(handle) : 0;
|
|
373
302
|
}
|
|
374
303
|
_getRemoteVehicleExists() {
|
|
375
|
-
var _a;
|
|
376
304
|
try {
|
|
377
|
-
return
|
|
305
|
+
return this._ccmpVehicle.isExists;
|
|
378
306
|
}
|
|
379
|
-
catch (
|
|
307
|
+
catch (_a) {
|
|
380
308
|
return true;
|
|
381
309
|
}
|
|
382
310
|
}
|
|
383
|
-
_getOffsetFromCachedTransform(offsetX, offsetY, offsetZ) {
|
|
384
|
-
const position = this.position;
|
|
385
|
-
const headingRad = (this.heading * Math.PI) / 180;
|
|
386
|
-
const rightX = Math.cos(headingRad);
|
|
387
|
-
const rightY = Math.sin(headingRad);
|
|
388
|
-
const forwardX = -Math.sin(headingRad);
|
|
389
|
-
const forwardY = Math.cos(headingRad);
|
|
390
|
-
return new Vector3D(position.x + rightX * offsetX + forwardX * offsetY, position.y + rightY * offsetX + forwardY * offsetY, position.z + offsetZ);
|
|
391
|
-
}
|
|
392
311
|
}
|
|
@@ -32,7 +32,8 @@ export class CCMPVehiclesManager {
|
|
|
32
32
|
return this._register(ccmpVehicle);
|
|
33
33
|
}
|
|
34
34
|
getDisplayNameFromVehicleModel(modelHash) {
|
|
35
|
-
|
|
35
|
+
var _a, _b;
|
|
36
|
+
return (_b = (_a = this._getNativeVehiclesApi()) === null || _a === void 0 ? void 0 : _a.getDisplayNameFromModel(modelHash)) !== null && _b !== void 0 ? _b : "";
|
|
36
37
|
}
|
|
37
38
|
syncWithMpPool() {
|
|
38
39
|
this._pruneDestroyed();
|