@nativewrappers/redm 0.0.80 → 0.0.82
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/Attribute.js +143 -0
- package/Controls.js +22 -0
- package/Game.d.ts +2 -2
- package/Game.js +18 -0
- package/GameConstants.d.ts +1 -1
- package/GameConstants.js +24 -0
- package/Model.js +153 -0
- package/RawControls.d.ts +1 -1
- package/RawControls.js +22 -0
- package/RelationshipGroup.js +72 -0
- package/Volume.d.ts +1 -1
- package/Volume.js +32 -0
- package/common/Command.js +111 -0
- package/common/Convar.js +58 -0
- package/common/GlobalData.js +16 -0
- package/common/Kvp.js +137 -0
- package/common/Resource.js +54 -0
- package/common/decors/Events.js +170 -0
- package/common/net/NetworkedMap.js +225 -0
- package/common/utils/ClassTypes.js +15 -0
- package/common/utils/Color.js +33 -0
- package/common/utils/Delay.d.ts +1 -0
- package/common/utils/Delay.js +6 -0
- package/common/utils/Maths.js +18 -0
- package/common/utils/Point.d.ts +9 -0
- package/common/utils/Point.js +36 -0
- package/common/utils/PointF.d.ts +1 -1
- package/common/utils/PointF.js +18 -0
- package/common/utils/Quaternion.d.ts +1 -1
- package/common/utils/Quaternion.js +33 -0
- package/common/utils/Vector.js +589 -0
- package/common/utils/cleanPlayerName.js +17 -0
- package/common/utils/enumValues.js +20 -0
- package/common/utils/getStringFromUInt8Array.js +6 -0
- package/common/utils/getUInt32FromUint8Array.js +6 -0
- package/definitions/Citizen.d.js +0 -0
- package/definitions/index.d.js +0 -0
- package/definitions/redm.d.js +0 -0
- package/entities/BaseEntity.d.ts +1 -1
- package/entities/BaseEntity.js +99 -0
- package/entities/Entity.d.ts +1 -1
- package/entities/Entity.js +99 -0
- package/entities/Ped.d.ts +1 -1
- package/entities/Ped.js +336 -0
- package/entities/Pickup.d.ts +4 -0
- package/entities/Pickup.js +14 -0
- package/entities/Player.js +57 -0
- package/entities/Prop.js +11 -0
- package/entities/Vehicle.d.ts +1 -1
- package/entities/Vehicle.js +23 -0
- package/enums/Attributes.js +56 -0
- package/enums/Entity.js +20 -0
- package/enums/Keys.js +809 -0
- package/enums/Ped.js +31 -0
- package/enums/RawKeys.js +234 -0
- package/enums/Relationship.js +13 -0
- package/enums/VehicleSeat.js +17 -0
- package/index.js +52 -3762
- package/interfaces/Dimensions.d.ts +1 -1
- package/interfaces/Dimensions.js +0 -0
- package/package.json +2 -2
- package/types/Throwable.js +0 -0
- package/utils/Native.js +8 -0
- package/world/createDraftVehicle.d.ts +2 -2
- package/world/createDraftVehicle.js +32 -0
- package/world/createPed.d.ts +2 -2
- package/world/createPed.js +28 -0
- package/world/createProp.d.ts +1 -1
- package/world/createProp.js +28 -0
- package/world/createVehicle.d.ts +2 -2
- package/world/createVehicle.js +28 -0
- package/common/index.d.ts +0 -8
- package/common/utils/Vector2.d.ts +0 -1
- package/common/utils/Vector3.d.ts +0 -1
- package/common/utils/Vector4.d.ts +0 -1
- package/common/utils/index.d.ts +0 -12
- package/entities/index.d.ts +0 -4
- package/enums/index.d.ts +0 -6
- package/index.d.ts +0 -12
- package/utils/index.d.ts +0 -2
- package/world/index.d.ts +0 -4
- /package/{game/index.d.ts → common/types.js} +0 -0
|
File without changes
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
],
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
11
|
-
"version": "0.0.
|
|
11
|
+
"version": "0.0.82",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/nativewrappers/nativewrappers.git"
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"./**/*.d.ts"
|
|
30
30
|
],
|
|
31
31
|
"exports": {
|
|
32
|
-
"
|
|
32
|
+
"./*": "./*"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
File without changes
|
package/utils/Native.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
const _N = /* @__PURE__ */ __name((hash, ...args) => {
|
|
4
|
+
return Citizen.invokeNative(hash, ...args);
|
|
5
|
+
}, "_N");
|
|
6
|
+
export {
|
|
7
|
+
_N
|
|
8
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Vector3 } from "../common/utils";
|
|
2
|
-
import { Vehicle } from "redm/entities";
|
|
1
|
+
import type { Vector3 } from "../common/utils/Vector";
|
|
2
|
+
import { Vehicle } from "redm/entities/Vehicle";
|
|
3
3
|
import type { Model } from "redm/Model";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a vehicle at the specified {@param spawnPos}, you don't need to request the model before this.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { Vehicle } from "redm/entities/Vehicle";
|
|
4
|
+
import { _N } from "redm/utils/Native";
|
|
5
|
+
async function createDraftVehicle(model, spawnPos, heading, isNetwork = false, bScriptHostVeh = true, bDontAutoCreateDraftAnimals = true, draftAnimalPopGroup = 0, p9 = true) {
|
|
6
|
+
if (!model.IsPed || !model.request(1e3)) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const draftVehHandle = _N(
|
|
10
|
+
"0x214651FB1DFEBA89",
|
|
11
|
+
model.Hash,
|
|
12
|
+
spawnPos.x,
|
|
13
|
+
spawnPos.y,
|
|
14
|
+
spawnPos.z,
|
|
15
|
+
heading,
|
|
16
|
+
isNetwork,
|
|
17
|
+
bScriptHostVeh,
|
|
18
|
+
bDontAutoCreateDraftAnimals,
|
|
19
|
+
draftAnimalPopGroup,
|
|
20
|
+
p9,
|
|
21
|
+
Citizen.resultAsInteger()
|
|
22
|
+
);
|
|
23
|
+
if (draftVehHandle !== 0) {
|
|
24
|
+
model.markAsNoLongerNeeded();
|
|
25
|
+
return new Vehicle(draftVehHandle);
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
__name(createDraftVehicle, "createDraftVehicle");
|
|
30
|
+
export {
|
|
31
|
+
createDraftVehicle
|
|
32
|
+
};
|
package/world/createPed.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Vector3 } from "../common/utils";
|
|
2
|
-
import { Ped } from "redm/entities";
|
|
1
|
+
import type { Vector3 } from "../common/utils/Vector";
|
|
2
|
+
import { Ped } from "redm/entities/Ped";
|
|
3
3
|
import type { Model } from "redm/Model";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a ped at the specified {@param spawnPos}, you don't need to request the model before this.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { Ped } from "redm/entities/Ped";
|
|
4
|
+
async function createPed(model, spawnPos, heading, isNetwork = false, bScriptHostPed = true, p7 = true, p8 = true) {
|
|
5
|
+
if (!model.IsPed || !model.request(1e3)) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
const pedHandle = CreatePed(
|
|
9
|
+
model.Hash,
|
|
10
|
+
spawnPos.x,
|
|
11
|
+
spawnPos.y,
|
|
12
|
+
spawnPos.z,
|
|
13
|
+
heading,
|
|
14
|
+
isNetwork,
|
|
15
|
+
bScriptHostPed,
|
|
16
|
+
p7,
|
|
17
|
+
p8
|
|
18
|
+
);
|
|
19
|
+
if (pedHandle !== 0) {
|
|
20
|
+
model.markAsNoLongerNeeded();
|
|
21
|
+
return new Ped(pedHandle);
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
__name(createPed, "createPed");
|
|
26
|
+
export {
|
|
27
|
+
createPed
|
|
28
|
+
};
|
package/world/createProp.d.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { Prop } from "redm/entities/Prop";
|
|
4
|
+
async function createProp(model, spawnPos, heading, isNetwork = false, bScriptHostProp = true, dynamic = true, p7 = true, p8 = true) {
|
|
5
|
+
if (!model.IsProp || !model.request(1e3)) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
const propHandle = CreateObject(
|
|
9
|
+
model.Hash,
|
|
10
|
+
spawnPos.x,
|
|
11
|
+
spawnPos.y,
|
|
12
|
+
spawnPos.z,
|
|
13
|
+
isNetwork,
|
|
14
|
+
bScriptHostProp,
|
|
15
|
+
dynamic,
|
|
16
|
+
p7,
|
|
17
|
+
p8
|
|
18
|
+
);
|
|
19
|
+
if (propHandle !== 0) {
|
|
20
|
+
model.markAsNoLongerNeeded();
|
|
21
|
+
return new Prop(propHandle);
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
__name(createProp, "createProp");
|
|
26
|
+
export {
|
|
27
|
+
createProp
|
|
28
|
+
};
|
package/world/createVehicle.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Vector3 } from "../common/utils";
|
|
2
|
-
import { Vehicle } from "redm/entities";
|
|
1
|
+
import type { Vector3 } from "../common/utils/Vector";
|
|
2
|
+
import { Vehicle } from "redm/entities/Vehicle";
|
|
3
3
|
import type { Model } from "redm/Model";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a vehicle at the specified {@param spawnPos}, you don't need to request the model before this.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { Vehicle } from "redm/entities/Vehicle";
|
|
4
|
+
async function createVehicle(model, spawnPos, heading, isNetwork = false, bScriptHostVeh = true, bDontAutoCreateDraftAnimals = true, p8 = true) {
|
|
5
|
+
if (!model.IsPed || !model.request(1e3)) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
const pedHandle = CreateVehicle(
|
|
9
|
+
model.Hash,
|
|
10
|
+
spawnPos.x,
|
|
11
|
+
spawnPos.y,
|
|
12
|
+
spawnPos.z,
|
|
13
|
+
heading,
|
|
14
|
+
isNetwork,
|
|
15
|
+
bScriptHostVeh,
|
|
16
|
+
bDontAutoCreateDraftAnimals,
|
|
17
|
+
p8
|
|
18
|
+
);
|
|
19
|
+
if (pedHandle !== 0) {
|
|
20
|
+
model.markAsNoLongerNeeded();
|
|
21
|
+
return new Vehicle(pedHandle);
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
__name(createVehicle, "createVehicle");
|
|
26
|
+
export {
|
|
27
|
+
createVehicle
|
|
28
|
+
};
|
package/common/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Vector2 } from "./Vector";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Vector3 } from "./Vector";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Vector4 } from "./Vector";
|
package/common/utils/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./Vector2";
|
|
2
|
-
export * from "./Vector3";
|
|
3
|
-
export * from "./Vector4";
|
|
4
|
-
export * from "./PointF";
|
|
5
|
-
export * from "./Maths";
|
|
6
|
-
export * from "./Quaternion";
|
|
7
|
-
export * from "./Color";
|
|
8
|
-
export { cleanPlayerName } from "./cleanPlayerName";
|
|
9
|
-
export declare const Delay: (milliseconds: number) => Promise<void>;
|
|
10
|
-
export { enumValues } from "./enumValues";
|
|
11
|
-
export { getStringFromUInt8Array } from "./getStringFromUInt8Array";
|
|
12
|
-
export { getUInt32FromUint8Array } from "./getUInt32FromUint8Array";
|
package/entities/index.d.ts
DELETED
package/enums/index.d.ts
DELETED
package/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./entities/index";
|
|
2
|
-
export * from "./enums/index";
|
|
3
|
-
export * from "./Volume";
|
|
4
|
-
export * from "./Controls";
|
|
5
|
-
export * from "./RawControls";
|
|
6
|
-
export * from "./Game";
|
|
7
|
-
export * from "./world";
|
|
8
|
-
export * from "./GameConstants";
|
|
9
|
-
export * from "./RelationshipGroup";
|
|
10
|
-
export * from "./Attribute";
|
|
11
|
-
export * from "./Model";
|
|
12
|
-
export * from "./common/index";
|
package/utils/index.d.ts
DELETED
package/world/index.d.ts
DELETED
|
File without changes
|