@nativewrappers/fivem 0.0.13 → 0.0.15
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/client/Blip.d.ts +2 -3
- package/client/Blip.js +2 -2
- package/client/Events.js +2 -2
- package/client/Tasks.d.ts +3 -3
- package/client/Tasks.js +3 -3
- package/client/models/BaseEntity.d.ts +1 -0
- package/client/models/BaseEntity.js +7 -0
- package/client/models/Entity.d.ts +1 -9
- package/client/models/Entity.js +25 -24
- package/client/models/Player.d.ts +4 -4
- package/client/models/Player.js +4 -4
- package/client/models/index.d.ts +0 -1
- package/client/models/index.js +1 -1
- package/package.json +1 -1
- package/client/types/EntityType.d.ts +0 -2
- package/client/types/EntityType.js +0 -1
package/client/Blip.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Vector3 } from './utils';
|
|
2
2
|
import { BlipColor, BlipSprite } from './enums';
|
|
3
|
-
import { Player } from './models';
|
|
4
|
-
import { EntityType } from './types/EntityType';
|
|
3
|
+
import { BaseEntity, Player } from './models';
|
|
5
4
|
export declare class Blip {
|
|
6
5
|
protected handle: number;
|
|
7
6
|
constructor(handle: number);
|
|
@@ -22,7 +21,7 @@ export declare class Blip {
|
|
|
22
21
|
set Display(display: number);
|
|
23
22
|
set Name(name: string);
|
|
24
23
|
setNameToPlayerName(player: Player): void;
|
|
25
|
-
get Entity():
|
|
24
|
+
get Entity(): BaseEntity | null;
|
|
26
25
|
set ShowHeadingIndicator(show: boolean);
|
|
27
26
|
set ShowRoute(show: boolean);
|
|
28
27
|
set IsFriendly(friendly: boolean);
|
package/client/Blip.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3 } from './utils';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseEntity } from './models';
|
|
3
3
|
export class Blip {
|
|
4
4
|
constructor(handle) {
|
|
5
5
|
this.handle = handle;
|
|
@@ -58,7 +58,7 @@ export class Blip {
|
|
|
58
58
|
SetBlipNameToPlayerName(this.handle, player.Handle);
|
|
59
59
|
}
|
|
60
60
|
get Entity() {
|
|
61
|
-
return
|
|
61
|
+
return new BaseEntity(GetBlipInfoIdEntityIndex(this.handle));
|
|
62
62
|
}
|
|
63
63
|
set ShowHeadingIndicator(show) {
|
|
64
64
|
ShowHeadingIndicatorOnBlip(this.handle, show);
|
package/client/Events.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Vector4 } from './utils/Vector4';
|
|
|
7
7
|
import { Player } from './models/Player';
|
|
8
8
|
import { Prop } from './models/Prop';
|
|
9
9
|
import { Vehicle } from './models/Vehicle';
|
|
10
|
-
import {
|
|
10
|
+
import { BaseEntity } from './models';
|
|
11
11
|
const getClassFromArguments = (...args) => {
|
|
12
12
|
const newArgs = [];
|
|
13
13
|
for (const arg of args) {
|
|
@@ -41,7 +41,7 @@ const getClassFromArguments = (...args) => {
|
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
43
|
case ClassTypes.Entity: {
|
|
44
|
-
newArgs.push(
|
|
44
|
+
newArgs.push(BaseEntity.fromNetworkId(arg.netId));
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
47
|
default: {
|
package/client/Tasks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimationFlags, DrivingStyle, FiringPattern, LeaveVehicleFlags, VehicleSeat } from './enums';
|
|
2
|
-
import {
|
|
2
|
+
import { Ped, Vehicle } from './models';
|
|
3
3
|
import { BaseEntity } from './models/BaseEntity';
|
|
4
4
|
import { TaskSequence } from './TaskSequence';
|
|
5
5
|
import { Vector3 } from './utils';
|
|
@@ -32,7 +32,7 @@ export declare class Tasks {
|
|
|
32
32
|
guardCurrentPosition(): void;
|
|
33
33
|
handsUp(duration: number): void;
|
|
34
34
|
landPlane(startPosition: Vector3, touchdownPosition: Vector3, plane?: Vehicle | null): void;
|
|
35
|
-
lookAt(targetOrPosition:
|
|
35
|
+
lookAt(targetOrPosition: BaseEntity | Vector3, duration?: number): void;
|
|
36
36
|
parachuteTo(position: Vector3): void;
|
|
37
37
|
parkVehicle(vehicle: Vehicle, position: Vector3, heading: number, radius?: number, keepEngineOn?: boolean): void;
|
|
38
38
|
performSequence(sequence: TaskSequence): void;
|
|
@@ -46,7 +46,7 @@ export declare class Tasks {
|
|
|
46
46
|
standStill(duration: number): void;
|
|
47
47
|
startScenario(name: string, position: Vector3, heading?: number, duration?: number, sittingScenario?: boolean, teleport?: boolean): void;
|
|
48
48
|
swapWeapon(): void;
|
|
49
|
-
turnTo(targetOrPosition:
|
|
49
|
+
turnTo(targetOrPosition: BaseEntity | Vector3, duration?: number): void;
|
|
50
50
|
useParachute(): void;
|
|
51
51
|
useMobilePhone(duration?: number): void;
|
|
52
52
|
putAwayParachute(): void;
|
package/client/Tasks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DrivingStyle, FiringPattern, VehicleSeat, } from './enums';
|
|
2
|
-
import {
|
|
2
|
+
import { Ped } from './models';
|
|
3
3
|
import { BaseEntity } from './models/BaseEntity';
|
|
4
4
|
import { Vector3 } from './utils';
|
|
5
5
|
import { LoadAnimDict } from './utils/Animations';
|
|
@@ -122,7 +122,7 @@ export class Tasks {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
lookAt(targetOrPosition, duration = -1) {
|
|
125
|
-
if (targetOrPosition instanceof
|
|
125
|
+
if (targetOrPosition instanceof BaseEntity)
|
|
126
126
|
TaskLookAtEntity(this.ped.Handle, targetOrPosition.Handle, duration, 0, 2);
|
|
127
127
|
else
|
|
128
128
|
TaskLookAtCoord(this.ped.Handle, targetOrPosition.x, targetOrPosition.y, targetOrPosition.z, duration, 0, 2);
|
|
@@ -177,7 +177,7 @@ export class Tasks {
|
|
|
177
177
|
TaskSwapWeapon(this.ped.Handle, false);
|
|
178
178
|
}
|
|
179
179
|
turnTo(targetOrPosition, duration = -1) {
|
|
180
|
-
if (targetOrPosition instanceof
|
|
180
|
+
if (targetOrPosition instanceof BaseEntity)
|
|
181
181
|
TaskTurnPedToFaceEntity(this.ped.Handle, targetOrPosition.Handle, duration);
|
|
182
182
|
else
|
|
183
183
|
TaskTurnPedToFaceCoord(this.ped.Handle, targetOrPosition.x, targetOrPosition.y, targetOrPosition.z, duration);
|
|
@@ -10,6 +10,7 @@ import { StateBagChangeHandler } from '../cfx';
|
|
|
10
10
|
import { ClassTypes } from '../enums/ClassTypes';
|
|
11
11
|
export declare class BaseEntity {
|
|
12
12
|
static fromNetworkId(networkId: number): BaseEntity | null;
|
|
13
|
+
static fromStateBagName(stateBagName: string): BaseEntity | null;
|
|
13
14
|
protected handle: number;
|
|
14
15
|
protected bones: EntityBoneCollection | undefined;
|
|
15
16
|
protected stateBagCookies: number[];
|
|
@@ -9,6 +9,13 @@ export class BaseEntity {
|
|
|
9
9
|
static fromNetworkId(networkId) {
|
|
10
10
|
return new BaseEntity(NetworkGetEntityFromNetworkId(networkId));
|
|
11
11
|
}
|
|
12
|
+
static fromStateBagName(stateBagName) {
|
|
13
|
+
const entity = GetEntityFromStateBagName(stateBagName);
|
|
14
|
+
if (entity !== 0) {
|
|
15
|
+
return new BaseEntity(entity);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
12
19
|
constructor(handle) {
|
|
13
20
|
this.stateBagCookies = [];
|
|
14
21
|
this.netId = null;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ClassTypes } from '../enums/ClassTypes';
|
|
3
|
-
import { BaseEntity } from './BaseEntity';
|
|
4
|
-
export declare class Entity extends BaseEntity {
|
|
5
|
-
static fromHandle(handle: number): Ped | Vehicle | Prop | null;
|
|
6
|
-
static fromNetworkId(networkId: number): Ped | Vehicle | Prop | null;
|
|
7
|
-
protected type: ClassTypes;
|
|
8
|
-
constructor(handle: number);
|
|
9
|
-
}
|
|
1
|
+
export {};
|
package/client/models/Entity.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
1
|
+
export {};
|
|
2
|
+
// export class Entity extends BaseEntity {
|
|
3
|
+
// public static fromHandle(handle: number): Ped | Vehicle | Prop | null {
|
|
4
|
+
// switch (GetEntityType(handle)) {
|
|
5
|
+
// case 1:
|
|
6
|
+
// return new Ped(handle);
|
|
7
|
+
// case 2:
|
|
8
|
+
// return new Vehicle(handle);
|
|
9
|
+
// case 3:
|
|
10
|
+
// return new Prop(handle);
|
|
11
|
+
// default:
|
|
12
|
+
// return null;
|
|
13
|
+
// }
|
|
14
|
+
// }
|
|
15
|
+
//
|
|
16
|
+
// public static fromNetworkId(networkId: number): Ped | Vehicle | Prop | null {
|
|
17
|
+
// return this.fromHandle(NetworkGetEntityFromNetworkId(networkId));
|
|
18
|
+
// }
|
|
19
|
+
//
|
|
20
|
+
// protected type = ClassTypes.Entity;
|
|
21
|
+
//
|
|
22
|
+
// constructor(handle: number) {
|
|
23
|
+
// super(handle);
|
|
24
|
+
// }
|
|
25
|
+
// }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="@citizenfx/client" />
|
|
2
|
-
import {
|
|
2
|
+
import { Model, Color } from '..';
|
|
3
3
|
import { StateBagChangeHandler } from '../cfx';
|
|
4
|
-
import { Ped } from './';
|
|
4
|
+
import { BaseEntity, Ped } from './';
|
|
5
5
|
export declare class Player {
|
|
6
6
|
private handle;
|
|
7
7
|
private ped;
|
|
@@ -37,7 +37,7 @@ export declare class Player {
|
|
|
37
37
|
get PvPEnabled(): boolean;
|
|
38
38
|
set PvPEnabled(value: boolean);
|
|
39
39
|
get IsDead(): boolean;
|
|
40
|
-
get EntityPlayerIsAimingAt():
|
|
40
|
+
get EntityPlayerIsAimingAt(): BaseEntity | null;
|
|
41
41
|
get StealthNoise(): number;
|
|
42
42
|
get FakeWantedLevel(): number;
|
|
43
43
|
get PlayerGroup(): number;
|
|
@@ -57,7 +57,7 @@ export declare class Player {
|
|
|
57
57
|
/**
|
|
58
58
|
* The players melee target?
|
|
59
59
|
*/
|
|
60
|
-
get TargetEntity():
|
|
60
|
+
get TargetEntity(): BaseEntity | null;
|
|
61
61
|
get Team(): number;
|
|
62
62
|
CanPedHearPlayer(ped: Ped): boolean;
|
|
63
63
|
}
|
package/client/models/Player.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Model, Color } from '..';
|
|
2
2
|
import cfx from '../cfx';
|
|
3
3
|
import { ClassTypes } from '../enums/ClassTypes';
|
|
4
|
-
import { Ped } from './';
|
|
4
|
+
import { BaseEntity, Ped } from './';
|
|
5
5
|
export class Player {
|
|
6
6
|
static fromPedHandle(handle) {
|
|
7
7
|
return new Player(NetworkGetPlayerIndexFromPed(handle));
|
|
@@ -97,7 +97,7 @@ export class Player {
|
|
|
97
97
|
get EntityPlayerIsAimingAt() {
|
|
98
98
|
const [entityHit, entity] = GetEntityPlayerIsFreeAimingAt(this.handle);
|
|
99
99
|
if (entityHit) {
|
|
100
|
-
return
|
|
100
|
+
return new BaseEntity(entity);
|
|
101
101
|
}
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
@@ -160,7 +160,7 @@ export class Player {
|
|
|
160
160
|
get TargetEntity() {
|
|
161
161
|
const [entityHit, entity] = GetPlayerTargetEntity(this.handle);
|
|
162
162
|
if (entityHit) {
|
|
163
|
-
return
|
|
163
|
+
return new BaseEntity(entity);
|
|
164
164
|
}
|
|
165
165
|
return null;
|
|
166
166
|
}
|
package/client/models/index.d.ts
CHANGED
package/client/models/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|