@nativewrappers/fivem 0.0.79 → 0.0.81
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/Audio.d.ts +2 -2
- package/Audio.js +99 -0
- package/Blip.d.ts +4 -3
- package/Blip.js +113 -0
- package/Camera.d.ts +3 -3
- package/Camera.js +190 -0
- package/Checkpoint.d.ts +2 -2
- package/Checkpoint.js +51 -0
- package/Events.js +80 -0
- package/Game.d.ts +10 -3
- package/Game.js +478 -0
- package/GameplayCamera.d.ts +2 -2
- package/GameplayCamera.js +152 -0
- package/Model.js +210 -0
- package/NetworkedScene.d.ts +2 -1
- package/NetworkedScene.js +50 -0
- package/ParticleEffect.d.ts +4 -3
- package/ParticleEffect.js +128 -0
- package/ParticleEffectAsset.d.ts +2 -2
- package/ParticleEffectAsset.js +133 -0
- package/Pickup.d.ts +1 -1
- package/Pickup.js +27 -0
- package/Raycast.d.ts +5 -3
- package/Raycast.js +132 -0
- package/RelationshipGroup.d.ts +1 -1
- package/RelationshipGroup.js +72 -0
- package/Rope.d.ts +1 -1
- package/Rope.js +149 -0
- package/TaskSequence.js +52 -0
- package/Tasks.d.ts +8 -3
- package/Tasks.js +334 -0
- package/World.d.ts +13 -4
- package/World.js +945 -0
- package/cfx/StateBagChangeHandler.js +0 -0
- package/cfx/index.d.ts +1 -1
- package/cfx/index.js +4 -0
- package/common/Command.js +111 -0
- package/common/Convar.js +58 -0
- package/common/GlobalData.js +16 -0
- package/common/Kvp.js +137 -0
- package/common/Resource.js +54 -0
- package/common/decors/Events.js +170 -0
- package/common/net/NetworkedMap.js +225 -0
- package/common/types.js +0 -0
- package/common/utils/ClassTypes.js +15 -0
- package/common/utils/Color.js +33 -0
- package/common/utils/Delay.d.ts +1 -0
- package/common/utils/Delay.js +6 -0
- package/common/utils/Maths.js +18 -0
- package/common/utils/Point.d.ts +9 -0
- package/common/utils/Point.js +36 -0
- package/common/utils/PointF.d.ts +1 -1
- package/common/utils/PointF.js +18 -0
- package/common/utils/Quaternion.d.ts +1 -1
- package/common/utils/Quaternion.js +33 -0
- package/common/utils/Vector.js +589 -0
- package/common/utils/cleanPlayerName.js +17 -0
- package/common/utils/enumValues.js +20 -0
- package/common/utils/getStringFromUInt8Array.js +6 -0
- package/common/utils/getUInt32FromUint8Array.js +6 -0
- package/enums/Alignment.js +9 -0
- package/enums/AnimationFlags.js +38 -0
- package/enums/AudioFlag.js +41 -0
- package/enums/BadgeStyle.js +186 -0
- package/enums/Blip.js +229 -0
- package/enums/Bone.js +105 -0
- package/enums/CameraShake.js +17 -0
- package/enums/CameraTypes.js +11 -0
- package/enums/CheckboxStyle.js +8 -0
- package/enums/Checkpoint.js +68 -0
- package/enums/CloudHat.js +27 -0
- package/enums/Control.js +364 -0
- package/enums/CursorSprite.js +18 -0
- package/enums/Driving.js +38 -0
- package/enums/ExplosionType.js +45 -0
- package/enums/FiringPattern.js +23 -0
- package/enums/Font.js +11 -0
- package/enums/ForceType.js +12 -0
- package/enums/Gender.js +8 -0
- package/enums/HelmetType.js +9 -0
- package/enums/HudColor.js +187 -0
- package/enums/HudComponent.js +57 -0
- package/enums/InputMode.js +8 -0
- package/enums/InvertAxis.js +10 -0
- package/enums/Language.js +18 -0
- package/enums/LeaveVehicleFlags.js +14 -0
- package/enums/LoadingSpinnerType.js +11 -0
- package/enums/MarkerType.js +48 -0
- package/enums/MenuAlignment.js +8 -0
- package/enums/NotificationType.js +14 -0
- package/enums/Parachute.js +19 -0
- package/enums/PickupType.js +77 -0
- package/enums/RadioStation.js +28 -0
- package/enums/RagdollType.js +10 -0
- package/enums/RaycastEnums.js +33 -0
- package/enums/Relationship.js +13 -0
- package/enums/RopeType.js +9 -0
- package/enums/ScreenEffect.js +87 -0
- package/enums/SpeechModifier.js +43 -0
- package/enums/Vehicle.js +396 -0
- package/enums/Weather.js +22 -0
- package/enums/ZoneID.js +95 -0
- package/hashes/MaterialHash.js +220 -0
- package/hashes/PedHash.js +728 -0
- package/hashes/VehicleHash.js +526 -0
- package/hashes/WeaponHash.js +155 -0
- package/hashes/WeatherTypeHash.js +22 -0
- package/interfaces/Dimensions.d.ts +1 -1
- package/interfaces/Dimensions.js +0 -0
- package/models/BaseEntity.d.ts +10 -8
- package/models/BaseEntity.js +576 -0
- package/models/Entity.d.ts +0 -1
- package/models/Entity.js +0 -0
- package/models/EntityBone.d.ts +1 -1
- package/models/EntityBone.js +32 -0
- package/models/EntityBoneCollection.d.ts +1 -1
- package/models/EntityBoneCollection.js +27 -0
- package/models/Ped.d.ts +13 -5
- package/models/Ped.js +711 -0
- package/models/PedBone.d.ts +3 -2
- package/models/PedBone.js +18 -0
- package/models/PedBoneCollection.d.ts +3 -1
- package/models/PedBoneCollection.js +31 -0
- package/models/Player.d.ts +4 -2
- package/models/Player.js +188 -0
- package/models/Prop.d.ts +1 -1
- package/models/Prop.js +34 -0
- package/models/Vehicle.d.ts +9 -4
- package/models/Vehicle.js +582 -0
- package/models/VehicleDoor.d.ts +1 -1
- package/models/VehicleDoor.js +52 -0
- package/models/VehicleDoorCollection.d.ts +1 -1
- package/models/VehicleDoorCollection.js +66 -0
- package/models/VehicleMod.d.ts +1 -1
- package/models/VehicleMod.js +43 -0
- package/models/VehicleModCollection.d.ts +2 -2
- package/models/VehicleModCollection.js +227 -0
- package/models/VehicleToggleMod.d.ts +1 -1
- package/models/VehicleToggleMod.js +37 -0
- package/models/VehicleWheel.js +31 -0
- package/models/VehicleWheelCollection.d.ts +1 -1
- package/models/VehicleWheelCollection.js +61 -0
- package/models/VehicleWindow.d.ts +1 -1
- package/models/VehicleWindow.js +43 -0
- package/models/VehicleWindowCollection.d.ts +1 -1
- package/models/VehicleWindowCollection.js +62 -0
- package/package.json +2 -2
- package/ui/Container.d.ts +4 -2
- package/ui/Container.js +39 -0
- package/ui/Effects.d.ts +1 -1
- package/ui/Effects.js +112 -0
- package/ui/Fading.js +74 -0
- package/ui/Hud.d.ts +3 -2
- package/ui/Hud.js +47 -0
- package/ui/InstructionalButtons.js +42 -0
- package/ui/LoadingPrompt.d.ts +1 -1
- package/ui/LoadingPrompt.js +37 -0
- package/ui/Notification.js +17 -0
- package/ui/Rectangle.d.ts +4 -2
- package/ui/Rectangle.js +46 -0
- package/ui/Scaleform.d.ts +2 -1
- package/ui/Scaleform.js +240 -0
- package/ui/Screen.d.ts +6 -3
- package/ui/Screen.js +83 -0
- package/ui/Sprite.d.ts +3 -1
- package/ui/Sprite.js +70 -0
- package/ui/Text.d.ts +6 -3
- package/ui/Text.js +119 -0
- package/ui/Timerbar.js +241 -0
- package/ui/interfaces/IButton.d.ts +1 -1
- package/ui/interfaces/IButton.js +0 -0
- package/ui/interfaces/IDrawable.d.ts +3 -1
- package/ui/interfaces/IDrawable.js +0 -0
- package/ui/menu/Menu.d.ts +9 -4
- package/ui/menu/Menu.js +830 -0
- package/ui/menu/MenuControl.js +20 -0
- package/ui/menu/MenuControls.js +17 -0
- package/ui/menu/MenuSettings.d.ts +1 -1
- package/ui/menu/MenuSettings.js +57 -0
- package/ui/menu/items/UIMenuCheckboxItem.d.ts +3 -3
- package/ui/menu/items/UIMenuCheckboxItem.js +70 -0
- package/ui/menu/items/UIMenuItem.d.ts +10 -4
- package/ui/menu/items/UIMenuItem.js +1103 -0
- package/ui/menu/items/UIMenuListItem.d.ts +3 -3
- package/ui/menu/items/UIMenuListItem.js +118 -0
- package/ui/menu/items/UIMenuSeparatorItem.d.ts +1 -1
- package/ui/menu/items/UIMenuSeparatorItem.js +37 -0
- package/ui/menu/items/UIMenuSliderItem.d.ts +4 -3
- package/ui/menu/items/UIMenuSliderItem.js +180 -0
- package/ui/menu/items/panels/AbstractUIMenuPanel.d.ts +4 -3
- package/ui/menu/items/panels/AbstractUIMenuPanel.js +49 -0
- package/ui/menu/items/panels/UIMenuColorPanel.d.ts +3 -3
- package/ui/menu/items/panels/UIMenuColorPanel.js +215 -0
- package/ui/menu/items/panels/UIMenuGridPanel.d.ts +3 -3
- package/ui/menu/items/panels/UIMenuGridPanel.js +216 -0
- package/ui/menu/items/panels/UIMenuPercentagePanel.d.ts +2 -2
- package/ui/menu/items/panels/UIMenuPercentagePanel.js +138 -0
- package/ui/menu/items/panels/UIMenuStatisticsPanel.d.ts +3 -2
- package/ui/menu/items/panels/UIMenuStatisticsPanel.js +88 -0
- package/ui/menu/items/panels/UIMenuStatisticsPanelItem.d.ts +2 -1
- package/ui/menu/items/panels/UIMenuStatisticsPanelItem.js +48 -0
- package/ui/menu/modules/ListItem.js +18 -0
- package/utils/Animations.js +43 -0
- package/utils/Crypto.js +33 -0
- package/utils/LiteEvent.js +25 -0
- package/utils/Maths.js +18 -0
- package/utils/Point.js +36 -0
- package/utils/Size.js +16 -0
- package/utils/String.d.ts +1 -1
- package/utils/String.js +35 -0
- package/weapon/DlcWeaponData.d.ts +1 -1
- package/weapon/DlcWeaponData.js +40 -0
- package/weapon/Mk2WeaponHash.js +18 -0
- package/weapon/Weapon.d.ts +7 -7
- package/weapon/Weapon.js +276 -0
- package/weapon/WeaponAsset.d.ts +1 -1
- package/weapon/WeaponAsset.js +87 -0
- package/weapon/WeaponCollection.d.ts +3 -2
- package/weapon/WeaponCollection.js +179 -0
- package/weapon/WeaponDisplayNameByHash.d.ts +1 -1
- package/weapon/WeaponDisplayNameByHash.js +73 -0
- package/weapon/WeaponGroup.js +22 -0
- package/weapon/WeaponHudStats.d.ts +1 -1
- package/weapon/WeaponHudStats.js +33 -0
- package/weapon/WeaponLivery.js +17 -0
- package/weapon/WeaponLiveryColor.js +38 -0
- package/weapon/WeaponTint.js +46 -0
- package/weaponComponent/ComponentAttachmentPoint.js +22 -0
- package/weaponComponent/ComponentAttachmentPointByHash.js +307 -0
- package/weaponComponent/ComponentDisplayNameByHash.js +278 -0
- package/weaponComponent/DlcWeaponComponentData.js +40 -0
- package/weaponComponent/InvalidWeaponComponent.d.ts +1 -1
- package/weaponComponent/InvalidWeaponComponent.js +31 -0
- package/weaponComponent/WeaponComponent.d.ts +4 -4
- package/weaponComponent/WeaponComponent.js +124 -0
- package/weaponComponent/WeaponComponentCollection.d.ts +2 -2
- package/weaponComponent/WeaponComponentCollection.js +187 -0
- package/weaponComponent/WeaponComponentHash.js +670 -0
- package/weaponComponent/WeaponComponentHashesByWeaponHash.d.ts +1 -1
- package/weaponComponent/WeaponComponentHashesByWeaponHash.js +864 -0
- package/weaponComponent/WeaponComponentHudStats.js +33 -0
- package/common/index.d.ts +0 -8
- package/common/utils/Vector2.d.ts +0 -1
- package/common/utils/Vector3.d.ts +0 -1
- package/common/utils/Vector4.d.ts +0 -1
- package/common/utils/index.d.ts +0 -12
- package/enums/index.d.ts +0 -42
- package/hashes/index.d.ts +0 -5
- package/index.d.ts +0 -25
- package/index.js +0 -18794
- package/models/index.d.ts +0 -18
- package/ui/index.d.ts +0 -15
- package/ui/interfaces/index.d.ts +0 -2
- package/ui/menu/index.d.ts +0 -6
- package/ui/menu/items/index.d.ts +0 -6
- package/ui/menu/items/panels/index.d.ts +0 -6
- package/ui/menu/modules/index.d.ts +0 -1
- package/utils/PointF.d.ts +0 -7
- package/utils/Quaternion.d.ts +0 -10
- package/utils/enumValues.d.ts +0 -12
- package/utils/getStringFromUInt8Array.d.ts +0 -8
- package/utils/getUInt32FromUint8Array.d.ts +0 -8
- package/utils/index.d.ts +0 -9
- package/weapon/index.d.ts +0 -8
- package/weaponComponent/index.d.ts +0 -5
package/Tasks.js
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { Vector3 } from "./common/utils/Vector";
|
|
4
|
+
import { DrivingStyle } from "./enums/Driving";
|
|
5
|
+
import { FiringPattern } from "./enums/FiringPattern";
|
|
6
|
+
import { VehicleSeat } from "./enums/Vehicle";
|
|
7
|
+
import { BaseEntity } from "./models/BaseEntity";
|
|
8
|
+
import { Ped } from "./models/Ped";
|
|
9
|
+
import { LoadAnimDict } from "./utils/Animations";
|
|
10
|
+
class Tasks {
|
|
11
|
+
static {
|
|
12
|
+
__name(this, "Tasks");
|
|
13
|
+
}
|
|
14
|
+
ped;
|
|
15
|
+
// we take null because sequences have a null ped, if you pass null to this
|
|
16
|
+
// you betterk now what you're doing.
|
|
17
|
+
constructor(ped) {
|
|
18
|
+
const actualPed = ped ?? { handle: null };
|
|
19
|
+
this.ped = actualPed;
|
|
20
|
+
}
|
|
21
|
+
achieveHeading(heading, timeout = 0) {
|
|
22
|
+
TaskAchieveHeading(this.ped.Handle, heading, timeout);
|
|
23
|
+
}
|
|
24
|
+
blockTemporaryEvents(block = true) {
|
|
25
|
+
TaskSetBlockingOfNonTemporaryEvents(this.ped.Handle, block);
|
|
26
|
+
}
|
|
27
|
+
aimAt(target, duration) {
|
|
28
|
+
if (target instanceof BaseEntity) TaskAimGunAtEntity(this.ped.Handle, target.Handle, duration, false);
|
|
29
|
+
else TaskAimGunAtCoord(this.ped.Handle, target.x, target.y, target.z, duration, false, false);
|
|
30
|
+
}
|
|
31
|
+
arrest(ped) {
|
|
32
|
+
TaskArrestPed(this.ped.Handle, ped.Handle);
|
|
33
|
+
}
|
|
34
|
+
chatTo(ped) {
|
|
35
|
+
TaskChatToPed(this.ped.Handle, ped.Handle, 16, 0, 0, 0, 0, 0);
|
|
36
|
+
}
|
|
37
|
+
jump() {
|
|
38
|
+
TaskJump(this.ped.Handle, true);
|
|
39
|
+
}
|
|
40
|
+
climb() {
|
|
41
|
+
TaskClimb(this.ped.Handle, true);
|
|
42
|
+
}
|
|
43
|
+
climbLadder() {
|
|
44
|
+
TaskClimbLadder(this.ped.Handle, 1);
|
|
45
|
+
}
|
|
46
|
+
cower(duration) {
|
|
47
|
+
TaskCower(this.ped.Handle, duration);
|
|
48
|
+
}
|
|
49
|
+
chaseWithGroundVehicle(target) {
|
|
50
|
+
TaskVehicleChase(this.ped.Handle, target.Handle);
|
|
51
|
+
}
|
|
52
|
+
chaseWithHelicopter(target, offset) {
|
|
53
|
+
TaskHeliChase(this.ped.Handle, target.Handle, offset.x, offset.y, offset.z);
|
|
54
|
+
}
|
|
55
|
+
chaseWithPlane(target, offset) {
|
|
56
|
+
TaskPlaneChase(this.ped.Handle, target.Handle, offset.x, offset.y, offset.z);
|
|
57
|
+
}
|
|
58
|
+
cruiseWithVehicle(vehicle, speed, drivingstyle = DrivingStyle.None) {
|
|
59
|
+
TaskVehicleDriveWander(this.ped.Handle, vehicle.Handle, speed, drivingstyle);
|
|
60
|
+
}
|
|
61
|
+
driveTo(vehicle, target, radius, speed, drivingstyle = DrivingStyle.None) {
|
|
62
|
+
TaskVehicleDriveToCoordLongrange(
|
|
63
|
+
this.ped.Handle,
|
|
64
|
+
vehicle.Handle,
|
|
65
|
+
target.x,
|
|
66
|
+
target.y,
|
|
67
|
+
target.z,
|
|
68
|
+
speed,
|
|
69
|
+
drivingstyle,
|
|
70
|
+
radius
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
enterAnyVehicle(seat = VehicleSeat.Any, timeout = -1, speed = 0, flag = 0) {
|
|
74
|
+
TaskEnterVehicle(this.ped.Handle, 0, timeout, seat, speed, flag, 0);
|
|
75
|
+
}
|
|
76
|
+
static everyoneLeaveVehicle(vehicle) {
|
|
77
|
+
TaskEveryoneLeaveVehicle(vehicle.Handle);
|
|
78
|
+
}
|
|
79
|
+
fightAgainst(target, duration) {
|
|
80
|
+
if (duration) {
|
|
81
|
+
TaskCombatPedTimed(this.ped.Handle, target.Handle, duration, 0);
|
|
82
|
+
} else {
|
|
83
|
+
TaskCombatPed(this.ped.Handle, target.Handle, 0, 16);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
fightAgainstHatedTargets(radius, duration) {
|
|
87
|
+
if (duration) {
|
|
88
|
+
TaskCombatHatedTargetsAroundPedTimed(this.ped.Handle, radius, duration, 0);
|
|
89
|
+
} else {
|
|
90
|
+
TaskCombatHatedTargetsAroundPed(this.ped.Handle, radius, 0);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
fleeFrom(pedOrPosition, duration = -1) {
|
|
94
|
+
if (pedOrPosition instanceof Ped) {
|
|
95
|
+
TaskSmartFleePed(this.ped.Handle, pedOrPosition.Handle, 100, duration, false, false);
|
|
96
|
+
} else {
|
|
97
|
+
TaskSmartFleeCoord(
|
|
98
|
+
this.ped.Handle,
|
|
99
|
+
pedOrPosition.x,
|
|
100
|
+
pedOrPosition.y,
|
|
101
|
+
pedOrPosition.z,
|
|
102
|
+
100,
|
|
103
|
+
duration,
|
|
104
|
+
false,
|
|
105
|
+
false
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
followPointRoute(points) {
|
|
110
|
+
TaskFlushRoute();
|
|
111
|
+
points.forEach((point) => TaskExtendRoute(point.x, point.y, point.z));
|
|
112
|
+
TaskFollowPointRoute(this.ped.Handle, 1, 0);
|
|
113
|
+
}
|
|
114
|
+
followToOffsetFromEntity(target, offset, timeout, stoppingRange, movementSpeed = 1, persistFollowing = true) {
|
|
115
|
+
TaskFollowToOffsetOfEntity(
|
|
116
|
+
this.ped.Handle,
|
|
117
|
+
target.Handle,
|
|
118
|
+
offset.x,
|
|
119
|
+
offset.y,
|
|
120
|
+
offset.z,
|
|
121
|
+
movementSpeed,
|
|
122
|
+
timeout,
|
|
123
|
+
stoppingRange,
|
|
124
|
+
persistFollowing
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
goTo(position, ignorePaths = false, timeout = -1, speed = 1, targetHeading = 0, distanceToSlide = 0, flags = 0) {
|
|
128
|
+
if (ignorePaths) {
|
|
129
|
+
TaskGoStraightToCoord(
|
|
130
|
+
this.ped.Handle,
|
|
131
|
+
position.x,
|
|
132
|
+
position.y,
|
|
133
|
+
position.z,
|
|
134
|
+
speed,
|
|
135
|
+
timeout,
|
|
136
|
+
targetHeading,
|
|
137
|
+
distanceToSlide
|
|
138
|
+
);
|
|
139
|
+
} else {
|
|
140
|
+
TaskFollowNavMeshToCoord(
|
|
141
|
+
this.ped.Handle,
|
|
142
|
+
position.x,
|
|
143
|
+
position.y,
|
|
144
|
+
position.z,
|
|
145
|
+
speed,
|
|
146
|
+
timeout,
|
|
147
|
+
0,
|
|
148
|
+
flags,
|
|
149
|
+
targetHeading
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
goToEntity(target, offset = null, timeout = -1) {
|
|
154
|
+
if (offset === null) {
|
|
155
|
+
offset = new Vector3(0, 0, 0);
|
|
156
|
+
}
|
|
157
|
+
TaskGotoEntityOffsetXy(this.ped.Handle, target.Handle, timeout, offset.x, offset.y, offset.z, 1, true);
|
|
158
|
+
}
|
|
159
|
+
guardCurrentPosition() {
|
|
160
|
+
TaskGuardCurrentPosition(this.ped.Handle, 15, 10, true);
|
|
161
|
+
}
|
|
162
|
+
handsUp(duration) {
|
|
163
|
+
TaskHandsUp(this.ped.Handle, duration, 0, -1, false);
|
|
164
|
+
}
|
|
165
|
+
landPlane(startPosition, touchdownPosition, plane = null) {
|
|
166
|
+
if (plane === null) {
|
|
167
|
+
plane = this.ped.CurrentVehicle;
|
|
168
|
+
}
|
|
169
|
+
if (plane === null || !plane.exists() || plane.isDead()) {
|
|
170
|
+
TaskPlaneLand(
|
|
171
|
+
this.ped.Handle,
|
|
172
|
+
0,
|
|
173
|
+
startPosition.x,
|
|
174
|
+
startPosition.y,
|
|
175
|
+
startPosition.z,
|
|
176
|
+
touchdownPosition.x,
|
|
177
|
+
touchdownPosition.y,
|
|
178
|
+
touchdownPosition.z
|
|
179
|
+
);
|
|
180
|
+
} else {
|
|
181
|
+
TaskPlaneLand(
|
|
182
|
+
this.ped.Handle,
|
|
183
|
+
plane.Handle,
|
|
184
|
+
startPosition.x,
|
|
185
|
+
startPosition.y,
|
|
186
|
+
startPosition.z,
|
|
187
|
+
touchdownPosition.x,
|
|
188
|
+
touchdownPosition.y,
|
|
189
|
+
touchdownPosition.z
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
lookAt(targetOrPosition, duration = -1) {
|
|
194
|
+
if (targetOrPosition instanceof BaseEntity)
|
|
195
|
+
TaskLookAtEntity(this.ped.Handle, targetOrPosition.Handle, duration, 0, 2);
|
|
196
|
+
else TaskLookAtCoord(this.ped.Handle, targetOrPosition.x, targetOrPosition.y, targetOrPosition.z, duration, 0, 2);
|
|
197
|
+
}
|
|
198
|
+
parachuteTo(position) {
|
|
199
|
+
TaskParachuteToTarget(this.ped.Handle, position.x, position.y, position.z);
|
|
200
|
+
}
|
|
201
|
+
parkVehicle(vehicle, position, heading, radius = 20, keepEngineOn = false) {
|
|
202
|
+
TaskVehiclePark(
|
|
203
|
+
this.ped.Handle,
|
|
204
|
+
vehicle.Handle,
|
|
205
|
+
position.x,
|
|
206
|
+
position.y,
|
|
207
|
+
position.z,
|
|
208
|
+
heading,
|
|
209
|
+
1,
|
|
210
|
+
radius,
|
|
211
|
+
keepEngineOn
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
performSequence(sequence) {
|
|
215
|
+
if (!sequence.IsClosed) {
|
|
216
|
+
sequence.close();
|
|
217
|
+
}
|
|
218
|
+
this.clearAll();
|
|
219
|
+
TaskPerformSequence(this.ped.Handle, sequence.Handle);
|
|
220
|
+
}
|
|
221
|
+
async playAnimation(animDict, animName, blendInSpeed, blendOutSpeed, duration, playbackRate, flags) {
|
|
222
|
+
await LoadAnimDict(animDict);
|
|
223
|
+
TaskPlayAnim(
|
|
224
|
+
this.ped.Handle,
|
|
225
|
+
animDict,
|
|
226
|
+
animName,
|
|
227
|
+
blendInSpeed,
|
|
228
|
+
blendOutSpeed,
|
|
229
|
+
duration,
|
|
230
|
+
flags,
|
|
231
|
+
playbackRate,
|
|
232
|
+
false,
|
|
233
|
+
false,
|
|
234
|
+
false
|
|
235
|
+
);
|
|
236
|
+
RemoveAnimDict(animDict);
|
|
237
|
+
}
|
|
238
|
+
reactAndFlee(ped) {
|
|
239
|
+
TaskReactAndFleePed(this.ped.Handle, ped.Handle);
|
|
240
|
+
}
|
|
241
|
+
reloadWeapon() {
|
|
242
|
+
TaskReloadWeapon(this.ped.Handle, true);
|
|
243
|
+
}
|
|
244
|
+
shootAt(targetOrPosition, duration = -1, pattern = FiringPattern.Default) {
|
|
245
|
+
if (targetOrPosition instanceof Ped) TaskShootAtEntity(this.ped.Handle, targetOrPosition.Handle, duration, pattern);
|
|
246
|
+
else
|
|
247
|
+
TaskShootAtCoord(this.ped.Handle, targetOrPosition.x, targetOrPosition.y, targetOrPosition.z, duration, pattern);
|
|
248
|
+
}
|
|
249
|
+
shuffleToNextVehicleSeat(vehicle) {
|
|
250
|
+
TaskShuffleToNextVehicleSeat(this.ped.Handle, vehicle.Handle);
|
|
251
|
+
}
|
|
252
|
+
skyDive() {
|
|
253
|
+
TaskSkyDive(this.ped.Handle);
|
|
254
|
+
}
|
|
255
|
+
slideTo(position, heading, duration = 0.7) {
|
|
256
|
+
TaskPedSlideToCoord(this.ped.Handle, position.x, position.y, position.z, heading, duration);
|
|
257
|
+
}
|
|
258
|
+
standStill(duration) {
|
|
259
|
+
TaskStandStill(this.ped.Handle, duration);
|
|
260
|
+
}
|
|
261
|
+
startScenario(name, position, heading = 0, duration = 0, sittingScenario = false, teleport = true) {
|
|
262
|
+
TaskStartScenarioAtPosition(
|
|
263
|
+
this.ped.Handle,
|
|
264
|
+
name,
|
|
265
|
+
position.x,
|
|
266
|
+
position.y,
|
|
267
|
+
position.z,
|
|
268
|
+
heading,
|
|
269
|
+
duration,
|
|
270
|
+
sittingScenario,
|
|
271
|
+
teleport
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
swapWeapon() {
|
|
275
|
+
TaskSwapWeapon(this.ped.Handle, false);
|
|
276
|
+
}
|
|
277
|
+
turnTo(targetOrPosition, duration = -1) {
|
|
278
|
+
if (targetOrPosition instanceof BaseEntity)
|
|
279
|
+
TaskTurnPedToFaceEntity(this.ped.Handle, targetOrPosition.Handle, duration);
|
|
280
|
+
else TaskTurnPedToFaceCoord(this.ped.Handle, targetOrPosition.x, targetOrPosition.y, targetOrPosition.z, duration);
|
|
281
|
+
}
|
|
282
|
+
useParachute() {
|
|
283
|
+
TaskParachute(this.ped.Handle, true);
|
|
284
|
+
}
|
|
285
|
+
useMobilePhone(duration = 1) {
|
|
286
|
+
TaskUseMobilePhone(this.ped.Handle, duration);
|
|
287
|
+
}
|
|
288
|
+
putAwayParachute() {
|
|
289
|
+
TaskParachute(this.ped.Handle, false);
|
|
290
|
+
}
|
|
291
|
+
putAwayMobilePhone() {
|
|
292
|
+
TaskUseMobilePhone(this.ped.Handle, 0);
|
|
293
|
+
}
|
|
294
|
+
vehicleChase(target) {
|
|
295
|
+
TaskVehicleChase(this.ped.Handle, target.Handle);
|
|
296
|
+
}
|
|
297
|
+
vehicleShootAtPed(target) {
|
|
298
|
+
TaskVehicleShootAtPed(this.ped.Handle, target.Handle, 20);
|
|
299
|
+
}
|
|
300
|
+
wait(duration) {
|
|
301
|
+
TaskPause(this.ped.Handle, duration);
|
|
302
|
+
}
|
|
303
|
+
wanderAround(position, radius) {
|
|
304
|
+
if (position && radius) TaskWanderInArea(this.ped.Handle, position.x, position.y, position.z, radius, 0, 0);
|
|
305
|
+
else TaskWanderStandard(this.ped.Handle, 0, 0);
|
|
306
|
+
}
|
|
307
|
+
warpIntoVehicle(vehicle, seat) {
|
|
308
|
+
TaskWarpPedIntoVehicle(this.ped.Handle, vehicle.Handle, seat);
|
|
309
|
+
}
|
|
310
|
+
warpOutOfVehicle(vehicle, flags) {
|
|
311
|
+
TaskLeaveVehicle(this.ped.Handle, vehicle.Handle, flags);
|
|
312
|
+
}
|
|
313
|
+
isPlayingAnim(dict, anim, taskFlag = 3) {
|
|
314
|
+
return IsEntityPlayingAnim(this.ped.Handle, dict, anim, taskFlag);
|
|
315
|
+
}
|
|
316
|
+
clearAll() {
|
|
317
|
+
ClearPedTasks(this.ped.Handle);
|
|
318
|
+
}
|
|
319
|
+
clearAllImmediately() {
|
|
320
|
+
ClearPedTasksImmediately(this.ped.Handle);
|
|
321
|
+
}
|
|
322
|
+
clearLookAt() {
|
|
323
|
+
TaskClearLookAt(this.ped.Handle);
|
|
324
|
+
}
|
|
325
|
+
clearSecondary() {
|
|
326
|
+
ClearPedSecondaryTask(this.ped.Handle);
|
|
327
|
+
}
|
|
328
|
+
clearAnimation(animDict, animName) {
|
|
329
|
+
StopAnimTask(this.ped.Handle, animDict, animName, -4);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
export {
|
|
333
|
+
Tasks
|
|
334
|
+
};
|
package/World.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Color } from "./common/utils/Color";
|
|
2
2
|
import { Blip } from "./Blip";
|
|
3
3
|
import { Camera } from "./Camera";
|
|
4
|
-
import { CameraTypes
|
|
5
|
-
import {
|
|
4
|
+
import { CameraTypes } from "./enums/CameraTypes";
|
|
5
|
+
import { CloudHat } from "./enums/CloudHat";
|
|
6
|
+
import type { MarkerType } from "./enums/MarkerType";
|
|
7
|
+
import type { PickupType } from "./enums/PickupType";
|
|
8
|
+
import { IntersectFlags } from "./enums/RaycastEnums";
|
|
9
|
+
import type { RopeType } from "./enums/RopeType";
|
|
10
|
+
import { Weather } from "./enums/Weather";
|
|
11
|
+
import { Model } from "./Model";
|
|
6
12
|
import type { BaseEntity } from "./models/BaseEntity";
|
|
13
|
+
import { Ped } from "./models/Ped";
|
|
14
|
+
import { Prop } from "./models/Prop";
|
|
15
|
+
import { Vehicle } from "./models/Vehicle";
|
|
7
16
|
import { Pickup } from "./Pickup";
|
|
8
17
|
import { AsynchronousRaycastResult, SynchronousRaycastResult } from "./Raycast";
|
|
9
18
|
import { Rope } from "./Rope";
|
|
10
|
-
import {
|
|
19
|
+
import { Vector3 } from "./common/utils/Vector";
|
|
11
20
|
/**
|
|
12
21
|
* Class with common world manipulations.
|
|
13
22
|
*
|