@nativewrappers/fivem 0.0.80 → 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/Audio.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Vector3 } from "./common/utils/Vector";
|
|
2
|
+
import type { AudioFlag } from "./enums/AudioFlag";
|
|
2
3
|
import type { BaseEntity } from "./models/BaseEntity";
|
|
3
|
-
import type { Vector3 } from "./utils";
|
|
4
4
|
export declare abstract class Audio {
|
|
5
5
|
static playSoundAt(position: Vector3, sound: string, set?: string, generateSoundId?: boolean): number;
|
|
6
6
|
static playSoundFromEntity(entity: BaseEntity, sound: string, set?: string, generateSoundId?: boolean): number;
|
package/Audio.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
class Audio {
|
|
4
|
+
static {
|
|
5
|
+
__name(this, "Audio");
|
|
6
|
+
}
|
|
7
|
+
static playSoundAt(position, sound, set, generateSoundId = true) {
|
|
8
|
+
const SOUND_ID = generateSoundId ? GetSoundId() : -1;
|
|
9
|
+
PlaySoundFromCoord(SOUND_ID, sound, position.x, position.y, position.z, set ?? "", false, 0, false);
|
|
10
|
+
return SOUND_ID;
|
|
11
|
+
}
|
|
12
|
+
static playSoundFromEntity(entity, sound, set, generateSoundId = true) {
|
|
13
|
+
const SOUND_ID = generateSoundId ? GetSoundId() : -1;
|
|
14
|
+
PlaySoundFromEntity(SOUND_ID, sound, entity.Handle, set ?? "", false, 0);
|
|
15
|
+
return SOUND_ID;
|
|
16
|
+
}
|
|
17
|
+
static playSoundFrontEnd(sound, set, generateSoundId = true) {
|
|
18
|
+
const SOUND_ID = generateSoundId ? GetSoundId() : -1;
|
|
19
|
+
PlaySoundFrontend(SOUND_ID, sound, set ?? "", false);
|
|
20
|
+
return SOUND_ID;
|
|
21
|
+
}
|
|
22
|
+
static stopSound(soundId) {
|
|
23
|
+
StopSound(soundId);
|
|
24
|
+
}
|
|
25
|
+
static releaseSound(soundId) {
|
|
26
|
+
ReleaseSoundId(soundId);
|
|
27
|
+
}
|
|
28
|
+
static hasSoundFinished(soundId) {
|
|
29
|
+
return HasSoundFinished(soundId);
|
|
30
|
+
}
|
|
31
|
+
static setAudioFlag(flag, toggle) {
|
|
32
|
+
if (typeof flag === "string") {
|
|
33
|
+
SetAudioFlag(flag, toggle);
|
|
34
|
+
} else {
|
|
35
|
+
SetAudioFlag(Audio.audioFlags[Number(flag)], toggle);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
static playSound(soundFile, soundSet) {
|
|
39
|
+
Audio.releaseSound(Audio.playSoundFrontEnd(soundFile, soundSet));
|
|
40
|
+
}
|
|
41
|
+
static playMusic(musicFile) {
|
|
42
|
+
if (!Audio.cachedMusicFile) {
|
|
43
|
+
CancelMusicEvent(musicFile);
|
|
44
|
+
}
|
|
45
|
+
Audio.cachedMusicFile = musicFile;
|
|
46
|
+
TriggerMusicEvent(musicFile);
|
|
47
|
+
}
|
|
48
|
+
static stopMusic(musicFile) {
|
|
49
|
+
if (!musicFile) {
|
|
50
|
+
if (!Audio.cachedMusicFile) {
|
|
51
|
+
CancelMusicEvent(Audio.cachedMusicFile);
|
|
52
|
+
Audio.cachedMusicFile = "";
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
CancelMusicEvent(musicFile ?? "");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
static cachedMusicFile;
|
|
59
|
+
static audioFlags = [
|
|
60
|
+
"ActivateSwitchWheelAudio",
|
|
61
|
+
"AllowCutsceneOverScreenFade",
|
|
62
|
+
"AllowForceRadioAfterRetune",
|
|
63
|
+
"AllowPainAndAmbientSpeechToPlayDuringCutscene",
|
|
64
|
+
"AllowPlayerAIOnMission",
|
|
65
|
+
"AllowPoliceScannerWhenPlayerHasNoControl",
|
|
66
|
+
"AllowRadioDuringSwitch",
|
|
67
|
+
"AllowRadioOverScreenFade",
|
|
68
|
+
"AllowScoreAndRadio",
|
|
69
|
+
"AllowScriptedSpeechInSlowMo",
|
|
70
|
+
"AvoidMissionCompleteDelay",
|
|
71
|
+
"DisableAbortConversationForDeathAndInjury",
|
|
72
|
+
"DisableAbortConversationForRagdoll",
|
|
73
|
+
"DisableBarks",
|
|
74
|
+
"DisableFlightMusic",
|
|
75
|
+
"DisableReplayScriptStreamRecording",
|
|
76
|
+
"EnableHeadsetBeep",
|
|
77
|
+
"ForceConversationInterrupt",
|
|
78
|
+
"ForceSeamlessRadioSwitch",
|
|
79
|
+
"ForceSniperAudio",
|
|
80
|
+
"FrontendRadioDisabled",
|
|
81
|
+
"HoldMissionCompleteWhenPrepared",
|
|
82
|
+
"IsDirectorModeActive",
|
|
83
|
+
"IsPlayerOnMissionForSpeech",
|
|
84
|
+
"ListenerReverbDisabled",
|
|
85
|
+
"LoadMPData",
|
|
86
|
+
"MobileRadioInGame",
|
|
87
|
+
"OnlyAllowScriptTriggerPoliceScanner",
|
|
88
|
+
"PlayMenuMusic",
|
|
89
|
+
"PoliceScannerDisabled",
|
|
90
|
+
"ScriptedConvListenerMaySpeak",
|
|
91
|
+
"SpeechDucksScore",
|
|
92
|
+
"SuppressPlayerScubaBreathing",
|
|
93
|
+
"WantedMusicDisabled",
|
|
94
|
+
"WantedMusicOnMission"
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
Audio
|
|
99
|
+
};
|
package/Blip.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Vector3 } from "./utils";
|
|
2
|
-
import type { BlipColor, BlipSprite } from "./enums";
|
|
3
|
-
import { BaseEntity
|
|
1
|
+
import { Vector3 } from "./common/utils/Vector";
|
|
2
|
+
import type { BlipColor, BlipSprite } from "./enums/Blip";
|
|
3
|
+
import { BaseEntity } from "./models/BaseEntity";
|
|
4
|
+
import type { Player } from "./models/Player";
|
|
4
5
|
export declare class Blip {
|
|
5
6
|
protected handle: number;
|
|
6
7
|
constructor(handle: number);
|
package/Blip.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
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 { BaseEntity } from "./models/BaseEntity";
|
|
5
|
+
class Blip {
|
|
6
|
+
static {
|
|
7
|
+
__name(this, "Blip");
|
|
8
|
+
}
|
|
9
|
+
handle;
|
|
10
|
+
constructor(handle) {
|
|
11
|
+
this.handle = handle;
|
|
12
|
+
}
|
|
13
|
+
get Handle() {
|
|
14
|
+
return this.handle;
|
|
15
|
+
}
|
|
16
|
+
get Position() {
|
|
17
|
+
return Vector3.fromArray(GetBlipInfoIdCoord(this.handle));
|
|
18
|
+
}
|
|
19
|
+
set Position(location) {
|
|
20
|
+
SetBlipCoords(this.handle, location.x, location.y, location.z);
|
|
21
|
+
}
|
|
22
|
+
set Rotation(rotation) {
|
|
23
|
+
SetBlipRotation(this.handle, rotation);
|
|
24
|
+
}
|
|
25
|
+
set Scale(scale) {
|
|
26
|
+
SetBlipScale(this.handle, scale);
|
|
27
|
+
}
|
|
28
|
+
get Type() {
|
|
29
|
+
return GetBlipInfoIdType(this.handle);
|
|
30
|
+
}
|
|
31
|
+
get Alpha() {
|
|
32
|
+
return GetBlipAlpha(this.handle);
|
|
33
|
+
}
|
|
34
|
+
set Alpha(alpha) {
|
|
35
|
+
SetBlipAlpha(this.handle, alpha);
|
|
36
|
+
}
|
|
37
|
+
set Priority(priority) {
|
|
38
|
+
SetBlipPriority(this.handle, priority);
|
|
39
|
+
}
|
|
40
|
+
set NumberLabel(number) {
|
|
41
|
+
ShowNumberOnBlip(this.handle, number);
|
|
42
|
+
}
|
|
43
|
+
get Color() {
|
|
44
|
+
return GetBlipColour(this.handle);
|
|
45
|
+
}
|
|
46
|
+
set Color(color) {
|
|
47
|
+
SetBlipColour(this.handle, color);
|
|
48
|
+
}
|
|
49
|
+
get Sprite() {
|
|
50
|
+
return GetBlipSprite(this.handle);
|
|
51
|
+
}
|
|
52
|
+
set Sprite(sprite) {
|
|
53
|
+
SetBlipSprite(this.handle, sprite);
|
|
54
|
+
}
|
|
55
|
+
set Display(display) {
|
|
56
|
+
SetBlipDisplay(this.handle, display);
|
|
57
|
+
}
|
|
58
|
+
set Name(name) {
|
|
59
|
+
BeginTextCommandSetBlipName("STRING");
|
|
60
|
+
AddTextComponentSubstringPlayerName(name);
|
|
61
|
+
EndTextCommandSetBlipName(this.handle);
|
|
62
|
+
}
|
|
63
|
+
setNameToPlayerName(player) {
|
|
64
|
+
SetBlipNameToPlayerName(this.handle, player.Handle);
|
|
65
|
+
}
|
|
66
|
+
get Entity() {
|
|
67
|
+
return new BaseEntity(GetBlipInfoIdEntityIndex(this.handle));
|
|
68
|
+
}
|
|
69
|
+
set ShowHeadingIndicator(show) {
|
|
70
|
+
ShowHeadingIndicatorOnBlip(this.handle, show);
|
|
71
|
+
}
|
|
72
|
+
set ShowRoute(show) {
|
|
73
|
+
SetBlipRoute(this.handle, show);
|
|
74
|
+
}
|
|
75
|
+
set IsFriendly(friendly) {
|
|
76
|
+
SetBlipAsFriendly(this.handle, friendly);
|
|
77
|
+
}
|
|
78
|
+
set IsFriend(friend) {
|
|
79
|
+
SetBlipFriend(this.handle, friend);
|
|
80
|
+
}
|
|
81
|
+
set IsCrew(crew) {
|
|
82
|
+
SetBlipCrew(this.handle, crew);
|
|
83
|
+
}
|
|
84
|
+
get IsFlashing() {
|
|
85
|
+
return IsBlipFlashing(this.handle);
|
|
86
|
+
}
|
|
87
|
+
set IsFlashing(flashing) {
|
|
88
|
+
SetBlipFlashes(this.handle, flashing);
|
|
89
|
+
}
|
|
90
|
+
get IsOnMinimap() {
|
|
91
|
+
return IsBlipOnMinimap(this.handle);
|
|
92
|
+
}
|
|
93
|
+
get IsShortRange() {
|
|
94
|
+
return IsBlipShortRange(this.handle);
|
|
95
|
+
}
|
|
96
|
+
set IsShortRange(shortRange) {
|
|
97
|
+
SetBlipAsShortRange(this.handle, shortRange);
|
|
98
|
+
}
|
|
99
|
+
removeNumberLabel() {
|
|
100
|
+
HideNumberOnBlip(this.handle);
|
|
101
|
+
}
|
|
102
|
+
delete() {
|
|
103
|
+
if (this.exists()) {
|
|
104
|
+
RemoveBlip(this.handle);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exists() {
|
|
108
|
+
return DoesBlipExist(this.handle);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export {
|
|
112
|
+
Blip
|
|
113
|
+
};
|
package/Camera.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Vector3 } from "./common/utils/Vector";
|
|
2
|
+
import type { CameraShake } from "./enums/CameraShake";
|
|
3
3
|
import { BaseEntity } from "./models/BaseEntity";
|
|
4
|
-
import {
|
|
4
|
+
import { PedBone } from "./models/PedBone";
|
|
5
5
|
export declare class Camera {
|
|
6
6
|
static readonly shakeNames: string[];
|
|
7
7
|
private handle;
|
package/Camera.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
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 { GameplayCamera } from "./GameplayCamera";
|
|
5
|
+
import { BaseEntity } from "./models/BaseEntity";
|
|
6
|
+
import { PedBone } from "./models/PedBone";
|
|
7
|
+
import { LoadAnimDict } from "./utils/Animations";
|
|
8
|
+
class Camera {
|
|
9
|
+
static {
|
|
10
|
+
__name(this, "Camera");
|
|
11
|
+
}
|
|
12
|
+
static shakeNames = [
|
|
13
|
+
"HAND_SHAKE",
|
|
14
|
+
"SMALL_EXPLOSION_SHAKE",
|
|
15
|
+
"MEDIUM_EXPLOSION_SHAKE",
|
|
16
|
+
"LARGE_EXPLOSION_SHAKE",
|
|
17
|
+
"JOLT_SHAKE",
|
|
18
|
+
"VIBRATE_SHAKE",
|
|
19
|
+
"ROAD_VIBRATION_SHAKE",
|
|
20
|
+
"DRUNK_SHAKE",
|
|
21
|
+
"SKY_DIVING_SHAKE",
|
|
22
|
+
"FAMILY5_DRUG_TRIP_SHAKE",
|
|
23
|
+
"DEATH_FAIL_IN_EFFECT_SHAKE"
|
|
24
|
+
];
|
|
25
|
+
handle;
|
|
26
|
+
constructor(handle) {
|
|
27
|
+
this.handle = handle;
|
|
28
|
+
}
|
|
29
|
+
get Handle() {
|
|
30
|
+
return this.handle;
|
|
31
|
+
}
|
|
32
|
+
get IsActive() {
|
|
33
|
+
return IsCamActive(this.handle);
|
|
34
|
+
}
|
|
35
|
+
set IsActive(active) {
|
|
36
|
+
SetCamActive(this.handle, active);
|
|
37
|
+
}
|
|
38
|
+
get Position() {
|
|
39
|
+
return Vector3.fromArray(GetCamCoord(this.handle));
|
|
40
|
+
}
|
|
41
|
+
set Position(position) {
|
|
42
|
+
SetCamCoord(this.handle, position.x, position.y, position.z);
|
|
43
|
+
}
|
|
44
|
+
get Rotation() {
|
|
45
|
+
return Vector3.fromArray(GetCamRot(this.handle, 2));
|
|
46
|
+
}
|
|
47
|
+
set Rotation(rotation) {
|
|
48
|
+
SetCamRot(this.handle, rotation.x, rotation.y, rotation.z, 2);
|
|
49
|
+
}
|
|
50
|
+
// public get Matrix() : Matrix {}
|
|
51
|
+
/**
|
|
52
|
+
* Gets the direction the camera is facing. Same as ForwardVector
|
|
53
|
+
*/
|
|
54
|
+
get Direction() {
|
|
55
|
+
return this.ForwardVector;
|
|
56
|
+
}
|
|
57
|
+
set Direction(direction) {
|
|
58
|
+
const dir = direction.normalize();
|
|
59
|
+
const vec1 = new Vector3(dir.x, dir.y, 0);
|
|
60
|
+
const vec2 = new Vector3(dir.z, vec1.distanceSquared(vec1), 0);
|
|
61
|
+
const vec3 = vec2.normalize();
|
|
62
|
+
this.Rotation = new Vector3(
|
|
63
|
+
Math.atan2(vec3.x, vec3.y) * 57.29577951308232,
|
|
64
|
+
this.Rotation.y,
|
|
65
|
+
Math.atan2(dir.x, dir.y) * -57.29577951308232
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
// public get UpVector() : Vector3 {
|
|
69
|
+
// return Matrix.Up;
|
|
70
|
+
// }
|
|
71
|
+
get ForwardVector() {
|
|
72
|
+
const rotation = Vector3.multiply(GameplayCamera.Rotation, Math.PI / 180);
|
|
73
|
+
const normalized = Vector3.normalize(
|
|
74
|
+
new Vector3(
|
|
75
|
+
-Math.sin(rotation.z) * Math.abs(Math.cos(rotation.x)),
|
|
76
|
+
Math.cos(rotation.z) * Math.abs(Math.cos(rotation.x)),
|
|
77
|
+
Math.sin(rotation.x)
|
|
78
|
+
)
|
|
79
|
+
);
|
|
80
|
+
return new Vector3(normalized.x, normalized.y, normalized.z);
|
|
81
|
+
}
|
|
82
|
+
// public get RightVector() : Vector3 {
|
|
83
|
+
// return Matrix.Right;
|
|
84
|
+
// }
|
|
85
|
+
// public Vector3 GetOffsetPosition(Vector3 offset) {
|
|
86
|
+
// return Vector3.TransformCoordinate(offset, Matrix);
|
|
87
|
+
// }
|
|
88
|
+
// public Vector3 GetPositionOffset(Vector3 worldCoords) {
|
|
89
|
+
// return Vector3.TransformCoordinate(worldCoords, Matrix.Invert(Matrix));
|
|
90
|
+
// }
|
|
91
|
+
get FieldOfView() {
|
|
92
|
+
return GetCamFov(this.handle);
|
|
93
|
+
}
|
|
94
|
+
set FieldOfView(fieldOfView) {
|
|
95
|
+
SetCamFov(this.handle, fieldOfView);
|
|
96
|
+
}
|
|
97
|
+
get NearClip() {
|
|
98
|
+
return GetCamNearClip(this.handle);
|
|
99
|
+
}
|
|
100
|
+
set NearClip(nearClip) {
|
|
101
|
+
SetCamNearClip(this.handle, nearClip);
|
|
102
|
+
}
|
|
103
|
+
get FarClip() {
|
|
104
|
+
return GetCamFarClip(this.handle);
|
|
105
|
+
}
|
|
106
|
+
set FarClip(farClip) {
|
|
107
|
+
SetCamFarClip(this.handle, farClip);
|
|
108
|
+
}
|
|
109
|
+
set NearDepthOfField(nearDepthOfField) {
|
|
110
|
+
SetCamNearDof(this.handle, nearDepthOfField);
|
|
111
|
+
}
|
|
112
|
+
get FarDepthOfField() {
|
|
113
|
+
return GetCamFarDof(this.handle);
|
|
114
|
+
}
|
|
115
|
+
set FarDepthOfField(farDepthOfField) {
|
|
116
|
+
SetCamFarDof(this.handle, farDepthOfField);
|
|
117
|
+
}
|
|
118
|
+
set DepthOfFieldStrength(strength) {
|
|
119
|
+
SetCamDofStrength(this.handle, strength);
|
|
120
|
+
}
|
|
121
|
+
set MotionBlurStrength(strength) {
|
|
122
|
+
SetCamMotionBlurStrength(this.handle, strength);
|
|
123
|
+
}
|
|
124
|
+
shake(shakeType, amplitude) {
|
|
125
|
+
ShakeCam(this.handle, Camera.shakeNames[Number(shakeType)], amplitude);
|
|
126
|
+
}
|
|
127
|
+
stopShaking() {
|
|
128
|
+
StopCamShaking(this.handle, true);
|
|
129
|
+
}
|
|
130
|
+
get IsShaking() {
|
|
131
|
+
return IsCamShaking(this.handle);
|
|
132
|
+
}
|
|
133
|
+
set ShakeAmplitude(amplitude) {
|
|
134
|
+
SetCamShakeAmplitude(this.handle, amplitude);
|
|
135
|
+
}
|
|
136
|
+
async playAnim(animName, animDict, position, rotation) {
|
|
137
|
+
await LoadAnimDict(animDict);
|
|
138
|
+
PlayCamAnim(
|
|
139
|
+
this.handle,
|
|
140
|
+
animName,
|
|
141
|
+
animDict,
|
|
142
|
+
position.x,
|
|
143
|
+
position.y,
|
|
144
|
+
position.z,
|
|
145
|
+
rotation.x,
|
|
146
|
+
rotation.y,
|
|
147
|
+
rotation.z,
|
|
148
|
+
false,
|
|
149
|
+
2
|
|
150
|
+
);
|
|
151
|
+
RemoveAnimDict(animDict);
|
|
152
|
+
}
|
|
153
|
+
pointAt(target, offset = new Vector3(0, 0, 0)) {
|
|
154
|
+
if (target instanceof BaseEntity) {
|
|
155
|
+
PointCamAtEntity(this.handle, target.Handle, offset.x, offset.y, offset.z, true);
|
|
156
|
+
} else if (target instanceof PedBone) {
|
|
157
|
+
PointCamAtPedBone(this.handle, target.Owner.Handle, target.Index, offset.x, offset.y, offset.z, true);
|
|
158
|
+
} else {
|
|
159
|
+
PointCamAtCoord(this.handle, target.x, target.y, target.z);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
stopPointing() {
|
|
163
|
+
StopCamPointing(this.handle);
|
|
164
|
+
}
|
|
165
|
+
interpTo(to, duration, easePosition, easeRotation) {
|
|
166
|
+
SetCamActiveWithInterp(to.handle, this.handle, duration, Number(easePosition), Number(easeRotation));
|
|
167
|
+
}
|
|
168
|
+
get IsInterpolating() {
|
|
169
|
+
return IsCamInterpolating(this.handle);
|
|
170
|
+
}
|
|
171
|
+
attachTo(object, offset) {
|
|
172
|
+
if (object instanceof BaseEntity) {
|
|
173
|
+
AttachCamToEntity(this.handle, object.Handle, offset.x, offset.y, offset.z, true);
|
|
174
|
+
} else if (object instanceof PedBone) {
|
|
175
|
+
AttachCamToPedBone(this.handle, object.Owner.Handle, object.Index, offset.x, offset.y, offset.z, true);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
detach() {
|
|
179
|
+
DetachCam(this.handle);
|
|
180
|
+
}
|
|
181
|
+
delete() {
|
|
182
|
+
DestroyCam(this.handle, false);
|
|
183
|
+
}
|
|
184
|
+
exists() {
|
|
185
|
+
return DoesCamExist(this.handle);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export {
|
|
189
|
+
Camera
|
|
190
|
+
};
|
package/Checkpoint.d.ts
CHANGED
package/Checkpoint.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
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 { CheckpointIcon } from "./enums/Checkpoint";
|
|
5
|
+
class Checkpoint {
|
|
6
|
+
static {
|
|
7
|
+
__name(this, "Checkpoint");
|
|
8
|
+
}
|
|
9
|
+
handle;
|
|
10
|
+
position = new Vector3(0, 0, 0);
|
|
11
|
+
targetPosition = new Vector3(0, 0, 0);
|
|
12
|
+
icon = CheckpointIcon.Empty;
|
|
13
|
+
radius = 0;
|
|
14
|
+
constructor(handle) {
|
|
15
|
+
this.handle = handle;
|
|
16
|
+
}
|
|
17
|
+
get Position() {
|
|
18
|
+
return this.position;
|
|
19
|
+
}
|
|
20
|
+
set Position(position) {
|
|
21
|
+
this.position = position;
|
|
22
|
+
}
|
|
23
|
+
get TargetPosition() {
|
|
24
|
+
return this.targetPosition;
|
|
25
|
+
}
|
|
26
|
+
set TargetPosition(targetPosition) {
|
|
27
|
+
this.targetPosition = targetPosition;
|
|
28
|
+
}
|
|
29
|
+
get Icon() {
|
|
30
|
+
return this.icon;
|
|
31
|
+
}
|
|
32
|
+
set Icon(icon) {
|
|
33
|
+
this.icon = icon;
|
|
34
|
+
}
|
|
35
|
+
// TODO
|
|
36
|
+
// public get CustomIcon(): CheckpointIcon {
|
|
37
|
+
// return this.icon;
|
|
38
|
+
// }
|
|
39
|
+
// public set CustomIcon(icon: CheckpointIcon) {
|
|
40
|
+
// this.icon = icon;
|
|
41
|
+
// }
|
|
42
|
+
get Radius() {
|
|
43
|
+
return this.radius;
|
|
44
|
+
}
|
|
45
|
+
set Radius(radius) {
|
|
46
|
+
this.radius = radius;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
Checkpoint
|
|
51
|
+
};
|
package/Events.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { Vector2, Vector3, Vector4 } from "./common/utils/Vector";
|
|
4
|
+
import { ClassTypes } from "../common/utils/ClassTypes";
|
|
5
|
+
import { BaseEntity } from "./models/BaseEntity";
|
|
6
|
+
import { Ped } from "./models/Ped";
|
|
7
|
+
import { Player } from "./models/Player";
|
|
8
|
+
import { Prop } from "./models/Prop";
|
|
9
|
+
import { Vehicle } from "./models/Vehicle";
|
|
10
|
+
const getClassFromArguments = /* @__PURE__ */ __name((...args) => {
|
|
11
|
+
const newArgs = [];
|
|
12
|
+
for (const arg of args) {
|
|
13
|
+
if (!arg.type) {
|
|
14
|
+
newArgs.push(arg);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
switch (arg.type) {
|
|
18
|
+
case ClassTypes.Vector2: {
|
|
19
|
+
newArgs.push(Vector2.fromObject(arg));
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
case ClassTypes.Vector3: {
|
|
23
|
+
newArgs.push(Vector3.fromObject(arg));
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
case ClassTypes.Vector4: {
|
|
27
|
+
newArgs.push(Vector4.fromObject(arg));
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
case ClassTypes.Ped: {
|
|
31
|
+
newArgs.push(Ped.fromNetworkId(arg.handle));
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
case ClassTypes.Player: {
|
|
35
|
+
newArgs.push(Player.fromServerId(arg.source));
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
case ClassTypes.Prop: {
|
|
39
|
+
newArgs.push(Prop.fromNetworkId(arg.handle));
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
case ClassTypes.Vehicle: {
|
|
43
|
+
newArgs.push(Vehicle.fromNetworkId(arg.netId));
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
case ClassTypes.Entity: {
|
|
47
|
+
newArgs.push(BaseEntity.fromNetworkId(arg.netId));
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
default: {
|
|
51
|
+
newArgs.push(arg);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return newArgs;
|
|
56
|
+
}, "getClassFromArguments");
|
|
57
|
+
class Events {
|
|
58
|
+
static {
|
|
59
|
+
__name(this, "Events");
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* An onNet wrapper that properly converts the type into the correct type
|
|
63
|
+
*/
|
|
64
|
+
static onNet = /* @__PURE__ */ __name((eventName, event) => {
|
|
65
|
+
onNet(eventName, (...args) => {
|
|
66
|
+
event(...getClassFromArguments(...args));
|
|
67
|
+
});
|
|
68
|
+
}, "onNet");
|
|
69
|
+
/**
|
|
70
|
+
* An on wrapper that properly converts the classes
|
|
71
|
+
*/
|
|
72
|
+
static on = /* @__PURE__ */ __name((eventName, event) => {
|
|
73
|
+
on(eventName, (...args) => {
|
|
74
|
+
event(...getClassFromArguments(...args));
|
|
75
|
+
});
|
|
76
|
+
}, "on");
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
Events
|
|
80
|
+
};
|
package/Game.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Vector3 } from "./common/utils/Vector";
|
|
2
|
+
import { Blip } from "./Blip";
|
|
3
|
+
import type { Control } from "./enums/Control";
|
|
4
|
+
import { InputMode } from "./enums/InputMode";
|
|
5
|
+
import type { Language } from "./enums/Language";
|
|
6
|
+
import { RadioStation } from "./enums/RadioStation";
|
|
7
|
+
import { Ped } from "./models/Ped";
|
|
8
|
+
import { Prop } from "./models/Prop";
|
|
9
|
+
import { Vehicle } from "./models/Vehicle";
|
|
10
|
+
import { Player } from "./models/Player";
|
|
4
11
|
export declare abstract class Game {
|
|
5
12
|
static useHashCache: boolean;
|
|
6
13
|
static hashCache: Map<string, number>;
|