@nativewrappers/fivem 0.0.38 → 0.0.41
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/TaskSequence.d.ts +1 -1
- package/client/TaskSequence.js +6 -5
- package/client/Tasks.d.ts +2 -2
- package/client/Tasks.js +9 -5
- package/client/World.d.ts +2 -2
- package/client/enums/AnimationFlags.d.ts +31 -6
- package/client/enums/AnimationFlags.js +31 -6
- package/common/utils/Vector.js +2 -2
- package/package.json +1 -1
package/client/TaskSequence.d.ts
CHANGED
package/client/TaskSequence.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Tasks } from './Tasks';
|
|
2
2
|
// TODO: Figure out why this uses 'null ped'
|
|
3
3
|
export class TaskSequence {
|
|
4
4
|
constructor(handle) {
|
|
5
5
|
this.handle = 0;
|
|
6
6
|
handle === undefined ? this.create() : (this.handle = handle);
|
|
7
|
-
if (!TaskSequence.
|
|
8
|
-
TaskSequence.
|
|
7
|
+
if (!TaskSequence.nullTask) {
|
|
8
|
+
TaskSequence.nullTask = new Tasks(null);
|
|
9
9
|
}
|
|
10
10
|
this.isClosed = false;
|
|
11
11
|
this.count = 0;
|
|
12
12
|
}
|
|
13
13
|
create() {
|
|
14
14
|
// Docs generate this as 'void' even though it returns a number
|
|
15
|
-
|
|
15
|
+
// @ts-ignore ignore the fact that OpenSequenceTask expects a paramater
|
|
16
|
+
this.handle = OpenSequenceTask();
|
|
16
17
|
}
|
|
17
18
|
dispose() {
|
|
18
19
|
ClearSequenceTask(this.handle);
|
|
@@ -33,7 +34,7 @@ export class TaskSequence {
|
|
|
33
34
|
throw new Error("You can't add tasks to a closed sequence!");
|
|
34
35
|
}
|
|
35
36
|
this.count += 1;
|
|
36
|
-
return TaskSequence.
|
|
37
|
+
return TaskSequence.nullTask;
|
|
37
38
|
}
|
|
38
39
|
get IsClosed() {
|
|
39
40
|
return this.isClosed;
|
package/client/Tasks.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { TaskSequence } from './TaskSequence';
|
|
|
5
5
|
import { Vector3 } from './utils';
|
|
6
6
|
export declare class Tasks {
|
|
7
7
|
private ped;
|
|
8
|
-
constructor(ped: Ped);
|
|
8
|
+
constructor(ped: Ped | null);
|
|
9
9
|
achieveHeading(heading: number, timeout?: number): void;
|
|
10
10
|
blockTemporaryEvents(block?: boolean): void;
|
|
11
11
|
aimAt(target: BaseEntity | Vector3, duration: number): void;
|
|
@@ -27,7 +27,7 @@ export declare class Tasks {
|
|
|
27
27
|
fleeFrom(pedOrPosition: Ped | Vector3, duration?: number): void;
|
|
28
28
|
followPointRoute(points: Vector3[]): void;
|
|
29
29
|
followToOffsetFromEntity(target: BaseEntity, offset: Vector3, timeout: number, stoppingRange: number, movementSpeed?: number, persistFollowing?: boolean): void;
|
|
30
|
-
goTo(position: Vector3, ignorePaths?: boolean, timeout?: number, speed?: number): void;
|
|
30
|
+
goTo(position: Vector3, ignorePaths?: boolean, timeout?: number, speed?: number, targetHeading?: number, distanceToSlide?: number, flags?: number): void;
|
|
31
31
|
goToEntity(target: BaseEntity, offset?: Vector3 | null, timeout?: number): void;
|
|
32
32
|
guardCurrentPosition(): void;
|
|
33
33
|
handsUp(duration: number): void;
|
package/client/Tasks.js
CHANGED
|
@@ -4,8 +4,12 @@ import { BaseEntity } from './models/BaseEntity';
|
|
|
4
4
|
import { Vector3 } from './utils';
|
|
5
5
|
import { LoadAnimDict } from './utils/Animations';
|
|
6
6
|
export class Tasks {
|
|
7
|
+
// we take null because sequences have a null ped, if you pass null to this
|
|
8
|
+
// you betterk now what you're doing.
|
|
7
9
|
constructor(ped) {
|
|
8
|
-
|
|
10
|
+
const actualPed = ped ?? { handle: null };
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
this.ped = actualPed;
|
|
9
13
|
}
|
|
10
14
|
achieveHeading(heading, timeout = 0) {
|
|
11
15
|
TaskAchieveHeading(this.ped.Handle, heading, timeout);
|
|
@@ -90,12 +94,12 @@ export class Tasks {
|
|
|
90
94
|
followToOffsetFromEntity(target, offset, timeout, stoppingRange, movementSpeed = 1, persistFollowing = true) {
|
|
91
95
|
TaskFollowToOffsetOfEntity(this.ped.Handle, target.Handle, offset.x, offset.y, offset.z, movementSpeed, timeout, stoppingRange, persistFollowing);
|
|
92
96
|
}
|
|
93
|
-
goTo(position, ignorePaths = false, timeout = -1, speed = 1) {
|
|
97
|
+
goTo(position, ignorePaths = false, timeout = -1, speed = 1, targetHeading = 0, distanceToSlide = 0, flags = 0) {
|
|
94
98
|
if (ignorePaths) {
|
|
95
|
-
TaskGoStraightToCoord(this.ped.Handle, position.x, position.y, position.z, speed, timeout,
|
|
99
|
+
TaskGoStraightToCoord(this.ped.Handle, position.x, position.y, position.z, speed, timeout, targetHeading, distanceToSlide);
|
|
96
100
|
}
|
|
97
101
|
else {
|
|
98
|
-
TaskFollowNavMeshToCoord(this.ped.Handle, position.x, position.y, position.z, speed, timeout, 0,
|
|
102
|
+
TaskFollowNavMeshToCoord(this.ped.Handle, position.x, position.y, position.z, speed, timeout, 0, flags, targetHeading);
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
goToEntity(target, offset = null, timeout = -1) {
|
|
@@ -138,7 +142,7 @@ export class Tasks {
|
|
|
138
142
|
sequence.close();
|
|
139
143
|
}
|
|
140
144
|
this.clearAll();
|
|
141
|
-
this.ped.BlockPermanentEvents = true;
|
|
145
|
+
// this.ped.BlockPermanentEvents = true;
|
|
142
146
|
TaskPerformSequence(this.ped.Handle, sequence.Handle);
|
|
143
147
|
}
|
|
144
148
|
async playAnimation(animDict, animName, blendInSpeed, blendOutSpeed, duration, playbackRate, flags) {
|
package/client/World.d.ts
CHANGED
|
@@ -363,8 +363,8 @@ export declare abstract class World {
|
|
|
363
363
|
* @returns {@see AsynchronousRaycastResult} object that must be awaited to get its results.
|
|
364
364
|
*/
|
|
365
365
|
static raycast(start: Vector3, end: Vector3, losFlags?: IntersectFlags, shapeTestOptions?: number, ignoreEntity?: BaseEntity): AsynchronousRaycastResult;
|
|
366
|
-
static raycastDirection(useExpensiveRaycast: true, source: Vector3, direction: Vector3, maxDistance: number): SynchronousRaycastResult;
|
|
367
|
-
static raycastDirection(useExpensiveRaycast: false, source: Vector3, direction: Vector3, maxDistance: number): AsynchronousRaycastResult;
|
|
366
|
+
static raycastDirection(useExpensiveRaycast: true, source: Vector3, direction: Vector3, maxDistance: number, losFlags?: IntersectFlags, shapeTestOptions?: number, ignoreEntity?: BaseEntity): SynchronousRaycastResult;
|
|
367
|
+
static raycastDirection(useExpensiveRaycast: false, source: Vector3, direction: Vector3, maxDistance: number, losFlags?: IntersectFlags, shapeTestOptions?: number, ignoreEntity?: BaseEntity): AsynchronousRaycastResult;
|
|
368
368
|
/**
|
|
369
369
|
* Cast a ray from the local players camera until it hits an entity
|
|
370
370
|
*
|
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
export declare enum AnimationFlags {
|
|
2
2
|
None = 0,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Looping = 1,
|
|
4
|
+
HoldLastFrame = 2,
|
|
5
|
+
RepositionWhenFinished = 4,
|
|
6
|
+
NotInterruptible = 8,
|
|
7
|
+
UpperBody = 16,
|
|
8
|
+
Secondary = 32,
|
|
9
|
+
ReorientWhenFinished = 64,
|
|
10
|
+
AbortOnPedMovement = 128,
|
|
11
|
+
Additive = 256,
|
|
12
|
+
TurnOffCollision = 512,
|
|
13
|
+
OverridePhysics = 1024,
|
|
14
|
+
IgnorePhysics = 2048,
|
|
15
|
+
ExtractInitialOffset = 4096,
|
|
16
|
+
ExitAfterInterrupted = 8192,
|
|
17
|
+
TagSyncIn = 16384,
|
|
18
|
+
TagSyncOut = 32768,
|
|
19
|
+
TagSyncContinous = 65536,
|
|
20
|
+
ForceStart = 131072,
|
|
21
|
+
UseKinematicPhysics = 262144,
|
|
22
|
+
UseMoverExtrations = 524288,
|
|
23
|
+
HideWeapon = 1048576,
|
|
24
|
+
EndsInDeadPose = 2097152,
|
|
25
|
+
ActivateRagdoolOnCollision = 4194304,
|
|
26
|
+
DontExitOnDeath = 8388608,
|
|
27
|
+
AbortOnWeaponDamage = 16777216,
|
|
28
|
+
DisableForcedPhysicsUpdate = 33554432,
|
|
29
|
+
ProcessAttachmentsOnStart = 67108864,
|
|
30
|
+
ExpandPedCapsuleFromSkeleton = 134217728,
|
|
31
|
+
UseAlternativeFpAnim = 268435456,
|
|
32
|
+
BlendOutWrtLastFrame = 536870912,
|
|
33
|
+
UseFullBlending = 1073741824
|
|
9
34
|
}
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
export var AnimationFlags;
|
|
2
2
|
(function (AnimationFlags) {
|
|
3
3
|
AnimationFlags[AnimationFlags["None"] = 0] = "None";
|
|
4
|
-
AnimationFlags[AnimationFlags["
|
|
5
|
-
AnimationFlags[AnimationFlags["
|
|
6
|
-
AnimationFlags[AnimationFlags["
|
|
7
|
-
AnimationFlags[AnimationFlags["
|
|
8
|
-
AnimationFlags[AnimationFlags["
|
|
9
|
-
AnimationFlags[AnimationFlags["
|
|
4
|
+
AnimationFlags[AnimationFlags["Looping"] = 1] = "Looping";
|
|
5
|
+
AnimationFlags[AnimationFlags["HoldLastFrame"] = 2] = "HoldLastFrame";
|
|
6
|
+
AnimationFlags[AnimationFlags["RepositionWhenFinished"] = 4] = "RepositionWhenFinished";
|
|
7
|
+
AnimationFlags[AnimationFlags["NotInterruptible"] = 8] = "NotInterruptible";
|
|
8
|
+
AnimationFlags[AnimationFlags["UpperBody"] = 16] = "UpperBody";
|
|
9
|
+
AnimationFlags[AnimationFlags["Secondary"] = 32] = "Secondary";
|
|
10
|
+
AnimationFlags[AnimationFlags["ReorientWhenFinished"] = 64] = "ReorientWhenFinished";
|
|
11
|
+
AnimationFlags[AnimationFlags["AbortOnPedMovement"] = 128] = "AbortOnPedMovement";
|
|
12
|
+
AnimationFlags[AnimationFlags["Additive"] = 256] = "Additive";
|
|
13
|
+
AnimationFlags[AnimationFlags["TurnOffCollision"] = 512] = "TurnOffCollision";
|
|
14
|
+
AnimationFlags[AnimationFlags["OverridePhysics"] = 1024] = "OverridePhysics";
|
|
15
|
+
AnimationFlags[AnimationFlags["IgnorePhysics"] = 2048] = "IgnorePhysics";
|
|
16
|
+
AnimationFlags[AnimationFlags["ExtractInitialOffset"] = 4096] = "ExtractInitialOffset";
|
|
17
|
+
AnimationFlags[AnimationFlags["ExitAfterInterrupted"] = 8192] = "ExitAfterInterrupted";
|
|
18
|
+
AnimationFlags[AnimationFlags["TagSyncIn"] = 16384] = "TagSyncIn";
|
|
19
|
+
AnimationFlags[AnimationFlags["TagSyncOut"] = 32768] = "TagSyncOut";
|
|
20
|
+
AnimationFlags[AnimationFlags["TagSyncContinous"] = 65536] = "TagSyncContinous";
|
|
21
|
+
AnimationFlags[AnimationFlags["ForceStart"] = 131072] = "ForceStart";
|
|
22
|
+
AnimationFlags[AnimationFlags["UseKinematicPhysics"] = 262144] = "UseKinematicPhysics";
|
|
23
|
+
AnimationFlags[AnimationFlags["UseMoverExtrations"] = 524288] = "UseMoverExtrations";
|
|
24
|
+
AnimationFlags[AnimationFlags["HideWeapon"] = 1048576] = "HideWeapon";
|
|
25
|
+
AnimationFlags[AnimationFlags["EndsInDeadPose"] = 2097152] = "EndsInDeadPose";
|
|
26
|
+
AnimationFlags[AnimationFlags["ActivateRagdoolOnCollision"] = 4194304] = "ActivateRagdoolOnCollision";
|
|
27
|
+
AnimationFlags[AnimationFlags["DontExitOnDeath"] = 8388608] = "DontExitOnDeath";
|
|
28
|
+
AnimationFlags[AnimationFlags["AbortOnWeaponDamage"] = 16777216] = "AbortOnWeaponDamage";
|
|
29
|
+
AnimationFlags[AnimationFlags["DisableForcedPhysicsUpdate"] = 33554432] = "DisableForcedPhysicsUpdate";
|
|
30
|
+
AnimationFlags[AnimationFlags["ProcessAttachmentsOnStart"] = 67108864] = "ProcessAttachmentsOnStart";
|
|
31
|
+
AnimationFlags[AnimationFlags["ExpandPedCapsuleFromSkeleton"] = 134217728] = "ExpandPedCapsuleFromSkeleton";
|
|
32
|
+
AnimationFlags[AnimationFlags["UseAlternativeFpAnim"] = 268435456] = "UseAlternativeFpAnim";
|
|
33
|
+
AnimationFlags[AnimationFlags["BlendOutWrtLastFrame"] = 536870912] = "BlendOutWrtLastFrame";
|
|
34
|
+
AnimationFlags[AnimationFlags["UseFullBlending"] = 1073741824] = "UseFullBlending";
|
|
10
35
|
})(AnimationFlags || (AnimationFlags = {}));
|
package/common/utils/Vector.js
CHANGED