@nativewrappers/redm 0.0.61 → 0.0.63
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/entities/BaseEntity.d.ts +6 -0
- package/entities/BaseEntity.js +12 -0
- package/entities/Entity.js +1 -0
- package/entities/Ped.d.ts +1 -9
- package/entities/Ped.js +7 -16
- package/entities/Vehicle.d.ts +7 -0
- package/entities/Vehicle.js +9 -0
- package/package.json +2 -2
package/entities/BaseEntity.d.ts
CHANGED
|
@@ -3,9 +3,15 @@ export declare class BaseEntity {
|
|
|
3
3
|
private handle;
|
|
4
4
|
constructor(entHandle: number);
|
|
5
5
|
replaceHandle(newHandle: number): void;
|
|
6
|
+
/**
|
|
7
|
+
* @returns Returns true if the entity handle is not 0 and exists in the game engine
|
|
8
|
+
*/
|
|
9
|
+
get Exists(): boolean;
|
|
6
10
|
get Handle(): number;
|
|
7
11
|
set Health(amount: number);
|
|
8
12
|
get Health(): number;
|
|
13
|
+
get Heading(): number;
|
|
14
|
+
set Heading(heading: number);
|
|
9
15
|
get Position(): Vector3;
|
|
10
16
|
set Position(pos: Vector3);
|
|
11
17
|
}
|
package/entities/BaseEntity.js
CHANGED
|
@@ -25,6 +25,12 @@ export class BaseEntity {
|
|
|
25
25
|
replaceHandle(newHandle) {
|
|
26
26
|
this.handle = newHandle;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @returns Returns true if the entity handle is not 0 and exists in the game engine
|
|
30
|
+
*/
|
|
31
|
+
get Exists() {
|
|
32
|
+
return this.handle !== 0 && DoesEntityExist(this.Handle);
|
|
33
|
+
}
|
|
28
34
|
get Handle() {
|
|
29
35
|
return this.handle;
|
|
30
36
|
}
|
|
@@ -34,6 +40,12 @@ export class BaseEntity {
|
|
|
34
40
|
get Health() {
|
|
35
41
|
return GetEntityHealth(this.Handle);
|
|
36
42
|
}
|
|
43
|
+
get Heading() {
|
|
44
|
+
return GetEntityHeading(this.Handle);
|
|
45
|
+
}
|
|
46
|
+
set Heading(heading) {
|
|
47
|
+
SetEntityHeading(this.Handle, heading);
|
|
48
|
+
}
|
|
37
49
|
get Position() {
|
|
38
50
|
return Vector3.fromArray(GetEntityCoords(this.handle, true, true));
|
|
39
51
|
}
|
package/entities/Entity.js
CHANGED
|
@@ -2,6 +2,7 @@ import { EntityType, ForceType } from "../enums/Entity";
|
|
|
2
2
|
import { _N } from "../utils";
|
|
3
3
|
import { BaseEntity } from "./BaseEntity";
|
|
4
4
|
export class Entity extends BaseEntity {
|
|
5
|
+
// NOTE: There is nothing stopping you from using creating an invalid entity, you should do your own due-diligence
|
|
5
6
|
constructor(handle) {
|
|
6
7
|
super(handle);
|
|
7
8
|
}
|
package/entities/Ped.d.ts
CHANGED
|
@@ -39,8 +39,6 @@ export declare class Ped extends BaseEntity {
|
|
|
39
39
|
get IsInjured(): boolean;
|
|
40
40
|
get IsFatallyInjured(): boolean;
|
|
41
41
|
get IsPlayer(): boolean;
|
|
42
|
-
get Heading(): number;
|
|
43
|
-
set Heading(heading: number);
|
|
44
42
|
get IsShooting(): boolean;
|
|
45
43
|
get Accuracy(): number;
|
|
46
44
|
set Accuracy(accuracy: number);
|
|
@@ -48,7 +46,7 @@ export declare class Ped extends BaseEntity {
|
|
|
48
46
|
get IsMale(): boolean;
|
|
49
47
|
get IsHuman(): boolean;
|
|
50
48
|
get IsOnTopOfVehicle(): boolean;
|
|
51
|
-
get Vehicle(): Vehicle;
|
|
49
|
+
get Vehicle(): Vehicle | null;
|
|
52
50
|
/**
|
|
53
51
|
* @returns the last mount that this ped was on, or null if it doesn't exist
|
|
54
52
|
*/
|
|
@@ -113,12 +111,6 @@ export declare class Ped extends BaseEntity {
|
|
|
113
111
|
*/
|
|
114
112
|
setOntoMount(targetPed: Ped, seatIndex: VehicleSeat): void;
|
|
115
113
|
removeFromMount(): void;
|
|
116
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
* @param seatIndex the seat index to check
|
|
119
|
-
* @returns true of the specified seat is free on the mount
|
|
120
|
-
*/
|
|
121
|
-
isSeatFree(seatIndex: VehicleSeat): boolean;
|
|
122
114
|
/**
|
|
123
115
|
* Sets the ped into the specified vehicle
|
|
124
116
|
* @param vehicle the vehicle to put the ped into
|
package/entities/Ped.js
CHANGED
|
@@ -57,12 +57,6 @@ export class Ped extends BaseEntity {
|
|
|
57
57
|
get IsPlayer() {
|
|
58
58
|
return IsPedAPlayer(this.Handle);
|
|
59
59
|
}
|
|
60
|
-
get Heading() {
|
|
61
|
-
return GetEntityHeading(this.Handle);
|
|
62
|
-
}
|
|
63
|
-
set Heading(heading) {
|
|
64
|
-
SetEntityHeading(this.Handle, heading);
|
|
65
|
-
}
|
|
66
60
|
get IsShooting() {
|
|
67
61
|
return IsPedShooting(this.Handle);
|
|
68
62
|
}
|
|
@@ -85,7 +79,11 @@ export class Ped extends BaseEntity {
|
|
|
85
79
|
return IsPedOnVehicle(this.Handle, false);
|
|
86
80
|
}
|
|
87
81
|
get Vehicle() {
|
|
88
|
-
|
|
82
|
+
const vehicle = GetVehiclePedIsIn(this.Handle, false);
|
|
83
|
+
if (vehicle === 0) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return new Vehicle(vehicle);
|
|
89
87
|
}
|
|
90
88
|
/**
|
|
91
89
|
* @returns the last mount that this ped was on, or null if it doesn't exist
|
|
@@ -194,7 +192,8 @@ export class Ped extends BaseEntity {
|
|
|
194
192
|
return _N("0x6CFC373008A1EDAF", this.Handle, Citizen.resultAsInteger());
|
|
195
193
|
}
|
|
196
194
|
set IsDamaged(damaged) {
|
|
197
|
-
|
|
195
|
+
// _SET_PED_DAMAGED
|
|
196
|
+
_N("0xDACE03C65C6666DB", this.Handle, damaged);
|
|
198
197
|
}
|
|
199
198
|
get DamageCleanliness() {
|
|
200
199
|
return _N("0x88EFFED5FE8B0B4A", this.Handle, Citizen.resultAsInteger());
|
|
@@ -257,14 +256,6 @@ export class Ped extends BaseEntity {
|
|
|
257
256
|
// REMOVE_PED_FROM_MOUNT
|
|
258
257
|
_N("0x5337B721C51883A9", this.Handle, true, true);
|
|
259
258
|
}
|
|
260
|
-
/**
|
|
261
|
-
*
|
|
262
|
-
* @param seatIndex the seat index to check
|
|
263
|
-
* @returns true of the specified seat is free on the mount
|
|
264
|
-
*/
|
|
265
|
-
isSeatFree(seatIndex) {
|
|
266
|
-
return _N("0xAAB0FE202E9FC9F0", this.Vehicle.Handle, seatIndex, Citizen.resultAsInteger());
|
|
267
|
-
}
|
|
268
259
|
/**
|
|
269
260
|
* Sets the ped into the specified vehicle
|
|
270
261
|
* @param vehicle the vehicle to put the ped into
|
package/entities/Vehicle.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import { VehicleSeat } from "../../redm/enums";
|
|
1
2
|
import { BaseEntity } from "./BaseEntity";
|
|
2
3
|
export declare class Vehicle extends BaseEntity {
|
|
3
4
|
constructor(handle: number);
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param seatIndex the seat index to check
|
|
8
|
+
* @returns true of the specified seat is free on the mount
|
|
9
|
+
*/
|
|
10
|
+
isSeatFree(seatIndex: VehicleSeat): boolean;
|
|
4
11
|
}
|
package/entities/Vehicle.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { BaseEntity } from "./BaseEntity";
|
|
2
|
+
import { _N } from "../../redm/utils";
|
|
2
3
|
export class Vehicle extends BaseEntity {
|
|
3
4
|
constructor(handle) {
|
|
4
5
|
super(handle);
|
|
5
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param seatIndex the seat index to check
|
|
10
|
+
* @returns true of the specified seat is free on the mount
|
|
11
|
+
*/
|
|
12
|
+
isSeatFree(seatIndex) {
|
|
13
|
+
return _N("0xAAB0FE202E9FC9F0", this.Handle, seatIndex, Citizen.resultAsInteger());
|
|
14
|
+
}
|
|
6
15
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"author": "Remco Troost <d0p3t>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.63",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/nativewrappers/nativewrappers.git"
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
".": "./index.js"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nativewrappers/common": "0.0.
|
|
31
|
+
"@nativewrappers/common": "0.0.63"
|
|
32
32
|
}
|
|
33
33
|
}
|