@nativewrappers/fivem 0.0.14 → 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/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: {
|
|
@@ -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 {};
|