@nativewrappers/fivem 0.0.80 → 0.0.82
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/index.js +166 -18794
- 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/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
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { Prop } from "fivem/models/Prop";
|
|
4
|
+
import { Weapon } from "./Weapon";
|
|
5
|
+
class WeaponCollection {
|
|
6
|
+
static {
|
|
7
|
+
__name(this, "WeaponCollection");
|
|
8
|
+
}
|
|
9
|
+
owner;
|
|
10
|
+
weapons = /* @__PURE__ */ new Map();
|
|
11
|
+
constructor(owner) {
|
|
12
|
+
this.owner = owner;
|
|
13
|
+
}
|
|
14
|
+
[Symbol.iterator]() {
|
|
15
|
+
let pointer = 0;
|
|
16
|
+
const weapons = Array.from(this.weapons.values());
|
|
17
|
+
return {
|
|
18
|
+
next() {
|
|
19
|
+
if (pointer < weapons.length) {
|
|
20
|
+
return { done: false, value: weapons[pointer++] };
|
|
21
|
+
}
|
|
22
|
+
return { done: true, value: null };
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* get weapon by hash
|
|
28
|
+
*
|
|
29
|
+
* @param hash
|
|
30
|
+
*/
|
|
31
|
+
get(hash) {
|
|
32
|
+
let weapon = this.weapons.get(hash);
|
|
33
|
+
if (!weapon) {
|
|
34
|
+
if (!this.hasWeapon(hash)) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
weapon = this.createAndAddWeapon(hash);
|
|
38
|
+
}
|
|
39
|
+
return weapon;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* get ped current weapon
|
|
43
|
+
*
|
|
44
|
+
* @constructor
|
|
45
|
+
*/
|
|
46
|
+
get Current() {
|
|
47
|
+
const [, hash] = GetCurrentPedWeapon(this.owner.Handle, true);
|
|
48
|
+
if (this.weapons.has(hash)) {
|
|
49
|
+
return this.weapons.get(hash);
|
|
50
|
+
}
|
|
51
|
+
return this.createAndAddWeapon(hash);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* get ped current weapon object
|
|
55
|
+
*
|
|
56
|
+
* @constructor
|
|
57
|
+
*/
|
|
58
|
+
get CurrentWeaponObject() {
|
|
59
|
+
if (this.Current.IsUnarmed) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return new Prop(GetCurrentPedWeaponEntityIndex(this.owner.Handle));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* get ped best weapon
|
|
66
|
+
*
|
|
67
|
+
* @constructor
|
|
68
|
+
*/
|
|
69
|
+
get BestWeapon() {
|
|
70
|
+
const hash = GetBestPedWeapon(this.owner.Handle, false);
|
|
71
|
+
if (this.weapons.has(hash)) {
|
|
72
|
+
return this.weapons.get(hash);
|
|
73
|
+
}
|
|
74
|
+
return this.createAndAddWeapon(hash);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* check ped has weapon
|
|
78
|
+
*
|
|
79
|
+
* @param hash
|
|
80
|
+
*/
|
|
81
|
+
hasWeapon(hash) {
|
|
82
|
+
return HasPedGotWeapon(this.owner.Handle, hash, false);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* check weapon is valid
|
|
86
|
+
*
|
|
87
|
+
* @param hash
|
|
88
|
+
*/
|
|
89
|
+
isWeaponValid(hash) {
|
|
90
|
+
return IsWeaponValid(hash);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* give weapon to ped
|
|
94
|
+
*
|
|
95
|
+
* @param hash
|
|
96
|
+
* @param ammoCount
|
|
97
|
+
* @param equipNow
|
|
98
|
+
* @param isAmmoLoaded
|
|
99
|
+
*/
|
|
100
|
+
give(hash, ammoCount, equipNow, isAmmoLoaded) {
|
|
101
|
+
let weapon = this.weapons.get(hash);
|
|
102
|
+
if (!weapon) {
|
|
103
|
+
weapon = this.createAndAddWeapon(hash);
|
|
104
|
+
}
|
|
105
|
+
if (weapon.IsPresent) {
|
|
106
|
+
this.select(weapon);
|
|
107
|
+
} else {
|
|
108
|
+
GiveWeaponToPed(this.owner.Handle, weapon.Hash, ammoCount, equipNow, isAmmoLoaded);
|
|
109
|
+
}
|
|
110
|
+
return weapon;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* set ped current weapon on hand
|
|
114
|
+
*
|
|
115
|
+
* @param weapon
|
|
116
|
+
*/
|
|
117
|
+
select(weapon) {
|
|
118
|
+
if (weapon instanceof Weapon) {
|
|
119
|
+
if (!weapon.IsPresent) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
SetCurrentPedWeapon(this.owner.Handle, weapon.Hash, true);
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
if (!this.hasWeapon(weapon)) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
SetCurrentPedWeapon(this.owner.Handle, weapon, true);
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* remove weapon from ped
|
|
133
|
+
*
|
|
134
|
+
* @param weapon
|
|
135
|
+
*/
|
|
136
|
+
remove(weapon) {
|
|
137
|
+
if (weapon instanceof Weapon) {
|
|
138
|
+
if (this.weapons.has(weapon.Hash)) {
|
|
139
|
+
this.weapons.delete(weapon.Hash);
|
|
140
|
+
}
|
|
141
|
+
this.remove(weapon.Hash);
|
|
142
|
+
} else {
|
|
143
|
+
RemoveWeaponFromPed(this.owner.Handle, weapon);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* remove all weapons from ped
|
|
148
|
+
*
|
|
149
|
+
*/
|
|
150
|
+
removeAll() {
|
|
151
|
+
RemoveAllPedWeapons(this.owner.Handle, true);
|
|
152
|
+
this.weapons.clear();
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Drop ped current weapon?
|
|
156
|
+
* todo: this native seems does not work as expected, need to investigate
|
|
157
|
+
* refer1: https://docs.fivem.net/natives/?_0x6B7513D9966FBEC0
|
|
158
|
+
* refer2: https://forum.cfx.re/t/release-weapondrop/49856/8
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
drop() {
|
|
162
|
+
SetPedDropsWeapon(this.owner.Handle);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* create weapon object and add to collection
|
|
166
|
+
*
|
|
167
|
+
* @param hash
|
|
168
|
+
* @private
|
|
169
|
+
*/
|
|
170
|
+
createAndAddWeapon(hash) {
|
|
171
|
+
const uintHash = hash >>> 0;
|
|
172
|
+
const weapon = new Weapon(this.owner, uintHash);
|
|
173
|
+
this.weapons.set(uintHash, weapon);
|
|
174
|
+
return weapon;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
export {
|
|
178
|
+
WeaponCollection
|
|
179
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { WeaponHash } from "fivem/hashes/WeaponHash";
|
|
4
|
+
import { DlcWeaponData } from "./DlcWeaponData";
|
|
5
|
+
const WeaponDisplayNameByHash = /* @__PURE__ */ new Map([
|
|
6
|
+
[WeaponHash.Pistol, "WT_PIST"],
|
|
7
|
+
[WeaponHash.CombatPistol, "WT_PIST_CBT"],
|
|
8
|
+
[WeaponHash.APPistol, "WT_PIST_AP"],
|
|
9
|
+
[WeaponHash.SMG, "WT_SMG"],
|
|
10
|
+
[WeaponHash.MicroSMG, "WT_SMG_MCR"],
|
|
11
|
+
[WeaponHash.AssaultRifle, "WT_RIFLE_ASL"],
|
|
12
|
+
[WeaponHash.CarbineRifle, "WT_RIFLE_CBN"],
|
|
13
|
+
[WeaponHash.AdvancedRifle, "WT_RIFLE_ADV"],
|
|
14
|
+
[WeaponHash.MG, "WT_MG"],
|
|
15
|
+
[WeaponHash.CombatMG, "WT_MG_CBT"],
|
|
16
|
+
[WeaponHash.PumpShotgun, "WT_SG_PMP"],
|
|
17
|
+
[WeaponHash.SawnOffShotgun, "WT_SG_SOF"],
|
|
18
|
+
[WeaponHash.AssaultShotgun, "WT_SG_ASL"],
|
|
19
|
+
[WeaponHash.HeavySniper, "WT_SNIP_HVY"],
|
|
20
|
+
[WeaponHash.SniperRifle, "WT_SNIP_RIF"],
|
|
21
|
+
[WeaponHash.GrenadeLauncher, "WT_GL"],
|
|
22
|
+
[WeaponHash.RPG, "WT_RPG"],
|
|
23
|
+
[WeaponHash.Minigun, "WT_MINIGUN"],
|
|
24
|
+
[WeaponHash.AssaultSMG, "WT_SMG_ASL"],
|
|
25
|
+
[WeaponHash.BullpupShotgun, "WT_SG_BLP"],
|
|
26
|
+
[WeaponHash.Pistol50, "WT_PIST_50"],
|
|
27
|
+
[WeaponHash.Bottle, "WT_BOTTLE"],
|
|
28
|
+
[WeaponHash.Gusenberg, "WT_GUSENBERG"],
|
|
29
|
+
[WeaponHash.SNSPistol, "WT_SNSPISTOL"],
|
|
30
|
+
[WeaponHash.VintagePistol, "TT_VPISTOL"],
|
|
31
|
+
[WeaponHash.Dagger, "WT_DAGGER"],
|
|
32
|
+
[WeaponHash.FlareGun, "WT_FLAREGUN"],
|
|
33
|
+
[WeaponHash.Musket, "WT_MUSKET"],
|
|
34
|
+
[WeaponHash.Firework, "WT_FWRKLNCHR"],
|
|
35
|
+
[WeaponHash.MarksmanRifle, "WT_HMKRIFLE"],
|
|
36
|
+
[WeaponHash.HeavyShotgun, "WT_HVYSHOT"],
|
|
37
|
+
[WeaponHash.ProximityMine, "WT_PRXMINE"],
|
|
38
|
+
[WeaponHash.HomingLauncher, "WT_HOMLNCH"],
|
|
39
|
+
[WeaponHash.CombatPDW, "WT_COMBATPDW"],
|
|
40
|
+
[WeaponHash.KnuckleDuster, "WT_KNUCKLE"],
|
|
41
|
+
[WeaponHash.MarksmanPistol, "WT_MKPISTOL"],
|
|
42
|
+
[WeaponHash.Machete, "WT_MACHETE"],
|
|
43
|
+
[WeaponHash.MachinePistol, "WT_MCHPIST"],
|
|
44
|
+
[WeaponHash.Flashlight, "WT_FLASHLIGHT"],
|
|
45
|
+
[WeaponHash.DoubleBarrelShotgun, "WT_DBSHGN"],
|
|
46
|
+
[WeaponHash.CompactRifle, "WT_CMPRIFLE"],
|
|
47
|
+
[WeaponHash.SwitchBlade, "WT_SWBLADE"],
|
|
48
|
+
[WeaponHash.Revolver, "WT_REVOLVER"],
|
|
49
|
+
// mpgunrunning
|
|
50
|
+
[WeaponHash.PistolMk2, "WT_PIST2"],
|
|
51
|
+
[WeaponHash.AssaultRifleMk2, "WT_RIFLE_ASL2"],
|
|
52
|
+
[WeaponHash.CarbineRifleMk2, "WT_RIFLE_CBN2"],
|
|
53
|
+
[WeaponHash.CombatMGMk2, "WT_MG_CBT2"],
|
|
54
|
+
[WeaponHash.HeavySniperMk2, "WT_SNIP_HVY2"],
|
|
55
|
+
[WeaponHash.SMGMk2, "WT_SMG2"]
|
|
56
|
+
]);
|
|
57
|
+
function initializeOnce() {
|
|
58
|
+
let isInitialized = false;
|
|
59
|
+
return () => {
|
|
60
|
+
if (isInitialized) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
for (const [hash, data] of DlcWeaponData) {
|
|
64
|
+
WeaponDisplayNameByHash.set(hash, data.name);
|
|
65
|
+
}
|
|
66
|
+
isInitialized = true;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
__name(initializeOnce, "initializeOnce");
|
|
70
|
+
initializeOnce()();
|
|
71
|
+
export {
|
|
72
|
+
WeaponDisplayNameByHash
|
|
73
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var WeaponGroup = /* @__PURE__ */ ((WeaponGroup2) => {
|
|
2
|
+
WeaponGroup2[WeaponGroup2["Unarmed"] = 2685387236] = "Unarmed";
|
|
3
|
+
WeaponGroup2[WeaponGroup2["Melee"] = 3566412244] = "Melee";
|
|
4
|
+
WeaponGroup2[WeaponGroup2["Pistol"] = 416676503] = "Pistol";
|
|
5
|
+
WeaponGroup2[WeaponGroup2["SMG"] = 3337201093] = "SMG";
|
|
6
|
+
WeaponGroup2[WeaponGroup2["AssaultRifle"] = 970310034] = "AssaultRifle";
|
|
7
|
+
WeaponGroup2[WeaponGroup2["DigiScanner"] = 3539449195] = "DigiScanner";
|
|
8
|
+
WeaponGroup2[WeaponGroup2["FireExtinguisher"] = 4257178988] = "FireExtinguisher";
|
|
9
|
+
WeaponGroup2[WeaponGroup2["MG"] = 1159398588] = "MG";
|
|
10
|
+
WeaponGroup2[WeaponGroup2["NightVision"] = 3493187224] = "NightVision";
|
|
11
|
+
WeaponGroup2[WeaponGroup2["Parachute"] = 431593103] = "Parachute";
|
|
12
|
+
WeaponGroup2[WeaponGroup2["Shotgun"] = 860033945] = "Shotgun";
|
|
13
|
+
WeaponGroup2[WeaponGroup2["Sniper"] = 3082541095] = "Sniper";
|
|
14
|
+
WeaponGroup2[WeaponGroup2["Stungun"] = 690389602] = "Stungun";
|
|
15
|
+
WeaponGroup2[WeaponGroup2["Heavy"] = 2725924767] = "Heavy";
|
|
16
|
+
WeaponGroup2[WeaponGroup2["Thrown"] = 1548507267] = "Thrown";
|
|
17
|
+
WeaponGroup2[WeaponGroup2["PetrolCan"] = 1595662460] = "PetrolCan";
|
|
18
|
+
return WeaponGroup2;
|
|
19
|
+
})(WeaponGroup || {});
|
|
20
|
+
export {
|
|
21
|
+
WeaponGroup
|
|
22
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { enumValues } from "../common/utils/enumValues";
|
|
4
|
+
import { getUInt32FromUint8Array } from "../common/utils/getUInt32FromUint8Array";
|
|
5
|
+
import { WeaponHash } from "fivem/hashes/WeaponHash";
|
|
6
|
+
const WeaponHudStats = /* @__PURE__ */ new Map();
|
|
7
|
+
function initializeOnce() {
|
|
8
|
+
let isInitialized = false;
|
|
9
|
+
return () => {
|
|
10
|
+
if (isInitialized || IsDuplicityVersion()) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const intLength = 4;
|
|
14
|
+
for (const hash of enumValues(WeaponHash)) {
|
|
15
|
+
const buffer = new Uint8Array(40);
|
|
16
|
+
Citizen.invokeNative("0xD92C739EE34C9EBA", hash, buffer, Citizen.returnResultAnyway());
|
|
17
|
+
const weaponHudStats = {
|
|
18
|
+
hudDamage: getUInt32FromUint8Array(buffer, 0 * intLength, 1 * intLength),
|
|
19
|
+
hudSpeed: getUInt32FromUint8Array(buffer, 2 * intLength, 3 * intLength),
|
|
20
|
+
hudCapacity: getUInt32FromUint8Array(buffer, 4 * intLength, 5 * intLength),
|
|
21
|
+
hudAccuracy: getUInt32FromUint8Array(buffer, 6 * intLength, 7 * intLength),
|
|
22
|
+
hudRange: getUInt32FromUint8Array(buffer, 8 * intLength, 9 * intLength)
|
|
23
|
+
};
|
|
24
|
+
WeaponHudStats.set(hash, weaponHudStats);
|
|
25
|
+
}
|
|
26
|
+
isInitialized = true;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
__name(initializeOnce, "initializeOnce");
|
|
30
|
+
initializeOnce()();
|
|
31
|
+
export {
|
|
32
|
+
WeaponHudStats
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var WeaponLivery = /* @__PURE__ */ ((WeaponLivery2) => {
|
|
2
|
+
WeaponLivery2[WeaponLivery2["Digital"] = 0] = "Digital";
|
|
3
|
+
WeaponLivery2[WeaponLivery2["Brushstroke"] = 1] = "Brushstroke";
|
|
4
|
+
WeaponLivery2[WeaponLivery2["Woodland"] = 2] = "Woodland";
|
|
5
|
+
WeaponLivery2[WeaponLivery2["Skull"] = 3] = "Skull";
|
|
6
|
+
WeaponLivery2[WeaponLivery2["Sessanta"] = 4] = "Sessanta";
|
|
7
|
+
WeaponLivery2[WeaponLivery2["Perseus"] = 5] = "Perseus";
|
|
8
|
+
WeaponLivery2[WeaponLivery2["Leopard"] = 6] = "Leopard";
|
|
9
|
+
WeaponLivery2[WeaponLivery2["Zebra"] = 7] = "Zebra";
|
|
10
|
+
WeaponLivery2[WeaponLivery2["Geometric"] = 8] = "Geometric";
|
|
11
|
+
WeaponLivery2[WeaponLivery2["Boom"] = 9] = "Boom";
|
|
12
|
+
WeaponLivery2[WeaponLivery2["Patriotic"] = 10] = "Patriotic";
|
|
13
|
+
return WeaponLivery2;
|
|
14
|
+
})(WeaponLivery || {});
|
|
15
|
+
export {
|
|
16
|
+
WeaponLivery
|
|
17
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var WeaponLiveryColor = /* @__PURE__ */ ((WeaponLiveryColor2) => {
|
|
2
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Gray"] = 0] = "Gray";
|
|
3
|
+
WeaponLiveryColor2[WeaponLiveryColor2["DarkGray"] = 1] = "DarkGray";
|
|
4
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Black"] = 2] = "Black";
|
|
5
|
+
WeaponLiveryColor2[WeaponLiveryColor2["White"] = 3] = "White";
|
|
6
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Blue"] = 4] = "Blue";
|
|
7
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Cyan"] = 5] = "Cyan";
|
|
8
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Aqua"] = 6] = "Aqua";
|
|
9
|
+
WeaponLiveryColor2[WeaponLiveryColor2["CoolBlue"] = 7] = "CoolBlue";
|
|
10
|
+
WeaponLiveryColor2[WeaponLiveryColor2["DarkBlue"] = 8] = "DarkBlue";
|
|
11
|
+
WeaponLiveryColor2[WeaponLiveryColor2["RoyalBlue"] = 9] = "RoyalBlue";
|
|
12
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Plum"] = 10] = "Plum";
|
|
13
|
+
WeaponLiveryColor2[WeaponLiveryColor2["DarkPurple"] = 11] = "DarkPurple";
|
|
14
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Purple"] = 12] = "Purple";
|
|
15
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Red"] = 13] = "Red";
|
|
16
|
+
WeaponLiveryColor2[WeaponLiveryColor2["WineRed"] = 14] = "WineRed";
|
|
17
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Magenta"] = 15] = "Magenta";
|
|
18
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Pink"] = 16] = "Pink";
|
|
19
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Salmon"] = 17] = "Salmon";
|
|
20
|
+
WeaponLiveryColor2[WeaponLiveryColor2["HotPink"] = 18] = "HotPink";
|
|
21
|
+
WeaponLiveryColor2[WeaponLiveryColor2["RustOrange"] = 19] = "RustOrange";
|
|
22
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Brown"] = 20] = "Brown";
|
|
23
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Earth"] = 21] = "Earth";
|
|
24
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Orange"] = 22] = "Orange";
|
|
25
|
+
WeaponLiveryColor2[WeaponLiveryColor2["LightOrange"] = 23] = "LightOrange";
|
|
26
|
+
WeaponLiveryColor2[WeaponLiveryColor2["DarkYellow"] = 24] = "DarkYellow";
|
|
27
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Yellow"] = 25] = "Yellow";
|
|
28
|
+
WeaponLiveryColor2[WeaponLiveryColor2["LightBrown"] = 26] = "LightBrown";
|
|
29
|
+
WeaponLiveryColor2[WeaponLiveryColor2["LimeGreen"] = 27] = "LimeGreen";
|
|
30
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Olive"] = 28] = "Olive";
|
|
31
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Moss"] = 29] = "Moss";
|
|
32
|
+
WeaponLiveryColor2[WeaponLiveryColor2["Turquoise"] = 30] = "Turquoise";
|
|
33
|
+
WeaponLiveryColor2[WeaponLiveryColor2["DarkGreen"] = 31] = "DarkGreen";
|
|
34
|
+
return WeaponLiveryColor2;
|
|
35
|
+
})(WeaponLiveryColor || {});
|
|
36
|
+
export {
|
|
37
|
+
WeaponLiveryColor
|
|
38
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var WeaponTint = /* @__PURE__ */ ((WeaponTint2) => {
|
|
2
|
+
WeaponTint2[WeaponTint2["Mk2ClassicBlack"] = 0] = "Mk2ClassicBlack";
|
|
3
|
+
WeaponTint2[WeaponTint2["Mk2ClassicGray"] = 1] = "Mk2ClassicGray";
|
|
4
|
+
WeaponTint2[WeaponTint2["Mk2ClassicTwoTone"] = 2] = "Mk2ClassicTwoTone";
|
|
5
|
+
WeaponTint2[WeaponTint2["Mk2ClassicWhite"] = 3] = "Mk2ClassicWhite";
|
|
6
|
+
WeaponTint2[WeaponTint2["Mk2ClassicBeige"] = 4] = "Mk2ClassicBeige";
|
|
7
|
+
WeaponTint2[WeaponTint2["Mk2ClassicGreen"] = 5] = "Mk2ClassicGreen";
|
|
8
|
+
WeaponTint2[WeaponTint2["Mk2ClassicBlue"] = 6] = "Mk2ClassicBlue";
|
|
9
|
+
WeaponTint2[WeaponTint2["Mk2ClassicEarth"] = 7] = "Mk2ClassicEarth";
|
|
10
|
+
WeaponTint2[WeaponTint2["Mk2ClassicBrownAndBlack"] = 8] = "Mk2ClassicBrownAndBlack";
|
|
11
|
+
WeaponTint2[WeaponTint2["Mk2RedContrast"] = 9] = "Mk2RedContrast";
|
|
12
|
+
WeaponTint2[WeaponTint2["Mk2BlueContrast"] = 10] = "Mk2BlueContrast";
|
|
13
|
+
WeaponTint2[WeaponTint2["Mk2YellowContrast"] = 11] = "Mk2YellowContrast";
|
|
14
|
+
WeaponTint2[WeaponTint2["Mk2OrangeContrast"] = 12] = "Mk2OrangeContrast";
|
|
15
|
+
WeaponTint2[WeaponTint2["Mk2BoldPink"] = 13] = "Mk2BoldPink";
|
|
16
|
+
WeaponTint2[WeaponTint2["Mk2BoldPurpleAndYellow"] = 14] = "Mk2BoldPurpleAndYellow";
|
|
17
|
+
WeaponTint2[WeaponTint2["Mk2BoldOrange"] = 15] = "Mk2BoldOrange";
|
|
18
|
+
WeaponTint2[WeaponTint2["Mk2BoldGreenAndPurple"] = 16] = "Mk2BoldGreenAndPurple";
|
|
19
|
+
WeaponTint2[WeaponTint2["Mk2BoldRedFeatures"] = 17] = "Mk2BoldRedFeatures";
|
|
20
|
+
WeaponTint2[WeaponTint2["Mk2BoldGreenFeatures"] = 18] = "Mk2BoldGreenFeatures";
|
|
21
|
+
WeaponTint2[WeaponTint2["Mk2BoldCyanFeatures"] = 19] = "Mk2BoldCyanFeatures";
|
|
22
|
+
WeaponTint2[WeaponTint2["Mk2BoldYellowFeatures"] = 20] = "Mk2BoldYellowFeatures";
|
|
23
|
+
WeaponTint2[WeaponTint2["Mk2BoldRedAndWhite"] = 21] = "Mk2BoldRedAndWhite";
|
|
24
|
+
WeaponTint2[WeaponTint2["Mk2BoldBlueAndWhite"] = 22] = "Mk2BoldBlueAndWhite";
|
|
25
|
+
WeaponTint2[WeaponTint2["Mk2MetallicGold"] = 23] = "Mk2MetallicGold";
|
|
26
|
+
WeaponTint2[WeaponTint2["Mk2MetallicPlatinum"] = 24] = "Mk2MetallicPlatinum";
|
|
27
|
+
WeaponTint2[WeaponTint2["Mk2MetallicGrayAndLilac"] = 25] = "Mk2MetallicGrayAndLilac";
|
|
28
|
+
WeaponTint2[WeaponTint2["Mk2MetallicPurpleAndLime"] = 26] = "Mk2MetallicPurpleAndLime";
|
|
29
|
+
WeaponTint2[WeaponTint2["Mk2MetallicRed"] = 27] = "Mk2MetallicRed";
|
|
30
|
+
WeaponTint2[WeaponTint2["Mk2MetallicGreen"] = 28] = "Mk2MetallicGreen";
|
|
31
|
+
WeaponTint2[WeaponTint2["Mk2MetallicBlue"] = 29] = "Mk2MetallicBlue";
|
|
32
|
+
WeaponTint2[WeaponTint2["Mk2MetallicWhiteAndAqua"] = 30] = "Mk2MetallicWhiteAndAqua";
|
|
33
|
+
WeaponTint2[WeaponTint2["Mk2MetallicRedAndYellow"] = 31] = "Mk2MetallicRedAndYellow";
|
|
34
|
+
WeaponTint2[WeaponTint2["Normal"] = 0] = "Normal";
|
|
35
|
+
WeaponTint2[WeaponTint2["Green"] = 1] = "Green";
|
|
36
|
+
WeaponTint2[WeaponTint2["Gold"] = 2] = "Gold";
|
|
37
|
+
WeaponTint2[WeaponTint2["Pink"] = 3] = "Pink";
|
|
38
|
+
WeaponTint2[WeaponTint2["Army"] = 4] = "Army";
|
|
39
|
+
WeaponTint2[WeaponTint2["LSPD"] = 5] = "LSPD";
|
|
40
|
+
WeaponTint2[WeaponTint2["Orange"] = 6] = "Orange";
|
|
41
|
+
WeaponTint2[WeaponTint2["Platinum"] = 7] = "Platinum";
|
|
42
|
+
return WeaponTint2;
|
|
43
|
+
})(WeaponTint || {});
|
|
44
|
+
export {
|
|
45
|
+
WeaponTint
|
|
46
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var ComponentAttachmentPoint = /* @__PURE__ */ ((ComponentAttachmentPoint2) => {
|
|
2
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Invalid"] = 4294967295] = "Invalid";
|
|
3
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Clip"] = 3723347892] = "Clip";
|
|
4
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Clip2"] = 291640902] = "Clip2";
|
|
5
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["FlashLaser"] = 679107254] = "FlashLaser";
|
|
6
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["FlashLaser2"] = 2722126698] = "FlashLaser2";
|
|
7
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Supp"] = 1863181664] = "Supp";
|
|
8
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Supp2"] = 945598191] = "Supp2";
|
|
9
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["GunRoot"] = 962500902] = "GunRoot";
|
|
10
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Scope"] = 196630833] = "Scope";
|
|
11
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Scope2"] = 1684637069] = "Scope2";
|
|
12
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Grip"] = 2972950469] = "Grip";
|
|
13
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Grip2"] = 3748215485] = "Grip2";
|
|
14
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["TorchBulb"] = 421673795] = "TorchBulb";
|
|
15
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Rail"] = 2451679629] = "Rail";
|
|
16
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Rail2"] = 497110245] = "Rail2";
|
|
17
|
+
ComponentAttachmentPoint2[ComponentAttachmentPoint2["Barrel"] = 2982890265] = "Barrel";
|
|
18
|
+
return ComponentAttachmentPoint2;
|
|
19
|
+
})(ComponentAttachmentPoint || {});
|
|
20
|
+
export {
|
|
21
|
+
ComponentAttachmentPoint
|
|
22
|
+
};
|