@nativewrappers/fivem 0.0.11 → 0.0.13
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.
|
@@ -4,16 +4,11 @@ import { ForceType } from '../enums';
|
|
|
4
4
|
import { MaterialHash, WeaponHash } from '../hashes';
|
|
5
5
|
import { Model } from '../Model';
|
|
6
6
|
import { Quaternion, Vector3 } from '../utils';
|
|
7
|
-
import { EntityBoneCollection
|
|
7
|
+
import { EntityBoneCollection } from './';
|
|
8
8
|
import { EntityBone } from './EntityBone';
|
|
9
9
|
import { StateBagChangeHandler } from '../cfx';
|
|
10
|
-
import { Entity, Player } from '..';
|
|
11
10
|
import { ClassTypes } from '../enums/ClassTypes';
|
|
12
11
|
export declare class BaseEntity {
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated you should use class specific fromHandle instead of this wrapper
|
|
15
|
-
*/
|
|
16
|
-
static fromHandle(handle: number): Ped | Vehicle | Prop | null;
|
|
17
12
|
static fromNetworkId(networkId: number): BaseEntity | null;
|
|
18
13
|
protected handle: number;
|
|
19
14
|
protected bones: EntityBoneCollection | undefined;
|
|
@@ -41,7 +36,6 @@ export declare class BaseEntity {
|
|
|
41
36
|
listenForStateChange(keyFilter: string | null, handler: StateBagChangeHandler): number;
|
|
42
37
|
removeStateListener(tgtCookie: number): void;
|
|
43
38
|
get Owner(): number;
|
|
44
|
-
isPlayerOwner(player: Player): boolean;
|
|
45
39
|
get Speed(): number;
|
|
46
40
|
getSpeedVector(isRelative?: boolean): Vector3;
|
|
47
41
|
get ForwardVector(): Vector3;
|
|
@@ -124,10 +118,10 @@ export declare class BaseEntity {
|
|
|
124
118
|
get Bones(): EntityBoneCollection;
|
|
125
119
|
get AttachedBlip(): Blip | null;
|
|
126
120
|
attachBlip(): Blip;
|
|
127
|
-
setNoCollision(entity:
|
|
128
|
-
hasClearLosToEntity(entity:
|
|
129
|
-
hasClearLosToEntityInFront(entity:
|
|
130
|
-
hasBeenDamagedBy(entity:
|
|
121
|
+
setNoCollision(entity: BaseEntity, toggle: boolean): void;
|
|
122
|
+
hasClearLosToEntity(entity: BaseEntity, traceType?: number): boolean;
|
|
123
|
+
hasClearLosToEntityInFront(entity: BaseEntity): boolean;
|
|
124
|
+
hasBeenDamagedBy(entity: BaseEntity): boolean;
|
|
131
125
|
hasBeenDamagedByWeapon(weapon: WeaponHash): boolean;
|
|
132
126
|
hasBeenDamagedByAnyWeapon(): boolean;
|
|
133
127
|
hasBeenDamagedByAnyMeleeWeapon(): boolean;
|
|
@@ -135,8 +129,8 @@ export declare class BaseEntity {
|
|
|
135
129
|
isInArea(minBounds: Vector3, maxBounds: Vector3): boolean;
|
|
136
130
|
isInAngledArea(origin: Vector3, edge: Vector3, angle: number): boolean;
|
|
137
131
|
isInRangeOf(position: Vector3, range: number): boolean;
|
|
138
|
-
isNearEntity(entity:
|
|
139
|
-
isTouching(entity:
|
|
132
|
+
isNearEntity(entity: BaseEntity, bounds: Vector3): boolean;
|
|
133
|
+
isTouching(entity: BaseEntity): boolean;
|
|
140
134
|
isTouchingModel(model: Model): boolean;
|
|
141
135
|
/**
|
|
142
136
|
* @param offset: the amount to offset from the entity
|
|
@@ -144,12 +138,12 @@ export declare class BaseEntity {
|
|
|
144
138
|
*/
|
|
145
139
|
getOffsetPosition(offset: Vector3): Vector3;
|
|
146
140
|
getPositionOffset(worldCoords: Vector3): Vector3;
|
|
147
|
-
attachTo(entity:
|
|
141
|
+
attachTo(entity: BaseEntity, position: Vector3, rotation: Vector3, collisions?: boolean, unk9?: boolean, useSoftPinning?: boolean, rotationOrder?: number): void;
|
|
148
142
|
attachToBone(entityBone: EntityBone, position: Vector3, rotation: Vector3, collisions?: boolean, unk9?: boolean, useSoftPinning?: boolean, rotationOrder?: number): void;
|
|
149
143
|
detach(): void;
|
|
150
144
|
isAttached(): boolean;
|
|
151
|
-
isAttachedTo(entity:
|
|
152
|
-
getEntityAttachedTo():
|
|
145
|
+
isAttachedTo(entity: BaseEntity): boolean;
|
|
146
|
+
getEntityAttachedTo(): BaseEntity;
|
|
153
147
|
applyForce(direction: Vector3, rotation: Vector3, forceType?: ForceType): void;
|
|
154
148
|
applyForceRelative(direction: Vector3, rotation: Vector3, forceType?: ForceType): void;
|
|
155
149
|
/**
|
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
import { Blip } from '../Blip';
|
|
2
2
|
import { ForceType } from '../enums';
|
|
3
|
-
import { Game } from '../Game';
|
|
4
3
|
import { Model } from '../Model';
|
|
5
4
|
import { Quaternion, Vector3 } from '../utils';
|
|
6
|
-
import { EntityBoneCollection
|
|
5
|
+
import { EntityBoneCollection } from './';
|
|
7
6
|
import cfx from '../cfx';
|
|
8
|
-
import { Entity } from '..';
|
|
9
7
|
import { ClassTypes } from '../enums/ClassTypes';
|
|
10
8
|
export class BaseEntity {
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated you should use class specific fromHandle instead of this wrapper
|
|
13
|
-
*/
|
|
14
|
-
static fromHandle(handle) {
|
|
15
|
-
switch (GetEntityType(handle)) {
|
|
16
|
-
case 1:
|
|
17
|
-
return new Ped(handle);
|
|
18
|
-
case 2:
|
|
19
|
-
return new Vehicle(handle);
|
|
20
|
-
case 3:
|
|
21
|
-
return new Prop(handle);
|
|
22
|
-
default:
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
9
|
static fromNetworkId(networkId) {
|
|
27
10
|
return new BaseEntity(NetworkGetEntityFromNetworkId(networkId));
|
|
28
11
|
}
|
|
@@ -97,9 +80,9 @@ export class BaseEntity {
|
|
|
97
80
|
get Owner() {
|
|
98
81
|
return NetworkGetEntityOwner(this.handle);
|
|
99
82
|
}
|
|
100
|
-
isPlayerOwner(player) {
|
|
101
|
-
|
|
102
|
-
}
|
|
83
|
+
// public isPlayerOwner(player: Player): boolean {
|
|
84
|
+
// return this.Owner === player.Handle;
|
|
85
|
+
// }
|
|
103
86
|
get Speed() {
|
|
104
87
|
return GetEntitySpeed(this.handle);
|
|
105
88
|
}
|
|
@@ -418,7 +401,7 @@ export class BaseEntity {
|
|
|
418
401
|
return IsEntityAttachedToEntity(this.handle, entity.Handle);
|
|
419
402
|
}
|
|
420
403
|
getEntityAttachedTo() {
|
|
421
|
-
return
|
|
404
|
+
return new BaseEntity(GetEntityAttachedTo(this.handle));
|
|
422
405
|
}
|
|
423
406
|
applyForce(direction, rotation, forceType = ForceType.MaxForceRot2) {
|
|
424
407
|
ApplyForceToEntity(this.handle, Number(forceType), direction.x, direction.y, direction.z, rotation.x, rotation.y, rotation.z, 0, false, true, true, false, true);
|
|
@@ -442,12 +425,10 @@ export class BaseEntity {
|
|
|
442
425
|
return DoesEntityExist(this.handle);
|
|
443
426
|
}
|
|
444
427
|
delete() {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
RemoveStateBagChangeHandler(cookie);
|
|
450
|
-
}
|
|
428
|
+
this.IsMissionEntity = true;
|
|
429
|
+
DeleteEntity(this.handle);
|
|
430
|
+
for (const cookie of this.stateBagCookies) {
|
|
431
|
+
RemoveStateBagChangeHandler(cookie);
|
|
451
432
|
}
|
|
452
433
|
}
|
|
453
434
|
/**
|
package/client/models/index.d.ts
CHANGED
package/client/models/index.js
CHANGED
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.13",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"directory": "lib"
|
|
10
10
|
},
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
"./server": "./server/index.js",
|
|
14
14
|
"./client": "./client/index.js"
|
|
15
15
|
},
|
|
16
|
-
"sideEffects": [
|
|
17
|
-
"./client/src/models/**"
|
|
18
|
-
],
|
|
19
16
|
"repository": {
|
|
20
17
|
"type": "git",
|
|
21
18
|
"url": "https://github.com/nativewrappers/fivem.git"
|