@schmoker/rageenginebridge 0.1.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/README.md +1 -0
- package/dist/IEngine-BSo5z5Jl.d.cts +598 -0
- package/dist/IEngine-BSo5z5Jl.d.ts +598 -0
- package/dist/index.cjs +38 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/ragemp.cjs +1613 -0
- package/dist/ragemp.cjs.map +1 -0
- package/dist/ragemp.d.cts +426 -0
- package/dist/ragemp.d.ts +426 -0
- package/dist/ragemp.js +1613 -0
- package/dist/ragemp.js.map +1 -0
- package/package.json +70 -0
package/dist/ragemp.js
ADDED
|
@@ -0,0 +1,1613 @@
|
|
|
1
|
+
// src/ragemp/RageMpEntityPool.ts
|
|
2
|
+
var RageMpEntityPool = class {
|
|
3
|
+
constructor(pool, wrap) {
|
|
4
|
+
this.pool = pool;
|
|
5
|
+
this.wrap = wrap;
|
|
6
|
+
}
|
|
7
|
+
cache = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
getWrapped(raw) {
|
|
9
|
+
const key = raw;
|
|
10
|
+
let wrapped = this.cache.get(key);
|
|
11
|
+
if (!wrapped) {
|
|
12
|
+
wrapped = this.wrap(raw);
|
|
13
|
+
this.cache.set(key, wrapped);
|
|
14
|
+
}
|
|
15
|
+
return wrapped;
|
|
16
|
+
}
|
|
17
|
+
get length() {
|
|
18
|
+
return this.pool.length;
|
|
19
|
+
}
|
|
20
|
+
get size() {
|
|
21
|
+
return this.pool.length;
|
|
22
|
+
}
|
|
23
|
+
get streamed() {
|
|
24
|
+
return this.pool.streamed.map((raw) => this.getWrapped(raw));
|
|
25
|
+
}
|
|
26
|
+
at(id) {
|
|
27
|
+
const raw = this.pool.at(id);
|
|
28
|
+
return raw ? this.getWrapped(raw) : void 0;
|
|
29
|
+
}
|
|
30
|
+
atRemoteId(remoteId) {
|
|
31
|
+
const raw = this.pool.atRemoteId(remoteId);
|
|
32
|
+
return raw ? this.getWrapped(raw) : void 0;
|
|
33
|
+
}
|
|
34
|
+
atHandle(handle) {
|
|
35
|
+
const raw = this.pool.atHandle(handle);
|
|
36
|
+
return raw ? this.getWrapped(raw) : void 0;
|
|
37
|
+
}
|
|
38
|
+
exists(entity) {
|
|
39
|
+
return this.pool.exists(entity);
|
|
40
|
+
}
|
|
41
|
+
forEach(callback) {
|
|
42
|
+
this.pool.forEach((raw) => callback(this.getWrapped(raw)));
|
|
43
|
+
}
|
|
44
|
+
forEachInRange(position, range, callbackOrDimension, callback) {
|
|
45
|
+
const pos = new mp.Vector3(position.x, position.y, position.z);
|
|
46
|
+
if (typeof callbackOrDimension === "function") {
|
|
47
|
+
this.pool.forEachInRange(pos, range, (raw) => callbackOrDimension(this.getWrapped(raw)));
|
|
48
|
+
} else {
|
|
49
|
+
this.pool.forEachInRange(pos, range, callbackOrDimension, (raw) => callback(this.getWrapped(raw)));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
forEachInStreamRange(callback) {
|
|
53
|
+
this.pool.forEachInStreamRange((raw) => callback(this.getWrapped(raw)));
|
|
54
|
+
}
|
|
55
|
+
forEachInDimension(dimension, callback) {
|
|
56
|
+
this.pool.forEachInDimension(dimension, (raw) => callback(this.getWrapped(raw)));
|
|
57
|
+
}
|
|
58
|
+
getClosest(position) {
|
|
59
|
+
let closest;
|
|
60
|
+
let closestDist = Infinity;
|
|
61
|
+
this.pool.forEach((raw) => {
|
|
62
|
+
const wrapped = this.getWrapped(raw);
|
|
63
|
+
const entity = wrapped;
|
|
64
|
+
if (entity.position) {
|
|
65
|
+
const dx = entity.position.x - position.x;
|
|
66
|
+
const dy = entity.position.y - position.y;
|
|
67
|
+
const dz = entity.position.z - position.z;
|
|
68
|
+
const dist = dx * dx + dy * dy + dz * dz;
|
|
69
|
+
if (dist < closestDist) {
|
|
70
|
+
closestDist = dist;
|
|
71
|
+
closest = wrapped;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return closest;
|
|
76
|
+
}
|
|
77
|
+
toArray() {
|
|
78
|
+
return this.pool.toArray().map((raw) => this.getWrapped(raw));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var RageMpCreatablePool = class extends RageMpEntityPool {
|
|
82
|
+
constructor(pool, wrap, createFn) {
|
|
83
|
+
super(pool, wrap);
|
|
84
|
+
this.createFn = createFn;
|
|
85
|
+
}
|
|
86
|
+
create(opts) {
|
|
87
|
+
const raw = this.createFn(opts);
|
|
88
|
+
return this.getWrapped(raw);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/ragemp/RageMpEntity.ts
|
|
93
|
+
var RageMpEntity = class {
|
|
94
|
+
constructor(raw) {
|
|
95
|
+
this.raw = raw;
|
|
96
|
+
}
|
|
97
|
+
get id() {
|
|
98
|
+
return this.raw.id;
|
|
99
|
+
}
|
|
100
|
+
get remoteId() {
|
|
101
|
+
return this.raw.remoteId;
|
|
102
|
+
}
|
|
103
|
+
get type() {
|
|
104
|
+
return this.raw.type;
|
|
105
|
+
}
|
|
106
|
+
get handle() {
|
|
107
|
+
return this.raw.handle;
|
|
108
|
+
}
|
|
109
|
+
get alpha() {
|
|
110
|
+
return this.raw.alpha;
|
|
111
|
+
}
|
|
112
|
+
set alpha(value) {
|
|
113
|
+
this.raw.alpha = value;
|
|
114
|
+
}
|
|
115
|
+
get data() {
|
|
116
|
+
return this.raw.data;
|
|
117
|
+
}
|
|
118
|
+
set data(value) {
|
|
119
|
+
this.raw.data = value;
|
|
120
|
+
}
|
|
121
|
+
get dimension() {
|
|
122
|
+
return this.raw.dimension;
|
|
123
|
+
}
|
|
124
|
+
set dimension(value) {
|
|
125
|
+
this.raw.dimension = value;
|
|
126
|
+
}
|
|
127
|
+
get model() {
|
|
128
|
+
return this.raw.model;
|
|
129
|
+
}
|
|
130
|
+
set model(value) {
|
|
131
|
+
this.raw.model = value;
|
|
132
|
+
}
|
|
133
|
+
get position() {
|
|
134
|
+
const p = this.raw.position;
|
|
135
|
+
return { x: p.x, y: p.y, z: p.z };
|
|
136
|
+
}
|
|
137
|
+
set position(value) {
|
|
138
|
+
this.raw.position = new mp.Vector3(value.x, value.y, value.z);
|
|
139
|
+
}
|
|
140
|
+
get rotation() {
|
|
141
|
+
const r = this.raw.rotation;
|
|
142
|
+
return { x: r.x, y: r.y, z: r.z };
|
|
143
|
+
}
|
|
144
|
+
set rotation(value) {
|
|
145
|
+
this.raw.rotation = new mp.Vector3(value.x, value.y, value.z);
|
|
146
|
+
}
|
|
147
|
+
destroy() {
|
|
148
|
+
this.raw.destroy();
|
|
149
|
+
}
|
|
150
|
+
doesExist() {
|
|
151
|
+
return this.raw.doesExist();
|
|
152
|
+
}
|
|
153
|
+
dist(position) {
|
|
154
|
+
return this.raw.dist(new mp.Vector3(position.x, position.y, position.z));
|
|
155
|
+
}
|
|
156
|
+
distSquared(position) {
|
|
157
|
+
const p = this.position;
|
|
158
|
+
const dx = p.x - position.x;
|
|
159
|
+
const dy = p.y - position.y;
|
|
160
|
+
const dz = p.z - position.z;
|
|
161
|
+
return dx * dx + dy * dy + dz * dz;
|
|
162
|
+
}
|
|
163
|
+
getVariable(name) {
|
|
164
|
+
return this.raw.getVariable(name);
|
|
165
|
+
}
|
|
166
|
+
hasVariable(name) {
|
|
167
|
+
return this.raw.hasVariable(name);
|
|
168
|
+
}
|
|
169
|
+
setCoords(x, y, z) {
|
|
170
|
+
mp.game.entity.setCoords(this.raw.handle, x, y, z, false, false, false, false);
|
|
171
|
+
}
|
|
172
|
+
setRotation(x, y, z) {
|
|
173
|
+
mp.game.entity.setRotation(this.raw.handle, x, y, z, 2, true);
|
|
174
|
+
}
|
|
175
|
+
freezePosition(toggle) {
|
|
176
|
+
mp.game.entity.freezePosition(this.raw.handle, toggle);
|
|
177
|
+
}
|
|
178
|
+
setVelocity(x, y, z) {
|
|
179
|
+
mp.game.entity.setVelocity(this.raw.handle, x, y, z);
|
|
180
|
+
}
|
|
181
|
+
getVelocity() {
|
|
182
|
+
const v = mp.game.entity.getVelocity(this.raw.handle);
|
|
183
|
+
return { x: v.x, y: v.y, z: v.z };
|
|
184
|
+
}
|
|
185
|
+
setAlpha(alpha) {
|
|
186
|
+
mp.game.entity.setAlpha(this.raw.handle, alpha, false);
|
|
187
|
+
}
|
|
188
|
+
setVisible(visible) {
|
|
189
|
+
mp.game.entity.setVisible(this.raw.handle, visible, false);
|
|
190
|
+
}
|
|
191
|
+
setCollision(toggle) {
|
|
192
|
+
mp.game.entity.setCollision(this.raw.handle, toggle, true);
|
|
193
|
+
}
|
|
194
|
+
setInvincible(toggle) {
|
|
195
|
+
mp.game.entity.setInvincible(this.raw.handle, toggle);
|
|
196
|
+
}
|
|
197
|
+
getHealth() {
|
|
198
|
+
return mp.game.entity.getHealth(this.raw.handle);
|
|
199
|
+
}
|
|
200
|
+
setHealth(health) {
|
|
201
|
+
mp.game.entity.setHealth(this.raw.handle, health, 0);
|
|
202
|
+
}
|
|
203
|
+
getMaxHealth() {
|
|
204
|
+
return mp.game.entity.getMaxHealth(this.raw.handle);
|
|
205
|
+
}
|
|
206
|
+
setMaxHealth(health) {
|
|
207
|
+
mp.game.entity.setMaxHealth(this.raw.handle, health);
|
|
208
|
+
}
|
|
209
|
+
getSpeed() {
|
|
210
|
+
return mp.game.entity.getSpeed(this.raw.handle);
|
|
211
|
+
}
|
|
212
|
+
getForwardVector() {
|
|
213
|
+
const v = mp.game.entity.getForwardVector(this.raw.handle);
|
|
214
|
+
return { x: v.x, y: v.y, z: v.z };
|
|
215
|
+
}
|
|
216
|
+
getHeading() {
|
|
217
|
+
return mp.game.entity.getHeading(this.raw.handle);
|
|
218
|
+
}
|
|
219
|
+
setHeading(heading) {
|
|
220
|
+
mp.game.entity.setHeading(this.raw.handle, heading);
|
|
221
|
+
}
|
|
222
|
+
isOnScreen() {
|
|
223
|
+
return mp.game.entity.isOnScreen(this.raw.handle);
|
|
224
|
+
}
|
|
225
|
+
isDead() {
|
|
226
|
+
return mp.game.entity.isDead(this.raw.handle, false);
|
|
227
|
+
}
|
|
228
|
+
isInWater() {
|
|
229
|
+
return mp.game.entity.isInWater(this.raw.handle);
|
|
230
|
+
}
|
|
231
|
+
isInAir() {
|
|
232
|
+
return mp.game.entity.isInAir(this.raw.handle);
|
|
233
|
+
}
|
|
234
|
+
isVisible() {
|
|
235
|
+
return mp.game.entity.isVisible(this.raw.handle);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// src/ragemp/RageMpPlayer.ts
|
|
240
|
+
var RageMpPlayer = class extends RageMpEntity {
|
|
241
|
+
get armour() {
|
|
242
|
+
return this.raw.armour;
|
|
243
|
+
}
|
|
244
|
+
get eyeColour() {
|
|
245
|
+
return this.raw.eyeColour;
|
|
246
|
+
}
|
|
247
|
+
get hairColour() {
|
|
248
|
+
return this.raw.hairColour;
|
|
249
|
+
}
|
|
250
|
+
get hairHighlightColour() {
|
|
251
|
+
return this.raw.hairHighlightColour;
|
|
252
|
+
}
|
|
253
|
+
get heading() {
|
|
254
|
+
return this.raw.heading;
|
|
255
|
+
}
|
|
256
|
+
get health() {
|
|
257
|
+
return this.raw.health;
|
|
258
|
+
}
|
|
259
|
+
get name() {
|
|
260
|
+
return this.raw.name;
|
|
261
|
+
}
|
|
262
|
+
get weapon() {
|
|
263
|
+
return this.raw.weapon;
|
|
264
|
+
}
|
|
265
|
+
get weaponAmmo() {
|
|
266
|
+
return this.raw.weaponAmmo;
|
|
267
|
+
}
|
|
268
|
+
get action() {
|
|
269
|
+
return this.raw.action;
|
|
270
|
+
}
|
|
271
|
+
get aimTarget() {
|
|
272
|
+
return this.raw.aimTarget;
|
|
273
|
+
}
|
|
274
|
+
get ip() {
|
|
275
|
+
return this.raw.ip;
|
|
276
|
+
}
|
|
277
|
+
get isTypingInTextChat() {
|
|
278
|
+
return this.raw.isTypingInTextChat;
|
|
279
|
+
}
|
|
280
|
+
get isVoiceActive() {
|
|
281
|
+
return this.raw.isVoiceActive;
|
|
282
|
+
}
|
|
283
|
+
get ping() {
|
|
284
|
+
return this.raw.ping;
|
|
285
|
+
}
|
|
286
|
+
get vehicle() {
|
|
287
|
+
return this.raw.vehicle?.handle ?? null;
|
|
288
|
+
}
|
|
289
|
+
setComponentVariation(component, drawable, texture, palette) {
|
|
290
|
+
mp.game.ped.setComponentVariation(this.raw.handle, component, drawable, texture, palette);
|
|
291
|
+
}
|
|
292
|
+
setHeadBlendData(shapeFirst, shapeSecond, shapeThird, skinFirst, skinSecond, skinThird, shapeMix, skinMix, thirdMix) {
|
|
293
|
+
mp.game.ped.setHeadBlendData(this.raw.handle, shapeFirst, shapeSecond, shapeThird, skinFirst, skinSecond, skinThird, shapeMix, skinMix, thirdMix, false);
|
|
294
|
+
}
|
|
295
|
+
setHeadOverlay(overlayId, index, opacity, firstColor, secondColor) {
|
|
296
|
+
mp.game.ped.setHeadOverlay(this.raw.handle, overlayId, index, opacity);
|
|
297
|
+
if (firstColor !== void 0 && secondColor !== void 0) {
|
|
298
|
+
mp.game.ped.setHeadOverlayTint(this.raw.handle, overlayId, 1, firstColor, secondColor);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
setHairColor(color, highlight) {
|
|
302
|
+
mp.game.ped.setHairTint(this.raw.handle, color, highlight);
|
|
303
|
+
}
|
|
304
|
+
setEyeColor(color) {
|
|
305
|
+
mp.game.ped.setEyeColor(this.raw.handle, color);
|
|
306
|
+
}
|
|
307
|
+
setFaceFeature(index, scale) {
|
|
308
|
+
mp.game.ped.setFaceFeature(this.raw.handle, index, scale);
|
|
309
|
+
}
|
|
310
|
+
setPropIndex(propId, drawableId, textureId, attach) {
|
|
311
|
+
mp.game.ped.setPropIndex(this.raw.handle, propId, drawableId, textureId, attach);
|
|
312
|
+
}
|
|
313
|
+
clearProp(propId) {
|
|
314
|
+
mp.game.ped.clearProp(this.raw.handle, propId);
|
|
315
|
+
}
|
|
316
|
+
getDrawableVariation(component) {
|
|
317
|
+
return mp.game.ped.getDrawableVariation(this.raw.handle, component);
|
|
318
|
+
}
|
|
319
|
+
getTextureVariation(component) {
|
|
320
|
+
return mp.game.ped.getTextureVariation(this.raw.handle, component);
|
|
321
|
+
}
|
|
322
|
+
getPropIndex(propId) {
|
|
323
|
+
return mp.game.ped.getPropIndex(this.raw.handle, propId);
|
|
324
|
+
}
|
|
325
|
+
getPropTextureIndex(propId) {
|
|
326
|
+
return mp.game.ped.getPropTextureIndex(this.raw.handle, propId);
|
|
327
|
+
}
|
|
328
|
+
getBonePosition(boneId) {
|
|
329
|
+
const p = mp.game.ped.getBoneCoords(this.raw.handle, boneId, 0, 0, 0);
|
|
330
|
+
return { x: p.x, y: p.y, z: p.z };
|
|
331
|
+
}
|
|
332
|
+
getWorldPositionOfBone(boneIndex) {
|
|
333
|
+
const p = mp.game.entity.getWorldPositionOfBone(this.raw.handle, boneIndex);
|
|
334
|
+
return { x: p.x, y: p.y, z: p.z };
|
|
335
|
+
}
|
|
336
|
+
getBoneIndex(boneName) {
|
|
337
|
+
return mp.game.ped.getBoneIndex(this.raw.handle, boneName);
|
|
338
|
+
}
|
|
339
|
+
giveWeapon(hash, ammo) {
|
|
340
|
+
mp.game.weapon.giveWeaponToPed(this.raw.handle, hash, ammo, false, true);
|
|
341
|
+
}
|
|
342
|
+
removeAllWeapons() {
|
|
343
|
+
mp.game.weapon.removeAllPedS(this.raw.handle, true);
|
|
344
|
+
}
|
|
345
|
+
getAmmoInClip(weapon) {
|
|
346
|
+
return mp.game.weapon.getAmmoInClip(this.raw.handle, weapon);
|
|
347
|
+
}
|
|
348
|
+
setAmmoInClip(weapon, ammo) {
|
|
349
|
+
mp.game.weapon.setAmmoInClip(this.raw.handle, weapon, ammo);
|
|
350
|
+
}
|
|
351
|
+
getWeaponTintIndex(weapon) {
|
|
352
|
+
return mp.game.weapon.getPedTintIndex(this.raw.handle, weapon);
|
|
353
|
+
}
|
|
354
|
+
isJumping() {
|
|
355
|
+
return mp.game.ped.isJumping(this.raw.handle);
|
|
356
|
+
}
|
|
357
|
+
isFalling() {
|
|
358
|
+
return mp.game.ped.isFalling(this.raw.handle);
|
|
359
|
+
}
|
|
360
|
+
isShooting() {
|
|
361
|
+
return mp.game.ped.isShooting(this.raw.handle);
|
|
362
|
+
}
|
|
363
|
+
isReloading() {
|
|
364
|
+
return mp.game.ped.isReloading(this.raw.handle);
|
|
365
|
+
}
|
|
366
|
+
isSprinting() {
|
|
367
|
+
return mp.game.ped.isSprinting(this.raw.handle);
|
|
368
|
+
}
|
|
369
|
+
isSwimming() {
|
|
370
|
+
return mp.game.ped.isSwimming(this.raw.handle);
|
|
371
|
+
}
|
|
372
|
+
isSwimmingUnderWater() {
|
|
373
|
+
return mp.game.ped.isSwimmingUnderWater(this.raw.handle);
|
|
374
|
+
}
|
|
375
|
+
isClimbing() {
|
|
376
|
+
return mp.game.ped.isClimbing(this.raw.handle);
|
|
377
|
+
}
|
|
378
|
+
isGettingIntoVehicle() {
|
|
379
|
+
return mp.game.ped.isGettingIntoAVehicle(this.raw.handle);
|
|
380
|
+
}
|
|
381
|
+
isDiving() {
|
|
382
|
+
return mp.game.ped.isDiving(this.raw.handle);
|
|
383
|
+
}
|
|
384
|
+
isParachuting() {
|
|
385
|
+
return mp.game.ped.isParachuting(this.raw.handle);
|
|
386
|
+
}
|
|
387
|
+
isInAnyVehicle() {
|
|
388
|
+
return mp.game.ped.isInAnyVehicle(this.raw.handle, false);
|
|
389
|
+
}
|
|
390
|
+
isSittingInVehicle(vehicle) {
|
|
391
|
+
return mp.game.ped.isSittingInVehicle(this.raw.handle, vehicle);
|
|
392
|
+
}
|
|
393
|
+
setIntoVehicle(vehicle, seat) {
|
|
394
|
+
mp.game.ped.setIntoVehicle(this.raw.handle, vehicle, seat);
|
|
395
|
+
}
|
|
396
|
+
setArmour(armour) {
|
|
397
|
+
mp.game.ped.setArmour(this.raw.handle, armour);
|
|
398
|
+
}
|
|
399
|
+
getArmour() {
|
|
400
|
+
return mp.game.ped.getArmour(this.raw.handle);
|
|
401
|
+
}
|
|
402
|
+
taskPlayAnim(dict, name, blendInSpeed, blendOutSpeed, duration, flag, playbackRate, lockX, lockY, lockZ) {
|
|
403
|
+
mp.game.task.playAnim(this.raw.handle, dict, name, blendInSpeed, blendOutSpeed, duration, flag, playbackRate, lockX, lockY, lockZ);
|
|
404
|
+
}
|
|
405
|
+
clearTasks() {
|
|
406
|
+
mp.game.task.clearTasks(this.raw.handle);
|
|
407
|
+
}
|
|
408
|
+
clearTasksImmediately() {
|
|
409
|
+
mp.game.task.clearPedTasksImmediately(this.raw.handle);
|
|
410
|
+
}
|
|
411
|
+
canRagdoll() {
|
|
412
|
+
return mp.game.ped.canRagdoll(this.raw.handle);
|
|
413
|
+
}
|
|
414
|
+
setCanRagdoll(toggle) {
|
|
415
|
+
mp.game.ped.setCanRagdoll(this.raw.handle, toggle);
|
|
416
|
+
}
|
|
417
|
+
setRagdollOnCollision(toggle) {
|
|
418
|
+
mp.game.ped.setRagdollOnCollision(this.raw.handle, toggle);
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
// src/ragemp/RageMpVehicle.ts
|
|
423
|
+
var RageMpVehicle = class extends RageMpEntity {
|
|
424
|
+
get gear() {
|
|
425
|
+
return this.raw.gear;
|
|
426
|
+
}
|
|
427
|
+
get rpm() {
|
|
428
|
+
return this.raw.rpm;
|
|
429
|
+
}
|
|
430
|
+
get steeringAngle() {
|
|
431
|
+
return this.raw.steeringAngle;
|
|
432
|
+
}
|
|
433
|
+
get isPositionFrozen() {
|
|
434
|
+
return this.raw.isPositionFrozen;
|
|
435
|
+
}
|
|
436
|
+
set isPositionFrozen(value) {
|
|
437
|
+
this.raw.isPositionFrozen = value;
|
|
438
|
+
}
|
|
439
|
+
get gravity() {
|
|
440
|
+
return this.raw.gravity;
|
|
441
|
+
}
|
|
442
|
+
set gravity(value) {
|
|
443
|
+
this.raw.gravity = value;
|
|
444
|
+
}
|
|
445
|
+
setEngineOn(toggle, instantly, noAutoTurnOn) {
|
|
446
|
+
mp.game.vehicle.setEngineOn(this.raw.handle, toggle, instantly, noAutoTurnOn);
|
|
447
|
+
}
|
|
448
|
+
isEngineRunning() {
|
|
449
|
+
return mp.game.vehicle.getIsEngineRunning(this.raw.handle);
|
|
450
|
+
}
|
|
451
|
+
getEngineHealth() {
|
|
452
|
+
return mp.game.vehicle.getEngineHealth(this.raw.handle);
|
|
453
|
+
}
|
|
454
|
+
setEngineHealth(health) {
|
|
455
|
+
mp.game.vehicle.setEngineHealth(this.raw.handle, health);
|
|
456
|
+
}
|
|
457
|
+
setEnginePowerMultiplier(multiplier) {
|
|
458
|
+
mp.game.vehicle.setEnginePowerMultiplier(this.raw.handle, multiplier);
|
|
459
|
+
}
|
|
460
|
+
setEngineTorqueMultiplier(multiplier) {
|
|
461
|
+
mp.game.vehicle.setEngineTorqueMultiplier(this.raw.handle, multiplier);
|
|
462
|
+
}
|
|
463
|
+
getBodyHealth() {
|
|
464
|
+
return mp.game.vehicle.getBodyHealth(this.raw.handle);
|
|
465
|
+
}
|
|
466
|
+
setBodyHealth(health) {
|
|
467
|
+
mp.game.vehicle.setBodyHealth(this.raw.handle, health);
|
|
468
|
+
}
|
|
469
|
+
getPetrolTankHealth() {
|
|
470
|
+
return mp.game.vehicle.getPetrolTankHealth(this.raw.handle);
|
|
471
|
+
}
|
|
472
|
+
setPetrolTankHealth(health) {
|
|
473
|
+
mp.game.vehicle.setPetrolTankHealth(this.raw.handle, health);
|
|
474
|
+
}
|
|
475
|
+
setDirtLevel(level) {
|
|
476
|
+
mp.game.vehicle.setDirtLevel(this.raw.handle, level);
|
|
477
|
+
}
|
|
478
|
+
setCustomPrimaryColour(r, g, b) {
|
|
479
|
+
mp.game.vehicle.setCustomPrimaryColour(this.raw.handle, r, g, b);
|
|
480
|
+
}
|
|
481
|
+
setCustomSecondaryColour(r, g, b) {
|
|
482
|
+
mp.game.vehicle.setCustomSecondaryColour(this.raw.handle, r, g, b);
|
|
483
|
+
}
|
|
484
|
+
getCustomPrimaryColour() {
|
|
485
|
+
const c = mp.game.vehicle.getCustomPrimaryColour(this.raw.handle);
|
|
486
|
+
return { r: c.r ?? c[0], g: c.g ?? c[1], b: c.b ?? c[2] };
|
|
487
|
+
}
|
|
488
|
+
getCustomSecondaryColour() {
|
|
489
|
+
const c = mp.game.vehicle.getCustomSecondaryColour(this.raw.handle);
|
|
490
|
+
return { r: c.r ?? c[0], g: c.g ?? c[1], b: c.b ?? c[2] };
|
|
491
|
+
}
|
|
492
|
+
setColours(primary, secondary) {
|
|
493
|
+
mp.game.vehicle.setColours(this.raw.handle, primary, secondary);
|
|
494
|
+
}
|
|
495
|
+
setNeonLightEnabled(index, toggle) {
|
|
496
|
+
mp.game.vehicle.setNeonLightEnabled(this.raw.handle, index, toggle);
|
|
497
|
+
}
|
|
498
|
+
isNeonLightEnabled(index) {
|
|
499
|
+
return mp.game.vehicle.isNeonLightEnabled(this.raw.handle, index);
|
|
500
|
+
}
|
|
501
|
+
setNeonLightsColour(r, g, b) {
|
|
502
|
+
mp.game.vehicle.setNeonLightsColour(this.raw.handle, r, g, b);
|
|
503
|
+
}
|
|
504
|
+
getNeonLightsColour() {
|
|
505
|
+
const c = mp.game.vehicle.getNeonLightsColour(this.raw.handle);
|
|
506
|
+
return { r: c.r ?? c[0], g: c.g ?? c[1], b: c.b ?? c[2] };
|
|
507
|
+
}
|
|
508
|
+
setMod(modType, modIndex) {
|
|
509
|
+
mp.game.vehicle.setMod(this.raw.handle, modType, modIndex, false);
|
|
510
|
+
}
|
|
511
|
+
getMod(modType) {
|
|
512
|
+
return mp.game.vehicle.getMod(this.raw.handle, modType);
|
|
513
|
+
}
|
|
514
|
+
setModKit(modKit) {
|
|
515
|
+
mp.game.vehicle.setModKit(this.raw.handle, modKit);
|
|
516
|
+
}
|
|
517
|
+
getModKit() {
|
|
518
|
+
return mp.game.vehicle.getModKit(this.raw.handle);
|
|
519
|
+
}
|
|
520
|
+
getNumMods(modType) {
|
|
521
|
+
return mp.game.vehicle.getNumMods(this.raw.handle, modType);
|
|
522
|
+
}
|
|
523
|
+
setWindowTint(tint) {
|
|
524
|
+
mp.game.vehicle.setWindowTint(this.raw.handle, tint);
|
|
525
|
+
}
|
|
526
|
+
getWindowTint() {
|
|
527
|
+
return mp.game.vehicle.getWindowTint(this.raw.handle);
|
|
528
|
+
}
|
|
529
|
+
setNumberPlateText(text) {
|
|
530
|
+
mp.game.vehicle.setNumberPlateText(this.raw.handle, text);
|
|
531
|
+
}
|
|
532
|
+
getNumberPlateText() {
|
|
533
|
+
return mp.game.vehicle.getNumberPlateText(this.raw.handle);
|
|
534
|
+
}
|
|
535
|
+
setNumberPlateTextIndex(index) {
|
|
536
|
+
mp.game.vehicle.setNumberPlateTextIndex(this.raw.handle, index);
|
|
537
|
+
}
|
|
538
|
+
getNumberPlateTextIndex() {
|
|
539
|
+
return mp.game.vehicle.getNumberPlateTextIndex(this.raw.handle);
|
|
540
|
+
}
|
|
541
|
+
setTyreBurst(index, onRim, p2) {
|
|
542
|
+
mp.game.vehicle.setTyreBurst(this.raw.handle, index, onRim, p2);
|
|
543
|
+
}
|
|
544
|
+
isTyreBurst(wheelId) {
|
|
545
|
+
return mp.game.vehicle.isTyreBurst(this.raw.handle, wheelId, false);
|
|
546
|
+
}
|
|
547
|
+
setTyresCanBurst(toggle) {
|
|
548
|
+
mp.game.vehicle.setTyresCanBurst(this.raw.handle, toggle);
|
|
549
|
+
}
|
|
550
|
+
getTyresCanBurst() {
|
|
551
|
+
return mp.game.vehicle.getTyresCanBurst(this.raw.handle);
|
|
552
|
+
}
|
|
553
|
+
setTyreFixed(index) {
|
|
554
|
+
mp.game.vehicle.setTyreFixed(this.raw.handle, index);
|
|
555
|
+
}
|
|
556
|
+
setDoorOpen(doorIndex, loose, openInstantly) {
|
|
557
|
+
mp.game.vehicle.setDoorOpen(this.raw.handle, doorIndex, loose, openInstantly);
|
|
558
|
+
}
|
|
559
|
+
setDoorShut(doorIndex, closeInstantly) {
|
|
560
|
+
mp.game.vehicle.setDoorShut(this.raw.handle, doorIndex, closeInstantly);
|
|
561
|
+
}
|
|
562
|
+
setDoorBroken(doorIndex, deleteDoor) {
|
|
563
|
+
mp.game.vehicle.setDoorBroken(this.raw.handle, doorIndex, deleteDoor);
|
|
564
|
+
}
|
|
565
|
+
isDoorDamaged(doorIndex) {
|
|
566
|
+
return mp.game.vehicle.isDoorDamaged(this.raw.handle, doorIndex);
|
|
567
|
+
}
|
|
568
|
+
isDoorFullyOpen(doorIndex) {
|
|
569
|
+
return mp.game.vehicle.isDoorFullyOpen(this.raw.handle, doorIndex);
|
|
570
|
+
}
|
|
571
|
+
getDoorAngleRatio(doorIndex) {
|
|
572
|
+
return mp.game.vehicle.getDoorAngleRatio(this.raw.handle, doorIndex);
|
|
573
|
+
}
|
|
574
|
+
setLight(lightIndex, toggle) {
|
|
575
|
+
mp.game.vehicle.setLights(this.raw.handle, lightIndex);
|
|
576
|
+
}
|
|
577
|
+
setLights(toggle) {
|
|
578
|
+
mp.game.vehicle.setLights(this.raw.handle, toggle ? 2 : 1);
|
|
579
|
+
}
|
|
580
|
+
getLightsState() {
|
|
581
|
+
return mp.game.vehicle.getLightsState(this.raw.handle);
|
|
582
|
+
}
|
|
583
|
+
setXenonHeadlights(toggle) {
|
|
584
|
+
mp.game.vehicle.toggleMod(this.raw.handle, 22, toggle);
|
|
585
|
+
}
|
|
586
|
+
isXenonHeadlightsEnabled() {
|
|
587
|
+
return mp.game.vehicle.isToggleModOn(this.raw.handle, 22);
|
|
588
|
+
}
|
|
589
|
+
setExtra(extraId, toggle) {
|
|
590
|
+
mp.game.vehicle.setExtra(this.raw.handle, extraId, toggle ? 0 : 1);
|
|
591
|
+
}
|
|
592
|
+
doesExtraExist(extraId) {
|
|
593
|
+
return mp.game.vehicle.doesExtraExist(this.raw.handle, extraId);
|
|
594
|
+
}
|
|
595
|
+
isExtraTurnedOn(extraId) {
|
|
596
|
+
return mp.game.vehicle.isExtraTurnedOn(this.raw.handle, extraId);
|
|
597
|
+
}
|
|
598
|
+
isSeatFree(seatIndex) {
|
|
599
|
+
return mp.game.vehicle.isSeatFree(this.raw.handle, seatIndex, false);
|
|
600
|
+
}
|
|
601
|
+
getPedInSeat(seatIndex) {
|
|
602
|
+
return mp.game.vehicle.getPedInSeat(this.raw.handle, seatIndex, false);
|
|
603
|
+
}
|
|
604
|
+
getMaxNumberOfPassengers() {
|
|
605
|
+
return mp.game.vehicle.getMaxNumberOfPassengers(this.raw.handle);
|
|
606
|
+
}
|
|
607
|
+
setFixed() {
|
|
608
|
+
mp.game.vehicle.setFixed(this.raw.handle);
|
|
609
|
+
}
|
|
610
|
+
setUndriveable(toggle) {
|
|
611
|
+
mp.game.vehicle.setUndriveable(this.raw.handle, toggle);
|
|
612
|
+
}
|
|
613
|
+
setCanBeDamaged(toggle) {
|
|
614
|
+
mp.game.vehicle.setCanBeDamaged(this.raw.handle, toggle);
|
|
615
|
+
}
|
|
616
|
+
setCanBeVisiblyDamaged(toggle) {
|
|
617
|
+
mp.game.vehicle.setCanBeVisiblyDamaged(this.raw.handle, toggle);
|
|
618
|
+
}
|
|
619
|
+
getWheelType() {
|
|
620
|
+
return mp.game.vehicle.getWheelType(this.raw.handle);
|
|
621
|
+
}
|
|
622
|
+
setWheelType(type) {
|
|
623
|
+
mp.game.vehicle.setWheelType(this.raw.handle, type);
|
|
624
|
+
}
|
|
625
|
+
setLivery(livery) {
|
|
626
|
+
mp.game.vehicle.setLivery(this.raw.handle, livery);
|
|
627
|
+
}
|
|
628
|
+
getLivery() {
|
|
629
|
+
return mp.game.vehicle.getLivery(this.raw.handle);
|
|
630
|
+
}
|
|
631
|
+
getLiveryCount() {
|
|
632
|
+
return mp.game.vehicle.getLiveryCount(this.raw.handle);
|
|
633
|
+
}
|
|
634
|
+
setRoofOpened(toggle) {
|
|
635
|
+
if (toggle) {
|
|
636
|
+
mp.game.vehicle.openRoof(this.raw.handle);
|
|
637
|
+
} else {
|
|
638
|
+
mp.game.vehicle.closeRoof(this.raw.handle);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
isRoofOpened() {
|
|
642
|
+
return mp.game.vehicle.isRoofOpened(this.raw.handle);
|
|
643
|
+
}
|
|
644
|
+
setHandling(field, value) {
|
|
645
|
+
this.raw.setHandling(field, value);
|
|
646
|
+
}
|
|
647
|
+
getHandling(field) {
|
|
648
|
+
return this.raw.getHandling(field);
|
|
649
|
+
}
|
|
650
|
+
resetHandling() {
|
|
651
|
+
this.raw.resetHandling();
|
|
652
|
+
}
|
|
653
|
+
setSuspensionHeight(height) {
|
|
654
|
+
mp.game.vehicle.setSuspensionHeight(this.raw.handle, height);
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
// src/ragemp/RageMpPed.ts
|
|
659
|
+
var RageMpPed = class extends RageMpEntity {
|
|
660
|
+
get isDynamic() {
|
|
661
|
+
return this.raw.isDynamic;
|
|
662
|
+
}
|
|
663
|
+
get spawnPosition() {
|
|
664
|
+
const p = this.raw.spawnPosition;
|
|
665
|
+
return { x: p.x, y: p.y, z: p.z };
|
|
666
|
+
}
|
|
667
|
+
get weapon() {
|
|
668
|
+
return this.raw.weapon;
|
|
669
|
+
}
|
|
670
|
+
get weaponAmmo() {
|
|
671
|
+
return this.raw.weaponAmmo;
|
|
672
|
+
}
|
|
673
|
+
setComponentVariation(component, drawable, texture, palette) {
|
|
674
|
+
mp.game.ped.setComponentVariation(this.raw.handle, component, drawable, texture, palette);
|
|
675
|
+
}
|
|
676
|
+
setHeadBlendData(shapeFirst, shapeSecond, shapeThird, skinFirst, skinSecond, skinThird, shapeMix, skinMix, thirdMix) {
|
|
677
|
+
mp.game.ped.setHeadBlendData(this.raw.handle, shapeFirst, shapeSecond, shapeThird, skinFirst, skinSecond, skinThird, shapeMix, skinMix, thirdMix, false);
|
|
678
|
+
}
|
|
679
|
+
setHeadOverlay(overlayId, index, opacity, firstColor, secondColor) {
|
|
680
|
+
mp.game.ped.setHeadOverlay(this.raw.handle, overlayId, index, opacity);
|
|
681
|
+
if (firstColor !== void 0 && secondColor !== void 0) {
|
|
682
|
+
mp.game.ped.setHeadOverlayTint(this.raw.handle, overlayId, 1, firstColor, secondColor);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
setHairColor(color, highlight) {
|
|
686
|
+
mp.game.ped.setHairTint(this.raw.handle, color, highlight);
|
|
687
|
+
}
|
|
688
|
+
setEyeColor(color) {
|
|
689
|
+
mp.game.ped.setEyeColor(this.raw.handle, color);
|
|
690
|
+
}
|
|
691
|
+
setFaceFeature(index, scale) {
|
|
692
|
+
mp.game.ped.setFaceFeature(this.raw.handle, index, scale);
|
|
693
|
+
}
|
|
694
|
+
setPropIndex(propId, drawableId, textureId, attach) {
|
|
695
|
+
mp.game.ped.setPropIndex(this.raw.handle, propId, drawableId, textureId, attach);
|
|
696
|
+
}
|
|
697
|
+
clearProp(propId) {
|
|
698
|
+
mp.game.ped.clearProp(this.raw.handle, propId);
|
|
699
|
+
}
|
|
700
|
+
getDrawableVariation(component) {
|
|
701
|
+
return mp.game.ped.getDrawableVariation(this.raw.handle, component);
|
|
702
|
+
}
|
|
703
|
+
getTextureVariation(component) {
|
|
704
|
+
return mp.game.ped.getTextureVariation(this.raw.handle, component);
|
|
705
|
+
}
|
|
706
|
+
getPropIndex(propId) {
|
|
707
|
+
return mp.game.ped.getPropIndex(this.raw.handle, propId);
|
|
708
|
+
}
|
|
709
|
+
getPropTextureIndex(propId) {
|
|
710
|
+
return mp.game.ped.getPropTextureIndex(this.raw.handle, propId);
|
|
711
|
+
}
|
|
712
|
+
getBonePosition(boneId) {
|
|
713
|
+
const p = mp.game.ped.getBoneCoords(this.raw.handle, boneId, 0, 0, 0);
|
|
714
|
+
return { x: p.x, y: p.y, z: p.z };
|
|
715
|
+
}
|
|
716
|
+
getWorldPositionOfBone(boneIndex) {
|
|
717
|
+
const p = mp.game.entity.getWorldPositionOfBone(this.raw.handle, boneIndex);
|
|
718
|
+
return { x: p.x, y: p.y, z: p.z };
|
|
719
|
+
}
|
|
720
|
+
getBoneIndex(boneName) {
|
|
721
|
+
return mp.game.ped.getBoneIndex(this.raw.handle, boneName);
|
|
722
|
+
}
|
|
723
|
+
giveWeapon(hash, ammo) {
|
|
724
|
+
mp.game.weapon.giveWeaponToPed(this.raw.handle, hash, ammo, false, true);
|
|
725
|
+
}
|
|
726
|
+
removeAllWeapons() {
|
|
727
|
+
mp.game.weapon.removeAllPedS(this.raw.handle, true);
|
|
728
|
+
}
|
|
729
|
+
getAmmoInClip(weapon) {
|
|
730
|
+
return mp.game.weapon.getAmmoInClip(this.raw.handle, weapon);
|
|
731
|
+
}
|
|
732
|
+
setAmmoInClip(weapon, ammo) {
|
|
733
|
+
mp.game.weapon.setAmmoInClip(this.raw.handle, weapon, ammo);
|
|
734
|
+
}
|
|
735
|
+
taskPlayAnim(dict, name, blendInSpeed, blendOutSpeed, duration, flag, playbackRate, lockX, lockY, lockZ) {
|
|
736
|
+
mp.game.task.playAnim(this.raw.handle, dict, name, blendInSpeed, blendOutSpeed, duration, flag, playbackRate, lockX, lockY, lockZ);
|
|
737
|
+
}
|
|
738
|
+
clearTasks() {
|
|
739
|
+
mp.game.task.clearTasks(this.raw.handle);
|
|
740
|
+
}
|
|
741
|
+
clearTasksImmediately() {
|
|
742
|
+
mp.game.task.clearPedTasksImmediately(this.raw.handle);
|
|
743
|
+
}
|
|
744
|
+
canRagdoll() {
|
|
745
|
+
return mp.game.ped.canRagdoll(this.raw.handle);
|
|
746
|
+
}
|
|
747
|
+
setCanRagdoll(toggle) {
|
|
748
|
+
mp.game.ped.setCanRagdoll(this.raw.handle, toggle);
|
|
749
|
+
}
|
|
750
|
+
setRagdollOnCollision(toggle) {
|
|
751
|
+
mp.game.ped.setRagdollOnCollision(this.raw.handle, toggle);
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
// src/ragemp/RageMpObject.ts
|
|
756
|
+
var RageMpObject = class extends RageMpEntity {
|
|
757
|
+
setActivatePhysicsAsSoonAsItIsUnfrozen(toggle) {
|
|
758
|
+
mp.game.object.setActivatePhysicsAsSoonAsItIsUnfrozen(this.raw.handle, toggle);
|
|
759
|
+
}
|
|
760
|
+
hasBeenBroken() {
|
|
761
|
+
return mp.game.object.hasBeenBroken(this.raw.handle, 0);
|
|
762
|
+
}
|
|
763
|
+
placeOnGroundProperly() {
|
|
764
|
+
return mp.game.object.placeOnGroundProperly(this.raw.handle);
|
|
765
|
+
}
|
|
766
|
+
slide(toX, toY, toZ, speedX, speedY, speedZ) {
|
|
767
|
+
return mp.game.object.slide(this.raw.handle, toX, toY, toZ, speedX, speedY, speedZ, false);
|
|
768
|
+
}
|
|
769
|
+
setTargetable(targetable) {
|
|
770
|
+
mp.game.object.setTargettable(this.raw.handle, targetable);
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
// src/ragemp/RageMpBlip.ts
|
|
775
|
+
var RageMpBlip = class {
|
|
776
|
+
constructor(raw) {
|
|
777
|
+
this.raw = raw;
|
|
778
|
+
}
|
|
779
|
+
get id() {
|
|
780
|
+
return this.raw.id;
|
|
781
|
+
}
|
|
782
|
+
get remoteId() {
|
|
783
|
+
return this.raw.remoteId;
|
|
784
|
+
}
|
|
785
|
+
get type() {
|
|
786
|
+
return this.raw.type;
|
|
787
|
+
}
|
|
788
|
+
get handle() {
|
|
789
|
+
return this.raw.handle;
|
|
790
|
+
}
|
|
791
|
+
get dimension() {
|
|
792
|
+
return this.raw.dimension;
|
|
793
|
+
}
|
|
794
|
+
set dimension(value) {
|
|
795
|
+
this.raw.dimension = value;
|
|
796
|
+
}
|
|
797
|
+
get position() {
|
|
798
|
+
const p = this.raw.position;
|
|
799
|
+
return { x: p.x, y: p.y, z: p.z };
|
|
800
|
+
}
|
|
801
|
+
set position(value) {
|
|
802
|
+
this.raw.position = new mp.Vector3(value.x, value.y, value.z);
|
|
803
|
+
}
|
|
804
|
+
destroy() {
|
|
805
|
+
this.raw.destroy();
|
|
806
|
+
}
|
|
807
|
+
setSprite(sprite) {
|
|
808
|
+
mp.game.ui.setBlipSprite(this.raw.handle, sprite);
|
|
809
|
+
}
|
|
810
|
+
getSprite() {
|
|
811
|
+
return mp.game.ui.getBlipSprite(this.raw.handle);
|
|
812
|
+
}
|
|
813
|
+
setColour(colour) {
|
|
814
|
+
mp.game.ui.setBlipColour(this.raw.handle, colour);
|
|
815
|
+
}
|
|
816
|
+
getColour() {
|
|
817
|
+
return mp.game.ui.getBlipColour(this.raw.handle);
|
|
818
|
+
}
|
|
819
|
+
setScale(scale) {
|
|
820
|
+
mp.game.ui.setBlipScale(this.raw.handle, scale);
|
|
821
|
+
}
|
|
822
|
+
getScale() {
|
|
823
|
+
return mp.game.ui.getBlipScale(this.raw.handle);
|
|
824
|
+
}
|
|
825
|
+
setAlpha(alpha) {
|
|
826
|
+
mp.game.ui.setBlipAlpha(this.raw.handle, alpha);
|
|
827
|
+
}
|
|
828
|
+
getAlpha() {
|
|
829
|
+
return mp.game.ui.getBlipAlpha(this.raw.handle);
|
|
830
|
+
}
|
|
831
|
+
setRotation(rotation) {
|
|
832
|
+
mp.game.ui.setBlipRotation(this.raw.handle, rotation);
|
|
833
|
+
}
|
|
834
|
+
getRotation() {
|
|
835
|
+
return mp.game.ui.getBlipRotation(this.raw.handle);
|
|
836
|
+
}
|
|
837
|
+
setName(name) {
|
|
838
|
+
mp.game.ui.setBlipNameFromTextFile(this.raw.handle, name);
|
|
839
|
+
}
|
|
840
|
+
getName() {
|
|
841
|
+
return mp.game.ui.getBlipName(this.raw.handle);
|
|
842
|
+
}
|
|
843
|
+
setRoute(toggle) {
|
|
844
|
+
mp.game.ui.setBlipRoute(this.raw.handle, toggle);
|
|
845
|
+
}
|
|
846
|
+
setRouteColour(colour) {
|
|
847
|
+
mp.game.ui.setBlipRouteColour(this.raw.handle, colour);
|
|
848
|
+
}
|
|
849
|
+
setFlashes(toggle) {
|
|
850
|
+
mp.game.ui.setBlipFlashes(this.raw.handle, toggle);
|
|
851
|
+
}
|
|
852
|
+
setFlashTimer(duration) {
|
|
853
|
+
mp.game.ui.setBlipFlashTimer(this.raw.handle, duration);
|
|
854
|
+
}
|
|
855
|
+
setFlashInterval(interval) {
|
|
856
|
+
mp.game.ui.setBlipFlashInterval(this.raw.handle, interval);
|
|
857
|
+
}
|
|
858
|
+
setCategory(category) {
|
|
859
|
+
mp.game.ui.setBlipCategory(this.raw.handle, category);
|
|
860
|
+
}
|
|
861
|
+
setPriority(priority) {
|
|
862
|
+
mp.game.ui.setBlipPriority(this.raw.handle, priority);
|
|
863
|
+
}
|
|
864
|
+
setDisplay(display) {
|
|
865
|
+
mp.game.ui.setBlipDisplay(this.raw.handle, display);
|
|
866
|
+
}
|
|
867
|
+
setAsShortRange(toggle) {
|
|
868
|
+
mp.game.ui.setBlipAsShortRange(this.raw.handle, toggle);
|
|
869
|
+
}
|
|
870
|
+
setHighDetail(toggle) {
|
|
871
|
+
mp.game.ui.setBlipHighDetail(this.raw.handle, toggle);
|
|
872
|
+
}
|
|
873
|
+
setBright(toggle) {
|
|
874
|
+
mp.game.ui.setBlipBright(this.raw.handle, toggle);
|
|
875
|
+
}
|
|
876
|
+
setAsFriendly(toggle) {
|
|
877
|
+
mp.game.ui.setBlipAsFriendly(this.raw.handle, toggle);
|
|
878
|
+
}
|
|
879
|
+
setShowCone(toggle) {
|
|
880
|
+
mp.game.ui.setBlipShowCone(this.raw.handle, toggle, 0);
|
|
881
|
+
}
|
|
882
|
+
setShowHeadingIndicator(toggle) {
|
|
883
|
+
mp.game.ui.showHeadingIndicatorOnBlip(this.raw.handle, toggle);
|
|
884
|
+
}
|
|
885
|
+
setSecondaryColour(r, g, b) {
|
|
886
|
+
mp.game.ui.setBlipSecondaryColour(this.raw.handle, r, g, b);
|
|
887
|
+
}
|
|
888
|
+
pulse() {
|
|
889
|
+
mp.game.ui.pulseBlip(this.raw.handle);
|
|
890
|
+
}
|
|
891
|
+
setFade(opacity, duration) {
|
|
892
|
+
mp.game.ui.setBlipFade(this.raw.handle, opacity, duration);
|
|
893
|
+
}
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
// src/ragemp/RageMpCheckpoint.ts
|
|
897
|
+
var RageMpCheckpoint = class extends RageMpEntity {
|
|
898
|
+
get visible() {
|
|
899
|
+
return this.raw.visible;
|
|
900
|
+
}
|
|
901
|
+
set visible(value) {
|
|
902
|
+
this.raw.visible = value;
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
// src/ragemp/RageMpColshape.ts
|
|
907
|
+
var RageMpColshape = class extends RageMpEntity {
|
|
908
|
+
get triggered() {
|
|
909
|
+
return this.raw.triggered;
|
|
910
|
+
}
|
|
911
|
+
set triggered(value) {
|
|
912
|
+
this.raw.triggered = value;
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
// src/ragemp/RageMpCamera.ts
|
|
917
|
+
var RageMpCamera = class {
|
|
918
|
+
constructor(raw) {
|
|
919
|
+
this.raw = raw;
|
|
920
|
+
}
|
|
921
|
+
get handle() {
|
|
922
|
+
return this.raw.handle;
|
|
923
|
+
}
|
|
924
|
+
getCoord() {
|
|
925
|
+
const p = mp.game.cam.getCoord(this.raw.handle);
|
|
926
|
+
return { x: p.x, y: p.y, z: p.z };
|
|
927
|
+
}
|
|
928
|
+
setCoord(x, y, z) {
|
|
929
|
+
mp.game.cam.setCoord(this.raw.handle, x, y, z);
|
|
930
|
+
}
|
|
931
|
+
getRot() {
|
|
932
|
+
const r = mp.game.cam.getRot(this.raw.handle, 2);
|
|
933
|
+
return { x: r.x, y: r.y, z: r.z };
|
|
934
|
+
}
|
|
935
|
+
setRot(x, y, z, rotationOrder) {
|
|
936
|
+
mp.game.cam.setRot(this.raw.handle, x, y, z, rotationOrder);
|
|
937
|
+
}
|
|
938
|
+
getFov() {
|
|
939
|
+
return mp.game.cam.getFov(this.raw.handle);
|
|
940
|
+
}
|
|
941
|
+
setFov(fov) {
|
|
942
|
+
mp.game.cam.setFov(this.raw.handle, fov);
|
|
943
|
+
}
|
|
944
|
+
isActive() {
|
|
945
|
+
return mp.game.cam.isActive(this.raw.handle);
|
|
946
|
+
}
|
|
947
|
+
setActive(toggle) {
|
|
948
|
+
mp.game.cam.setActive(this.raw.handle, toggle);
|
|
949
|
+
}
|
|
950
|
+
setActiveWithInterp(camFrom, duration, easeLocation, easeRotation) {
|
|
951
|
+
mp.game.cam.setActiveWithInterp(this.raw.handle, camFrom, duration, easeLocation, easeRotation);
|
|
952
|
+
}
|
|
953
|
+
pointAtCoord(x, y, z) {
|
|
954
|
+
mp.game.cam.pointAtCoord(this.raw.handle, x, y, z);
|
|
955
|
+
}
|
|
956
|
+
pointAt(entity) {
|
|
957
|
+
mp.game.cam.pointAtEntity(this.raw.handle, entity, 0, 0, 0, true);
|
|
958
|
+
}
|
|
959
|
+
stopPointing() {
|
|
960
|
+
mp.game.cam.stopPointing(this.raw.handle);
|
|
961
|
+
}
|
|
962
|
+
shake(type, amplitude) {
|
|
963
|
+
mp.game.cam.shake(this.raw.handle, type, amplitude);
|
|
964
|
+
}
|
|
965
|
+
isShaking() {
|
|
966
|
+
return mp.game.cam.isShaking(this.raw.handle);
|
|
967
|
+
}
|
|
968
|
+
setShakeAmplitude(amplitude) {
|
|
969
|
+
mp.game.cam.setShakeAmplitude(this.raw.handle, amplitude);
|
|
970
|
+
}
|
|
971
|
+
stopShaking(p0) {
|
|
972
|
+
mp.game.cam.stopShaking(this.raw.handle, p0);
|
|
973
|
+
}
|
|
974
|
+
isRendering() {
|
|
975
|
+
return mp.game.cam.isRendering(this.raw.handle);
|
|
976
|
+
}
|
|
977
|
+
isInterpolating() {
|
|
978
|
+
return mp.game.cam.isInterpolating(this.raw.handle);
|
|
979
|
+
}
|
|
980
|
+
setFarClip(farClip) {
|
|
981
|
+
mp.game.cam.setFarClip(this.raw.handle, farClip);
|
|
982
|
+
}
|
|
983
|
+
setNearClip(nearClip) {
|
|
984
|
+
mp.game.cam.setNearClip(this.raw.handle, nearClip);
|
|
985
|
+
}
|
|
986
|
+
setFarDof(farDof) {
|
|
987
|
+
mp.game.cam.setFarDof(this.raw.handle, farDof);
|
|
988
|
+
}
|
|
989
|
+
setNearDof(nearDof) {
|
|
990
|
+
mp.game.cam.setNearDof(this.raw.handle, nearDof);
|
|
991
|
+
}
|
|
992
|
+
setDofStrength(strength) {
|
|
993
|
+
mp.game.cam.setDofStrength(this.raw.handle, strength);
|
|
994
|
+
}
|
|
995
|
+
setUseShallowDofMode(toggle) {
|
|
996
|
+
mp.game.cam.setUseShallowDofMode(this.raw.handle, toggle);
|
|
997
|
+
}
|
|
998
|
+
setMotionBlurStrength(strength) {
|
|
999
|
+
mp.game.cam.setMotionBlurStrength(this.raw.handle, strength);
|
|
1000
|
+
}
|
|
1001
|
+
attachTo(entity, xOffset, yOffset, zOffset, isRelative) {
|
|
1002
|
+
mp.game.cam.attachToEntity(this.raw.handle, entity, xOffset, yOffset, zOffset, isRelative);
|
|
1003
|
+
}
|
|
1004
|
+
detach() {
|
|
1005
|
+
mp.game.cam.detach(this.raw.handle);
|
|
1006
|
+
}
|
|
1007
|
+
destroy() {
|
|
1008
|
+
mp.game.cam.destroy(this.raw.handle, false);
|
|
1009
|
+
}
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
// src/ragemp/RageMpBrowser.ts
|
|
1013
|
+
var RageMpBrowser = class {
|
|
1014
|
+
constructor(raw) {
|
|
1015
|
+
this.raw = raw;
|
|
1016
|
+
}
|
|
1017
|
+
get active() {
|
|
1018
|
+
return this.raw.active;
|
|
1019
|
+
}
|
|
1020
|
+
set active(value) {
|
|
1021
|
+
this.raw.active = value;
|
|
1022
|
+
}
|
|
1023
|
+
get url() {
|
|
1024
|
+
return this.raw.url;
|
|
1025
|
+
}
|
|
1026
|
+
set url(value) {
|
|
1027
|
+
this.raw.url = value;
|
|
1028
|
+
}
|
|
1029
|
+
get inputEnabled() {
|
|
1030
|
+
return this.raw.inputEnabled;
|
|
1031
|
+
}
|
|
1032
|
+
set inputEnabled(value) {
|
|
1033
|
+
this.raw.inputEnabled = value;
|
|
1034
|
+
}
|
|
1035
|
+
get orderId() {
|
|
1036
|
+
return this.raw.orderId;
|
|
1037
|
+
}
|
|
1038
|
+
set orderId(value) {
|
|
1039
|
+
this.raw.orderId = value;
|
|
1040
|
+
}
|
|
1041
|
+
destroy() {
|
|
1042
|
+
this.raw.destroy();
|
|
1043
|
+
}
|
|
1044
|
+
execute(code) {
|
|
1045
|
+
this.raw.execute(code);
|
|
1046
|
+
}
|
|
1047
|
+
executeCached(code) {
|
|
1048
|
+
this.raw.executeCached(code);
|
|
1049
|
+
}
|
|
1050
|
+
call(eventName, ...args) {
|
|
1051
|
+
this.raw.call(eventName, ...args);
|
|
1052
|
+
}
|
|
1053
|
+
callProc(procName, ...args) {
|
|
1054
|
+
return this.raw.callProc(procName, ...args);
|
|
1055
|
+
}
|
|
1056
|
+
reload(ignoreCache) {
|
|
1057
|
+
this.raw.reload(ignoreCache);
|
|
1058
|
+
}
|
|
1059
|
+
sendMouseMoveEvent(x, y) {
|
|
1060
|
+
this.raw.sendMouseMoveEvent(x, y);
|
|
1061
|
+
}
|
|
1062
|
+
sendMouseClickEvent(x, y, button, isUp) {
|
|
1063
|
+
this.raw.sendMouseClickEvent(x, y, button, isUp);
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
// src/ragemp/RageMpTextLabel.ts
|
|
1068
|
+
var RageMpTextLabel = class extends RageMpEntity {
|
|
1069
|
+
get color() {
|
|
1070
|
+
return this.raw.color;
|
|
1071
|
+
}
|
|
1072
|
+
set color(value) {
|
|
1073
|
+
this.raw.color = value;
|
|
1074
|
+
}
|
|
1075
|
+
get drawDistance() {
|
|
1076
|
+
return this.raw.drawDistance;
|
|
1077
|
+
}
|
|
1078
|
+
set drawDistance(value) {
|
|
1079
|
+
this.raw.drawDistance = value;
|
|
1080
|
+
}
|
|
1081
|
+
get los() {
|
|
1082
|
+
return this.raw.los;
|
|
1083
|
+
}
|
|
1084
|
+
set los(value) {
|
|
1085
|
+
this.raw.los = value;
|
|
1086
|
+
}
|
|
1087
|
+
get text() {
|
|
1088
|
+
return this.raw.text;
|
|
1089
|
+
}
|
|
1090
|
+
set text(value) {
|
|
1091
|
+
this.raw.text = value;
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
// src/ragemp/RageMpMarker.ts
|
|
1096
|
+
var RageMpMarker = class extends RageMpEntity {
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
// src/ragemp/RageMpPickup.ts
|
|
1100
|
+
var RageMpPickup = class extends RageMpEntity {
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
// src/ragemp/RageMpEvents.ts
|
|
1104
|
+
var RageMpEvents = class {
|
|
1105
|
+
add(eventNameOrEvents, callback) {
|
|
1106
|
+
if (typeof eventNameOrEvents === "string") {
|
|
1107
|
+
mp.events.add(eventNameOrEvents, callback);
|
|
1108
|
+
} else {
|
|
1109
|
+
for (const [name, cb] of Object.entries(eventNameOrEvents)) {
|
|
1110
|
+
mp.events.add(name, cb);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
remove(eventName, callback) {
|
|
1115
|
+
mp.events.remove(eventName, callback);
|
|
1116
|
+
}
|
|
1117
|
+
call(eventName, ...args) {
|
|
1118
|
+
mp.events.call(eventName, ...args);
|
|
1119
|
+
}
|
|
1120
|
+
callRemote(eventName, ...args) {
|
|
1121
|
+
mp.events.callRemote(eventName, ...args);
|
|
1122
|
+
}
|
|
1123
|
+
callRemoteProc(procName, ...args) {
|
|
1124
|
+
return mp.events.callRemoteProc(procName, ...args);
|
|
1125
|
+
}
|
|
1126
|
+
callRemoteUnreliable(eventName, ...args) {
|
|
1127
|
+
mp.events.callRemoteUnreliable(eventName, ...args);
|
|
1128
|
+
}
|
|
1129
|
+
addProc(procName, callback) {
|
|
1130
|
+
mp.events.addProc(procName, callback);
|
|
1131
|
+
}
|
|
1132
|
+
addDataHandler(key, callback) {
|
|
1133
|
+
mp.events.addDataHandler(key, callback);
|
|
1134
|
+
}
|
|
1135
|
+
cancelPendingProc(procName) {
|
|
1136
|
+
mp.events.cancelPendingProc(procName);
|
|
1137
|
+
}
|
|
1138
|
+
hasPendingProc(procName) {
|
|
1139
|
+
return mp.events.hasPendingProc(procName);
|
|
1140
|
+
}
|
|
1141
|
+
};
|
|
1142
|
+
|
|
1143
|
+
// src/ragemp/RageMpGui.ts
|
|
1144
|
+
var RageMpGuiChat = class {
|
|
1145
|
+
get colors() {
|
|
1146
|
+
return mp.gui.chat.colors;
|
|
1147
|
+
}
|
|
1148
|
+
set colors(value) {
|
|
1149
|
+
mp.gui.chat.colors = value;
|
|
1150
|
+
}
|
|
1151
|
+
get safeMode() {
|
|
1152
|
+
return mp.gui.chat.safeMode;
|
|
1153
|
+
}
|
|
1154
|
+
set safeMode(value) {
|
|
1155
|
+
mp.gui.chat.safeMode = value;
|
|
1156
|
+
}
|
|
1157
|
+
activate(toggle) {
|
|
1158
|
+
mp.gui.chat.activate(toggle);
|
|
1159
|
+
}
|
|
1160
|
+
push(text) {
|
|
1161
|
+
mp.gui.chat.push(text);
|
|
1162
|
+
}
|
|
1163
|
+
show(toggle) {
|
|
1164
|
+
mp.gui.chat.show(toggle);
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
var RageMpGuiCursor = class {
|
|
1168
|
+
get position() {
|
|
1169
|
+
return mp.gui.cursor.position;
|
|
1170
|
+
}
|
|
1171
|
+
set position(value) {
|
|
1172
|
+
mp.gui.cursor.position = value;
|
|
1173
|
+
}
|
|
1174
|
+
get visible() {
|
|
1175
|
+
return mp.gui.cursor.visible;
|
|
1176
|
+
}
|
|
1177
|
+
set visible(value) {
|
|
1178
|
+
mp.gui.cursor.visible = value;
|
|
1179
|
+
}
|
|
1180
|
+
show(freezeControls, toggle) {
|
|
1181
|
+
mp.gui.cursor.show(freezeControls, toggle);
|
|
1182
|
+
}
|
|
1183
|
+
};
|
|
1184
|
+
var RageMpGui = class {
|
|
1185
|
+
chat = new RageMpGuiChat();
|
|
1186
|
+
cursor = new RageMpGuiCursor();
|
|
1187
|
+
get isGpuRenderingEnabled() {
|
|
1188
|
+
return mp.gui.isGpuRenderingEnabled;
|
|
1189
|
+
}
|
|
1190
|
+
takeScreenshot(name, type, quality, compressionQuality) {
|
|
1191
|
+
mp.gui.takeScreenshot(name, type, quality, compressionQuality);
|
|
1192
|
+
}
|
|
1193
|
+
execute(code) {
|
|
1194
|
+
mp.gui.execute(code);
|
|
1195
|
+
}
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
// src/ragemp/RageMpKeys.ts
|
|
1199
|
+
var RageMpKeys = class {
|
|
1200
|
+
bind(keyCode, keyHold, callback) {
|
|
1201
|
+
mp.keys.bind(keyCode, keyHold, callback);
|
|
1202
|
+
}
|
|
1203
|
+
unbind(keyCode, keyHold, callback) {
|
|
1204
|
+
mp.keys.unbind(keyCode, keyHold, callback);
|
|
1205
|
+
}
|
|
1206
|
+
isUp(keyCode) {
|
|
1207
|
+
return mp.keys.isUp(keyCode);
|
|
1208
|
+
}
|
|
1209
|
+
isDown(keyCode) {
|
|
1210
|
+
return mp.keys.isDown(keyCode);
|
|
1211
|
+
}
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
// src/ragemp/RageMpStorage.ts
|
|
1215
|
+
var RageMpStorage = class {
|
|
1216
|
+
get data() {
|
|
1217
|
+
return mp.storage.data;
|
|
1218
|
+
}
|
|
1219
|
+
set data(value) {
|
|
1220
|
+
mp.storage.data = value;
|
|
1221
|
+
}
|
|
1222
|
+
get sessionData() {
|
|
1223
|
+
return mp.storage.sessionData;
|
|
1224
|
+
}
|
|
1225
|
+
set sessionData(value) {
|
|
1226
|
+
mp.storage.sessionData = value;
|
|
1227
|
+
}
|
|
1228
|
+
flush() {
|
|
1229
|
+
mp.storage.flush();
|
|
1230
|
+
}
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
// src/ragemp/RageMpVoiceChat.ts
|
|
1234
|
+
var RageMpVoiceChat = class {
|
|
1235
|
+
get isAllowed() {
|
|
1236
|
+
return mp.voiceChat.isAllowed;
|
|
1237
|
+
}
|
|
1238
|
+
get lastVad() {
|
|
1239
|
+
return mp.voiceChat.lastVad;
|
|
1240
|
+
}
|
|
1241
|
+
get muted() {
|
|
1242
|
+
return mp.voiceChat.muted;
|
|
1243
|
+
}
|
|
1244
|
+
set muted(value) {
|
|
1245
|
+
mp.voiceChat.muted = value;
|
|
1246
|
+
}
|
|
1247
|
+
get minVad() {
|
|
1248
|
+
return mp.voiceChat.minVad;
|
|
1249
|
+
}
|
|
1250
|
+
set minVad(value) {
|
|
1251
|
+
mp.voiceChat.minVad = value;
|
|
1252
|
+
}
|
|
1253
|
+
get advancedNoiseSuppression() {
|
|
1254
|
+
return mp.voiceChat.advancedNoiseSuppression;
|
|
1255
|
+
}
|
|
1256
|
+
set advancedNoiseSuppression(value) {
|
|
1257
|
+
mp.voiceChat.advancedNoiseSuppression = value;
|
|
1258
|
+
}
|
|
1259
|
+
get networkOptimisations() {
|
|
1260
|
+
return mp.voiceChat.networkOptimisations;
|
|
1261
|
+
}
|
|
1262
|
+
set networkOptimisations(value) {
|
|
1263
|
+
mp.voiceChat.networkOptimisations = value;
|
|
1264
|
+
}
|
|
1265
|
+
get bitrate() {
|
|
1266
|
+
return mp.voiceChat.bitrate;
|
|
1267
|
+
}
|
|
1268
|
+
set bitrate(value) {
|
|
1269
|
+
mp.voiceChat.bitrate = value;
|
|
1270
|
+
}
|
|
1271
|
+
get defaultVolume() {
|
|
1272
|
+
return mp.voiceChat.defaultVolume;
|
|
1273
|
+
}
|
|
1274
|
+
set defaultVolume(value) {
|
|
1275
|
+
mp.voiceChat.defaultVolume = value;
|
|
1276
|
+
}
|
|
1277
|
+
get gameOutputEnabled() {
|
|
1278
|
+
return mp.voiceChat.gameOutputEnabled;
|
|
1279
|
+
}
|
|
1280
|
+
set gameOutputEnabled(value) {
|
|
1281
|
+
mp.voiceChat.gameOutputEnabled = value;
|
|
1282
|
+
}
|
|
1283
|
+
get gameOutputCategory() {
|
|
1284
|
+
return mp.voiceChat.gameOutputCategory;
|
|
1285
|
+
}
|
|
1286
|
+
set gameOutputCategory(value) {
|
|
1287
|
+
mp.voiceChat.gameOutputCategory = value;
|
|
1288
|
+
}
|
|
1289
|
+
getPreprocessingParam(param) {
|
|
1290
|
+
return mp.voiceChat.getPreprocessingParam(param);
|
|
1291
|
+
}
|
|
1292
|
+
setPreprocessingParam(param, value) {
|
|
1293
|
+
mp.voiceChat.setPreprocessingParam(param, value);
|
|
1294
|
+
}
|
|
1295
|
+
cleanupAndReload(force, clearTemporary) {
|
|
1296
|
+
mp.voiceChat.cleanupAndReload(force, clearTemporary, false);
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
// src/ragemp/RageMpNametags.ts
|
|
1301
|
+
var RageMpNametags = class {
|
|
1302
|
+
get enabled() {
|
|
1303
|
+
return mp.nametags.enabled;
|
|
1304
|
+
}
|
|
1305
|
+
set enabled(value) {
|
|
1306
|
+
mp.nametags.enabled = value;
|
|
1307
|
+
}
|
|
1308
|
+
set(style) {
|
|
1309
|
+
mp.nametags.set({
|
|
1310
|
+
...style,
|
|
1311
|
+
veh_offset: style.vehOffset
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
useScreen2dCoords(toggle) {
|
|
1315
|
+
mp.nametags.useScreen2dCoords(toggle);
|
|
1316
|
+
}
|
|
1317
|
+
orderByDistance(toggle) {
|
|
1318
|
+
mp.nametags.orderByDistance(toggle);
|
|
1319
|
+
}
|
|
1320
|
+
};
|
|
1321
|
+
|
|
1322
|
+
// src/ragemp/RageMpRaycasting.ts
|
|
1323
|
+
var RageMpRaycasting = class {
|
|
1324
|
+
testPointToPoint(startPos, endPos, ignoreEntity, flags) {
|
|
1325
|
+
const result = mp.raycasting.testPointToPoint(
|
|
1326
|
+
new mp.Vector3(startPos.x, startPos.y, startPos.z),
|
|
1327
|
+
new mp.Vector3(endPos.x, endPos.y, endPos.z),
|
|
1328
|
+
ignoreEntity,
|
|
1329
|
+
flags
|
|
1330
|
+
);
|
|
1331
|
+
return {
|
|
1332
|
+
entity: result.entity,
|
|
1333
|
+
position: { x: result.position.x, y: result.position.y, z: result.position.z },
|
|
1334
|
+
surfaceNormal: { x: result.surfaceNormal.x, y: result.surfaceNormal.y, z: result.surfaceNormal.z }
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
async testPointToPointAsync(startPos, endPos, ignoreEntity, flags) {
|
|
1338
|
+
const result = await mp.raycasting.testPointToPointAsync(
|
|
1339
|
+
new mp.Vector3(startPos.x, startPos.y, startPos.z),
|
|
1340
|
+
new mp.Vector3(endPos.x, endPos.y, endPos.z),
|
|
1341
|
+
ignoreEntity,
|
|
1342
|
+
flags
|
|
1343
|
+
);
|
|
1344
|
+
return {
|
|
1345
|
+
entity: result.entity,
|
|
1346
|
+
position: { x: result.position.x, y: result.position.y, z: result.position.z },
|
|
1347
|
+
surfaceNormal: { x: result.surfaceNormal.x, y: result.surfaceNormal.y, z: result.surfaceNormal.z }
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
testCapsule(startPos, endPos, radius, ignoreEntity, flags) {
|
|
1351
|
+
const result = mp.raycasting.testCapsule(
|
|
1352
|
+
new mp.Vector3(startPos.x, startPos.y, startPos.z),
|
|
1353
|
+
new mp.Vector3(endPos.x, endPos.y, endPos.z),
|
|
1354
|
+
radius,
|
|
1355
|
+
ignoreEntity,
|
|
1356
|
+
flags
|
|
1357
|
+
);
|
|
1358
|
+
return {
|
|
1359
|
+
entity: result.entity,
|
|
1360
|
+
position: { x: result.position.x, y: result.position.y, z: result.position.z },
|
|
1361
|
+
surfaceNormal: { x: result.surfaceNormal.x, y: result.surfaceNormal.y, z: result.surfaceNormal.z }
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
};
|
|
1365
|
+
|
|
1366
|
+
// src/ragemp/RageMpConsole.ts
|
|
1367
|
+
var RageMpConsole = class {
|
|
1368
|
+
get verbosity() {
|
|
1369
|
+
return mp.console.verbosity;
|
|
1370
|
+
}
|
|
1371
|
+
set verbosity(value) {
|
|
1372
|
+
mp.console.verbosity = value;
|
|
1373
|
+
}
|
|
1374
|
+
logInfo(message) {
|
|
1375
|
+
mp.console.logInfo(message);
|
|
1376
|
+
}
|
|
1377
|
+
logWarning(message) {
|
|
1378
|
+
mp.console.logWarning(message);
|
|
1379
|
+
}
|
|
1380
|
+
logError(message) {
|
|
1381
|
+
mp.console.logError(message);
|
|
1382
|
+
}
|
|
1383
|
+
logFatal(message) {
|
|
1384
|
+
mp.console.logFatal(message);
|
|
1385
|
+
}
|
|
1386
|
+
clear() {
|
|
1387
|
+
mp.console.clear();
|
|
1388
|
+
}
|
|
1389
|
+
reset() {
|
|
1390
|
+
mp.console.reset();
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
// src/ragemp/RageMpDiscord.ts
|
|
1395
|
+
var RageMpDiscord = class {
|
|
1396
|
+
update(details, state) {
|
|
1397
|
+
mp.discord.update(details, state);
|
|
1398
|
+
}
|
|
1399
|
+
requestOAuth2(appId, scopes) {
|
|
1400
|
+
return mp.discord.requestOAuth2(appId);
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
// src/ragemp/RageMpSystem.ts
|
|
1405
|
+
var RageMpSystem = class {
|
|
1406
|
+
get isFullscreen() {
|
|
1407
|
+
return mp.system.isFullscreen;
|
|
1408
|
+
}
|
|
1409
|
+
get isFocused() {
|
|
1410
|
+
return mp.system.isFocused;
|
|
1411
|
+
}
|
|
1412
|
+
notify(args) {
|
|
1413
|
+
mp.system.notify(args);
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
// src/ragemp/RageMpUser.ts
|
|
1418
|
+
var RageMpUserPreferences = class {
|
|
1419
|
+
get lowQualityAssets() {
|
|
1420
|
+
return mp.user.preferences.lowQualityAssets;
|
|
1421
|
+
}
|
|
1422
|
+
get language() {
|
|
1423
|
+
return mp.user.preferences.language;
|
|
1424
|
+
}
|
|
1425
|
+
get serverAddress() {
|
|
1426
|
+
return mp.user.preferences.serverAddress;
|
|
1427
|
+
}
|
|
1428
|
+
};
|
|
1429
|
+
var RageMpUser = class {
|
|
1430
|
+
preferences = new RageMpUserPreferences();
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1433
|
+
// src/ragemp/RageMpNativesBridge.ts
|
|
1434
|
+
var RageMpNativesBridge = class {
|
|
1435
|
+
invoke(namespace, name, ...args) {
|
|
1436
|
+
const ns = mp.game[namespace];
|
|
1437
|
+
if (!ns) {
|
|
1438
|
+
throw new Error(`Native namespace "${namespace}" not found`);
|
|
1439
|
+
}
|
|
1440
|
+
const fn = ns[name];
|
|
1441
|
+
if (typeof fn !== "function") {
|
|
1442
|
+
throw new Error(`Native "${namespace}.${name}" is not a function`);
|
|
1443
|
+
}
|
|
1444
|
+
return fn(...args);
|
|
1445
|
+
}
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
|
+
// src/ragemp/RageMpEngine.ts
|
|
1449
|
+
var RageMpEngine = class {
|
|
1450
|
+
players;
|
|
1451
|
+
vehicles;
|
|
1452
|
+
peds;
|
|
1453
|
+
objects;
|
|
1454
|
+
blips;
|
|
1455
|
+
checkpoints;
|
|
1456
|
+
colshapes;
|
|
1457
|
+
cameras;
|
|
1458
|
+
browsers;
|
|
1459
|
+
labels;
|
|
1460
|
+
markers;
|
|
1461
|
+
pickups;
|
|
1462
|
+
events;
|
|
1463
|
+
gui;
|
|
1464
|
+
keys;
|
|
1465
|
+
storage;
|
|
1466
|
+
voiceChat;
|
|
1467
|
+
nametags;
|
|
1468
|
+
raycasting;
|
|
1469
|
+
console;
|
|
1470
|
+
discord;
|
|
1471
|
+
system;
|
|
1472
|
+
user;
|
|
1473
|
+
natives;
|
|
1474
|
+
_localPlayer = null;
|
|
1475
|
+
constructor() {
|
|
1476
|
+
this.players = new RageMpEntityPool(mp.players, (raw) => new RageMpPlayer(raw));
|
|
1477
|
+
this.vehicles = new RageMpEntityPool(mp.vehicles, (raw) => new RageMpVehicle(raw));
|
|
1478
|
+
this.objects = new RageMpEntityPool(mp.objects, (raw) => new RageMpObject(raw));
|
|
1479
|
+
this.markers = new RageMpEntityPool(mp.markers, (raw) => new RageMpMarker(raw));
|
|
1480
|
+
this.pickups = new RageMpEntityPool(mp.pickups, (raw) => new RageMpPickup(raw));
|
|
1481
|
+
this.peds = new RageMpCreatablePool(
|
|
1482
|
+
mp.peds,
|
|
1483
|
+
(raw) => new RageMpPed(raw),
|
|
1484
|
+
(opts) => mp.peds.new(
|
|
1485
|
+
opts.model,
|
|
1486
|
+
new mp.Vector3(opts.position.x, opts.position.y, opts.position.z),
|
|
1487
|
+
opts.heading,
|
|
1488
|
+
opts.dimension ?? 0
|
|
1489
|
+
)
|
|
1490
|
+
);
|
|
1491
|
+
this.blips = new RageMpCreatablePool(
|
|
1492
|
+
mp.blips,
|
|
1493
|
+
(raw) => new RageMpBlip(raw),
|
|
1494
|
+
(opts) => mp.blips.new(
|
|
1495
|
+
opts.sprite,
|
|
1496
|
+
new mp.Vector3(opts.position.x, opts.position.y, opts.position.z),
|
|
1497
|
+
{
|
|
1498
|
+
name: opts.name,
|
|
1499
|
+
scale: opts.scale,
|
|
1500
|
+
color: opts.color,
|
|
1501
|
+
alpha: opts.alpha,
|
|
1502
|
+
drawDistance: opts.drawDistance,
|
|
1503
|
+
shortRange: opts.shortRange,
|
|
1504
|
+
rotation: opts.rotation,
|
|
1505
|
+
dimension: opts.dimension
|
|
1506
|
+
}
|
|
1507
|
+
)
|
|
1508
|
+
);
|
|
1509
|
+
this.checkpoints = new RageMpCreatablePool(
|
|
1510
|
+
mp.checkpoints,
|
|
1511
|
+
(raw) => new RageMpCheckpoint(raw),
|
|
1512
|
+
(opts) => mp.checkpoints.new(
|
|
1513
|
+
opts.type,
|
|
1514
|
+
new mp.Vector3(opts.position.x, opts.position.y, opts.position.z),
|
|
1515
|
+
opts.radius,
|
|
1516
|
+
{
|
|
1517
|
+
direction: opts.direction ? new mp.Vector3(opts.direction.x, opts.direction.y, opts.direction.z) : void 0,
|
|
1518
|
+
color: opts.color ? [opts.color.r, opts.color.g, opts.color.b, opts.color.a] : void 0,
|
|
1519
|
+
visible: opts.visible,
|
|
1520
|
+
dimension: opts.dimension
|
|
1521
|
+
}
|
|
1522
|
+
)
|
|
1523
|
+
);
|
|
1524
|
+
this.colshapes = new RageMpCreatablePool(
|
|
1525
|
+
mp.colshapes,
|
|
1526
|
+
(raw) => new RageMpColshape(raw),
|
|
1527
|
+
(opts) => {
|
|
1528
|
+
switch (opts.shape) {
|
|
1529
|
+
case "sphere":
|
|
1530
|
+
return mp.colshapes.newSphere(opts.x, opts.y, opts.z, opts.radius, opts.dimension);
|
|
1531
|
+
case "tube":
|
|
1532
|
+
return mp.colshapes.newTube(opts.x, opts.y, opts.z, opts.radius, opts.height, opts.dimension);
|
|
1533
|
+
case "circle":
|
|
1534
|
+
return mp.colshapes.newCircle(opts.x, opts.y, opts.radius, opts.dimension);
|
|
1535
|
+
case "cuboid":
|
|
1536
|
+
return mp.colshapes.newCuboid(opts.x, opts.y, opts.z, opts.width, opts.height, opts.depth, opts.dimension);
|
|
1537
|
+
case "rectangle":
|
|
1538
|
+
return mp.colshapes.newRectangle(opts.x, opts.y, opts.width, opts.height, opts.dimension);
|
|
1539
|
+
case "polygon":
|
|
1540
|
+
default:
|
|
1541
|
+
return mp.colshapes.newSphere(opts.x, opts.y, opts.z, opts.radius ?? 1, opts.dimension);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
);
|
|
1545
|
+
this.cameras = new RageMpCreatablePool(
|
|
1546
|
+
mp.cameras,
|
|
1547
|
+
(raw) => new RageMpCamera(raw),
|
|
1548
|
+
(opts) => mp.cameras.new(
|
|
1549
|
+
opts.name,
|
|
1550
|
+
opts.position ? new mp.Vector3(opts.position.x, opts.position.y, opts.position.z) : void 0,
|
|
1551
|
+
opts.rotation ? new mp.Vector3(opts.rotation.x, opts.rotation.y, opts.rotation.z) : void 0,
|
|
1552
|
+
opts.fov
|
|
1553
|
+
)
|
|
1554
|
+
);
|
|
1555
|
+
this.browsers = new RageMpCreatablePool(
|
|
1556
|
+
mp.browsers,
|
|
1557
|
+
(raw) => new RageMpBrowser(raw),
|
|
1558
|
+
(opts) => mp.browsers.new(opts.url)
|
|
1559
|
+
);
|
|
1560
|
+
this.labels = new RageMpCreatablePool(
|
|
1561
|
+
mp.labels,
|
|
1562
|
+
(raw) => new RageMpTextLabel(raw),
|
|
1563
|
+
(opts) => mp.labels.new(
|
|
1564
|
+
opts.text,
|
|
1565
|
+
new mp.Vector3(opts.position.x, opts.position.y, opts.position.z),
|
|
1566
|
+
{
|
|
1567
|
+
font: opts.font,
|
|
1568
|
+
color: opts.color ? [opts.color.r, opts.color.g, opts.color.b, opts.color.a] : void 0,
|
|
1569
|
+
drawDistance: opts.drawDistance,
|
|
1570
|
+
los: opts.los,
|
|
1571
|
+
dimension: opts.dimension
|
|
1572
|
+
}
|
|
1573
|
+
)
|
|
1574
|
+
);
|
|
1575
|
+
this.events = new RageMpEvents();
|
|
1576
|
+
this.gui = new RageMpGui();
|
|
1577
|
+
this.keys = new RageMpKeys();
|
|
1578
|
+
this.storage = new RageMpStorage();
|
|
1579
|
+
this.voiceChat = new RageMpVoiceChat();
|
|
1580
|
+
this.nametags = new RageMpNametags();
|
|
1581
|
+
this.raycasting = new RageMpRaycasting();
|
|
1582
|
+
this.console = new RageMpConsole();
|
|
1583
|
+
this.discord = new RageMpDiscord();
|
|
1584
|
+
this.system = new RageMpSystem();
|
|
1585
|
+
this.user = new RageMpUser();
|
|
1586
|
+
this.natives = new RageMpNativesBridge();
|
|
1587
|
+
}
|
|
1588
|
+
get localPlayer() {
|
|
1589
|
+
if (!this._localPlayer) {
|
|
1590
|
+
this._localPlayer = new RageMpPlayer(mp.players.local);
|
|
1591
|
+
}
|
|
1592
|
+
return this._localPlayer;
|
|
1593
|
+
}
|
|
1594
|
+
};
|
|
1595
|
+
export {
|
|
1596
|
+
RageMpBlip,
|
|
1597
|
+
RageMpBrowser,
|
|
1598
|
+
RageMpCamera,
|
|
1599
|
+
RageMpCheckpoint,
|
|
1600
|
+
RageMpColshape,
|
|
1601
|
+
RageMpCreatablePool,
|
|
1602
|
+
RageMpEngine,
|
|
1603
|
+
RageMpEntity,
|
|
1604
|
+
RageMpEntityPool,
|
|
1605
|
+
RageMpMarker,
|
|
1606
|
+
RageMpObject,
|
|
1607
|
+
RageMpPed,
|
|
1608
|
+
RageMpPickup,
|
|
1609
|
+
RageMpPlayer,
|
|
1610
|
+
RageMpTextLabel,
|
|
1611
|
+
RageMpVehicle
|
|
1612
|
+
};
|
|
1613
|
+
//# sourceMappingURL=ragemp.js.map
|