@nativewrappers/redm 0.0.100 → 0.0.102
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/Game.d.ts +5 -0
- package/Game.js +24 -1
- package/common/decors/Events.js +36 -14
- package/entities/Ped.d.ts +1 -0
- package/entities/Ped.js +3 -0
- package/package.json +1 -1
package/Game.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { Vector3 } from "./common/utils/Vector";
|
|
1
2
|
import { Ped } from "./entities/Ped";
|
|
2
3
|
export declare class Game {
|
|
3
4
|
static get PlayerPed(): Ped;
|
|
4
5
|
static get Player(): import("./entities/Player").Player;
|
|
6
|
+
static loadScene(pos: Vector3, offset?: Vector3, radius?: number, controlFlags?: number): boolean;
|
|
7
|
+
static stopLoadScene(): void;
|
|
8
|
+
static isLoadSceneLoaded(): boolean;
|
|
9
|
+
static isLoadSceneActive(): boolean;
|
|
5
10
|
}
|
package/Game.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import {
|
|
3
|
+
import { Vector3 } from "./common/utils/Vector";
|
|
4
4
|
import { GameConstants } from "./GameConstants";
|
|
5
|
+
import { Ped } from "./entities/Ped";
|
|
5
6
|
class Game {
|
|
6
7
|
static {
|
|
7
8
|
__name(this, "Game");
|
|
@@ -12,6 +13,28 @@ class Game {
|
|
|
12
13
|
static get Player() {
|
|
13
14
|
return GameConstants.Player;
|
|
14
15
|
}
|
|
16
|
+
static loadScene(pos, offset = Vector3.Zero, radius = 5, controlFlags = 0) {
|
|
17
|
+
return Citizen.invokeNative(
|
|
18
|
+
"0x387AD749E3B69B70",
|
|
19
|
+
pos.x,
|
|
20
|
+
pos.y,
|
|
21
|
+
pos.z,
|
|
22
|
+
offset.x,
|
|
23
|
+
offset.y,
|
|
24
|
+
offset.z,
|
|
25
|
+
radius,
|
|
26
|
+
controlFlags
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
static stopLoadScene() {
|
|
30
|
+
Citizen.invokeNative("0x5A8B01199C3E79C3");
|
|
31
|
+
}
|
|
32
|
+
static isLoadSceneLoaded() {
|
|
33
|
+
return Citizen.invokeNative("0x0909F71B5C070797");
|
|
34
|
+
}
|
|
35
|
+
static isLoadSceneActive() {
|
|
36
|
+
return Citizen.invokeNative("0xCF45DF50C7775F2A");
|
|
37
|
+
}
|
|
15
38
|
}
|
|
16
39
|
export {
|
|
17
40
|
Game
|
package/common/decors/Events.js
CHANGED
|
@@ -9,27 +9,49 @@ var ConVarType = /* @__PURE__ */ ((ConVarType2) => {
|
|
|
9
9
|
return ConVarType2;
|
|
10
10
|
})(ConVarType || {});
|
|
11
11
|
const DisablePrettyPrint = /* @__PURE__ */ __name(() => GlobalData.EnablePrettyPrint = false, "DisablePrettyPrint");
|
|
12
|
+
const AsyncFunction = (async () => {
|
|
13
|
+
}).constructor;
|
|
12
14
|
function Exports(exportName) {
|
|
13
15
|
return /* @__PURE__ */ __name(function actualDecorator(originalMethod, context) {
|
|
14
16
|
if (context.private) {
|
|
15
17
|
throw new Error("Exports does not work on private methods, please mark the method as public");
|
|
16
18
|
}
|
|
17
19
|
context.addInitializer(function() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
let exportCb;
|
|
21
|
+
if (originalMethod instanceof AsyncFunction) {
|
|
22
|
+
exportCb = /* @__PURE__ */ __name(async (...args) => {
|
|
23
|
+
try {
|
|
24
|
+
return await originalMethod.call(this, ...args);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
REMOVE_EVENT_LOG: {
|
|
27
|
+
if (!GlobalData.EnablePrettyPrint) return;
|
|
28
|
+
console.error("------- EXPORT ERROR --------");
|
|
29
|
+
console.error(`Call to ${exportName} errored`);
|
|
30
|
+
console.error(`Data: ${JSON.stringify(args)}`);
|
|
31
|
+
console.error(`Error: ${err}`);
|
|
32
|
+
console.error("------- END EXPORT ERROR --------");
|
|
33
|
+
}
|
|
34
|
+
throw err;
|
|
29
35
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
}, "exportCb");
|
|
37
|
+
} else {
|
|
38
|
+
exportCb = /* @__PURE__ */ __name((...args) => {
|
|
39
|
+
try {
|
|
40
|
+
return originalMethod.call(this, ...args);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
REMOVE_EVENT_LOG: {
|
|
43
|
+
if (!GlobalData.EnablePrettyPrint) return;
|
|
44
|
+
console.error("------- EXPORT ERROR --------");
|
|
45
|
+
console.error(`Call to ${exportName} errored`);
|
|
46
|
+
console.error(`Data: ${JSON.stringify(args)}`);
|
|
47
|
+
console.error(`Error: ${err}`);
|
|
48
|
+
console.error("------- END EXPORT ERROR --------");
|
|
49
|
+
}
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
}, "exportCb");
|
|
53
|
+
}
|
|
54
|
+
exports(exportName, exportCb);
|
|
33
55
|
});
|
|
34
56
|
}, "actualDecorator");
|
|
35
57
|
}
|
package/entities/Ped.d.ts
CHANGED
|
@@ -210,4 +210,5 @@ export declare class Ped extends BaseEntity {
|
|
|
210
210
|
giveWeapon(weapon: WeaponModel, ammoCount: number, forceInHand?: boolean, forceInHolster?: boolean, attachPoint?: WeaponAttachPoints | undefined, allowMultipleCopies?: boolean, p7?: number, p8?: number, addReason?: ItemAddReason, ignoreUnlocks?: boolean, permanentDegradation?: number, p12?: boolean): Promise<void>;
|
|
211
211
|
setCurrentWeapon(weapon: WeaponModel, equipNow?: boolean, attachPoint?: WeaponAttachPoints, p4?: boolean, p5?: boolean): void;
|
|
212
212
|
holsterWeapon(): void;
|
|
213
|
+
setWeaponOnBack(disableAnim?: boolean): void;
|
|
213
214
|
}
|
package/entities/Ped.js
CHANGED
|
@@ -473,6 +473,9 @@ class Ped extends BaseEntity {
|
|
|
473
473
|
holsterWeapon() {
|
|
474
474
|
Citizen.invokeNative("0x94A3C1B804D291EC", this.handle, true, true, true, true);
|
|
475
475
|
}
|
|
476
|
+
setWeaponOnBack(disableAnim = false) {
|
|
477
|
+
Citizen.invokeNative("0x4820A6939D7CEF28", this.handle, disableAnim);
|
|
478
|
+
}
|
|
476
479
|
}
|
|
477
480
|
export {
|
|
478
481
|
Ped
|