@nativewrappers/fivem 0.0.1
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/LICENSE +21 -0
- package/README.md +33 -0
- package/lib/client/Audio.d.ts +17 -0
- package/lib/client/Audio.js +92 -0
- package/lib/client/Blip.d.ts +39 -0
- package/lib/client/Blip.js +104 -0
- package/lib/client/Camera.d.ts +46 -0
- package/lib/client/Camera.js +161 -0
- package/lib/client/Checkpoint.d.ts +18 -0
- package/lib/client/Checkpoint.js +42 -0
- package/lib/client/Events.d.ts +11 -0
- package/lib/client/Events.js +73 -0
- package/lib/client/Game.d.ts +283 -0
- package/lib/client/Game.js +451 -0
- package/lib/client/GameplayCamera.d.ts +102 -0
- package/lib/client/GameplayCamera.js +141 -0
- package/lib/client/Model.d.ts +134 -0
- package/lib/client/Model.js +198 -0
- package/lib/client/NetworkedScene.d.ts +10 -0
- package/lib/client/NetworkedScene.js +17 -0
- package/lib/client/ParticleEffect.d.ts +80 -0
- package/lib/client/ParticleEffect.js +120 -0
- package/lib/client/ParticleEffectAsset.d.ts +54 -0
- package/lib/client/ParticleEffectAsset.js +104 -0
- package/lib/client/Pickup.d.ts +9 -0
- package/lib/client/Pickup.js +18 -0
- package/lib/client/Raycast.d.ts +49 -0
- package/lib/client/Raycast.js +70 -0
- package/lib/client/RelationshipGroup.d.ts +49 -0
- package/lib/client/RelationshipGroup.js +63 -0
- package/lib/client/Rope.d.ts +99 -0
- package/lib/client/Rope.js +125 -0
- package/lib/client/TaskSequence.d.ts +15 -0
- package/lib/client/TaskSequence.js +43 -0
- package/lib/client/Tasks.d.ts +66 -0
- package/lib/client/Tasks.js +236 -0
- package/lib/client/World.d.ts +402 -0
- package/lib/client/World.js +726 -0
- package/lib/client/cfx/StateBagChangeHandler.d.ts +3 -0
- package/lib/client/cfx/StateBagChangeHandler.js +1 -0
- package/lib/client/cfx/index.d.ts +7 -0
- package/lib/client/cfx/index.js +1 -0
- package/lib/client/enums/Alignment.d.ts +5 -0
- package/lib/client/enums/Alignment.js +6 -0
- package/lib/client/enums/AnimationFlags.d.ts +9 -0
- package/lib/client/enums/AnimationFlags.js +10 -0
- package/lib/client/enums/AudioFlag.d.ts +37 -0
- package/lib/client/enums/AudioFlag.js +38 -0
- package/lib/client/enums/BadgeStyle.d.ts +182 -0
- package/lib/client/enums/BadgeStyle.js +183 -0
- package/lib/client/enums/Blip.d.ts +223 -0
- package/lib/client/enums/Blip.js +225 -0
- package/lib/client/enums/Bone.d.ts +101 -0
- package/lib/client/enums/Bone.js +103 -0
- package/lib/client/enums/CameraShake.d.ts +13 -0
- package/lib/client/enums/CameraShake.js +14 -0
- package/lib/client/enums/CameraTypes.d.ts +7 -0
- package/lib/client/enums/CameraTypes.js +8 -0
- package/lib/client/enums/CheckboxStyle.d.ts +4 -0
- package/lib/client/enums/CheckboxStyle.js +5 -0
- package/lib/client/enums/Checkpoint.d.ts +62 -0
- package/lib/client/enums/Checkpoint.js +67 -0
- package/lib/client/enums/ClassTypes.d.ts +11 -0
- package/lib/client/enums/ClassTypes.js +12 -0
- package/lib/client/enums/CloudHat.d.ts +26 -0
- package/lib/client/enums/CloudHat.js +27 -0
- package/lib/client/enums/Control.d.ts +360 -0
- package/lib/client/enums/Control.js +361 -0
- package/lib/client/enums/CursorSprite.d.ts +14 -0
- package/lib/client/enums/CursorSprite.js +15 -0
- package/lib/client/enums/Driving.d.ts +32 -0
- package/lib/client/enums/Driving.js +34 -0
- package/lib/client/enums/ExplosionType.d.ts +44 -0
- package/lib/client/enums/ExplosionType.js +45 -0
- package/lib/client/enums/FiringPattern.d.ts +19 -0
- package/lib/client/enums/FiringPattern.js +20 -0
- package/lib/client/enums/Font.d.ts +7 -0
- package/lib/client/enums/Font.js +8 -0
- package/lib/client/enums/ForceType.d.ts +8 -0
- package/lib/client/enums/ForceType.js +9 -0
- package/lib/client/enums/Gender.d.ts +4 -0
- package/lib/client/enums/Gender.js +5 -0
- package/lib/client/enums/HelmetType.d.ts +5 -0
- package/lib/client/enums/HelmetType.js +6 -0
- package/lib/client/enums/HudColor.d.ts +183 -0
- package/lib/client/enums/HudColor.js +184 -0
- package/lib/client/enums/HudComponent.d.ts +53 -0
- package/lib/client/enums/HudComponent.js +54 -0
- package/lib/client/enums/InputMode.d.ts +4 -0
- package/lib/client/enums/InputMode.js +5 -0
- package/lib/client/enums/IntersectOptions.d.ts +15 -0
- package/lib/client/enums/IntersectOptions.js +16 -0
- package/lib/client/enums/InvertAxis.d.ts +9 -0
- package/lib/client/enums/InvertAxis.js +7 -0
- package/lib/client/enums/Language.d.ts +14 -0
- package/lib/client/enums/Language.js +15 -0
- package/lib/client/enums/LeaveVehicleFlags.d.ts +10 -0
- package/lib/client/enums/LeaveVehicleFlags.js +11 -0
- package/lib/client/enums/LoadingSpinnerType.d.ts +7 -0
- package/lib/client/enums/LoadingSpinnerType.js +8 -0
- package/lib/client/enums/MarkerType.d.ts +49 -0
- package/lib/client/enums/MarkerType.js +50 -0
- package/lib/client/enums/MenuAlignment.d.ts +4 -0
- package/lib/client/enums/MenuAlignment.js +5 -0
- package/lib/client/enums/NotificationType.d.ts +10 -0
- package/lib/client/enums/NotificationType.js +11 -0
- package/lib/client/enums/Parachute.d.ts +13 -0
- package/lib/client/enums/Parachute.js +15 -0
- package/lib/client/enums/PickupType.d.ts +73 -0
- package/lib/client/enums/PickupType.js +74 -0
- package/lib/client/enums/RadioStation.d.ts +24 -0
- package/lib/client/enums/RadioStation.js +25 -0
- package/lib/client/enums/RagdollType.d.ts +6 -0
- package/lib/client/enums/RagdollType.js +7 -0
- package/lib/client/enums/Relationship.d.ts +9 -0
- package/lib/client/enums/Relationship.js +10 -0
- package/lib/client/enums/RopeType.d.ts +5 -0
- package/lib/client/enums/RopeType.js +6 -0
- package/lib/client/enums/ScreenEffect.d.ts +83 -0
- package/lib/client/enums/ScreenEffect.js +84 -0
- package/lib/client/enums/SpeechModifier.d.ts +39 -0
- package/lib/client/enums/SpeechModifier.js +40 -0
- package/lib/client/enums/Vehicle.d.ts +358 -0
- package/lib/client/enums/Vehicle.js +376 -0
- package/lib/client/enums/Weather.d.ts +21 -0
- package/lib/client/enums/Weather.js +22 -0
- package/lib/client/enums/ZoneID.d.ts +94 -0
- package/lib/client/enums/ZoneID.js +95 -0
- package/lib/client/enums/index.d.ts +42 -0
- package/lib/client/enums/index.js +42 -0
- package/lib/client/hashes/MaterialHash.d.ts +216 -0
- package/lib/client/hashes/MaterialHash.js +217 -0
- package/lib/client/hashes/PedHash.d.ts +724 -0
- package/lib/client/hashes/PedHash.js +725 -0
- package/lib/client/hashes/VehicleHash.d.ts +522 -0
- package/lib/client/hashes/VehicleHash.js +523 -0
- package/lib/client/hashes/WeaponHash.d.ts +147 -0
- package/lib/client/hashes/WeaponHash.js +161 -0
- package/lib/client/hashes/WeatherTypeHash.d.ts +21 -0
- package/lib/client/hashes/WeatherTypeHash.js +22 -0
- package/lib/client/hashes/index.d.ts +5 -0
- package/lib/client/hashes/index.js +5 -0
- package/lib/client/index.d.ts +24 -0
- package/lib/client/index.js +25 -0
- package/lib/client/interfaces/Dimensions.d.ts +5 -0
- package/lib/client/interfaces/Dimensions.js +1 -0
- package/lib/client/models/BaseEntity.d.ts +169 -0
- package/lib/client/models/BaseEntity.js +459 -0
- package/lib/client/models/Entity.d.ts +9 -0
- package/lib/client/models/Entity.js +24 -0
- package/lib/client/models/EntityBone.d.ts +12 -0
- package/lib/client/models/EntityBone.js +24 -0
- package/lib/client/models/EntityBoneCollection.d.ts +11 -0
- package/lib/client/models/EntityBoneCollection.js +16 -0
- package/lib/client/models/Ped.d.ts +199 -0
- package/lib/client/models/Ped.js +685 -0
- package/lib/client/models/PedBone.d.ts +6 -0
- package/lib/client/models/PedBone.js +9 -0
- package/lib/client/models/PedBoneCollection.d.ts +8 -0
- package/lib/client/models/PedBoneCollection.js +19 -0
- package/lib/client/models/Player.d.ts +63 -0
- package/lib/client/models/Player.js +174 -0
- package/lib/client/models/Prop.d.ts +11 -0
- package/lib/client/models/Prop.js +26 -0
- package/lib/client/models/Vehicle.d.ts +171 -0
- package/lib/client/models/Vehicle.js +551 -0
- package/lib/client/models/VehicleDoor.d.ts +19 -0
- package/lib/client/models/VehicleDoor.js +42 -0
- package/lib/client/models/VehicleDoorCollection.d.ts +14 -0
- package/lib/client/models/VehicleDoorCollection.js +61 -0
- package/lib/client/models/VehicleMod.d.ts +16 -0
- package/lib/client/models/VehicleMod.js +33 -0
- package/lib/client/models/VehicleModCollection.d.ts +61 -0
- package/lib/client/models/VehicleModCollection.js +227 -0
- package/lib/client/models/VehicleToggleMod.d.ts +14 -0
- package/lib/client/models/VehicleToggleMod.js +27 -0
- package/lib/client/models/VehicleWheel.d.ts +11 -0
- package/lib/client/models/VehicleWheel.js +21 -0
- package/lib/client/models/VehicleWheelCollection.d.ts +13 -0
- package/lib/client/models/VehicleWheelCollection.js +56 -0
- package/lib/client/models/VehicleWindow.d.ts +16 -0
- package/lib/client/models/VehicleWindow.js +33 -0
- package/lib/client/models/VehicleWindowCollection.d.ts +14 -0
- package/lib/client/models/VehicleWindowCollection.js +55 -0
- package/lib/client/models/index.d.ts +18 -0
- package/lib/client/models/index.js +18 -0
- package/lib/client/types/EntityType.d.ts +2 -0
- package/lib/client/types/EntityType.js +1 -0
- package/lib/client/ui/Container.d.ts +11 -0
- package/lib/client/ui/Container.js +28 -0
- package/lib/client/ui/Effects.d.ts +8 -0
- package/lib/client/ui/Effects.js +106 -0
- package/lib/client/ui/Fading.d.ts +41 -0
- package/lib/client/ui/Fading.js +69 -0
- package/lib/client/ui/Hud.d.ts +16 -0
- package/lib/client/ui/Hud.js +39 -0
- package/lib/client/ui/InstructionalButtons.d.ts +33 -0
- package/lib/client/ui/InstructionalButtons.js +53 -0
- package/lib/client/ui/LoadingPrompt.d.ts +27 -0
- package/lib/client/ui/LoadingPrompt.js +45 -0
- package/lib/client/ui/Notification.d.ts +5 -0
- package/lib/client/ui/Notification.js +8 -0
- package/lib/client/ui/Rectangle.d.ts +10 -0
- package/lib/client/ui/Rectangle.js +37 -0
- package/lib/client/ui/Scaleform.d.ts +106 -0
- package/lib/client/ui/Scaleform.js +234 -0
- package/lib/client/ui/Screen.d.ts +16 -0
- package/lib/client/ui/Screen.js +72 -0
- package/lib/client/ui/Sprite.d.ts +17 -0
- package/lib/client/ui/Sprite.js +53 -0
- package/lib/client/ui/Text.d.ts +31 -0
- package/lib/client/ui/Text.js +102 -0
- package/lib/client/ui/Timerbar.d.ts +44 -0
- package/lib/client/ui/Timerbar.js +241 -0
- package/lib/client/ui/index.d.ts +15 -0
- package/lib/client/ui/index.js +15 -0
- package/lib/client/ui/interfaces/IButton.d.ts +5 -0
- package/lib/client/ui/interfaces/IButton.js +1 -0
- package/lib/client/ui/interfaces/IDrawable.d.ts +7 -0
- package/lib/client/ui/interfaces/IDrawable.js +1 -0
- package/lib/client/ui/interfaces/index.d.ts +2 -0
- package/lib/client/ui/interfaces/index.js +1 -0
- package/lib/client/ui/menu/Menu.d.ts +108 -0
- package/lib/client/ui/menu/Menu.js +802 -0
- package/lib/client/ui/menu/MenuControl.d.ts +6 -0
- package/lib/client/ui/menu/MenuControl.js +11 -0
- package/lib/client/ui/menu/MenuControls.d.ts +9 -0
- package/lib/client/ui/menu/MenuControls.js +11 -0
- package/lib/client/ui/menu/MenuSettings.d.ts +20 -0
- package/lib/client/ui/menu/MenuSettings.js +51 -0
- package/lib/client/ui/menu/index.d.ts +6 -0
- package/lib/client/ui/menu/index.js +6 -0
- package/lib/client/ui/menu/items/UIMenuCheckboxItem.d.ts +20 -0
- package/lib/client/ui/menu/items/UIMenuCheckboxItem.js +57 -0
- package/lib/client/ui/menu/items/UIMenuItem.d.ts +78 -0
- package/lib/client/ui/menu/items/UIMenuItem.js +1090 -0
- package/lib/client/ui/menu/items/UIMenuListItem.d.ts +31 -0
- package/lib/client/ui/menu/items/UIMenuListItem.js +110 -0
- package/lib/client/ui/menu/items/UIMenuSeparatorItem.d.ts +11 -0
- package/lib/client/ui/menu/items/UIMenuSeparatorItem.js +29 -0
- package/lib/client/ui/menu/items/UIMenuSliderItem.d.ts +47 -0
- package/lib/client/ui/menu/items/UIMenuSliderItem.js +173 -0
- package/lib/client/ui/menu/items/index.d.ts +6 -0
- package/lib/client/ui/menu/items/index.js +6 -0
- package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.d.ts +17 -0
- package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.js +43 -0
- package/lib/client/ui/menu/items/panels/UIMenuColorPanel.d.ts +36 -0
- package/lib/client/ui/menu/items/panels/UIMenuColorPanel.js +211 -0
- package/lib/client/ui/menu/items/panels/UIMenuGridPanel.d.ts +40 -0
- package/lib/client/ui/menu/items/panels/UIMenuGridPanel.js +215 -0
- package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.d.ts +26 -0
- package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.js +115 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.d.ts +16 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.js +77 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.d.ts +13 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.js +32 -0
- package/lib/client/ui/menu/items/panels/index.d.ts +6 -0
- package/lib/client/ui/menu/items/panels/index.js +6 -0
- package/lib/client/ui/menu/modules/ListItem.d.ts +6 -0
- package/lib/client/ui/menu/modules/ListItem.js +8 -0
- package/lib/client/ui/menu/modules/index.d.ts +1 -0
- package/lib/client/ui/menu/modules/index.js +1 -0
- package/lib/client/utils/Animations.d.ts +19 -0
- package/lib/client/utils/Animations.js +55 -0
- package/lib/client/utils/Color.d.ts +15 -0
- package/lib/client/utils/Color.js +22 -0
- package/lib/client/utils/Crypto.d.ts +3 -0
- package/lib/client/utils/Crypto.js +25 -0
- package/lib/client/utils/LiteEvent.d.ts +13 -0
- package/lib/client/utils/LiteEvent.js +21 -0
- package/lib/client/utils/Maths.d.ts +4 -0
- package/lib/client/utils/Maths.js +10 -0
- package/lib/client/utils/Point.d.ts +9 -0
- package/lib/client/utils/Point.js +28 -0
- package/lib/client/utils/PointF.d.ts +12 -0
- package/lib/client/utils/PointF.js +11 -0
- package/lib/client/utils/Quaternion.d.ts +10 -0
- package/lib/client/utils/Quaternion.js +23 -0
- package/lib/client/utils/Size.d.ts +5 -0
- package/lib/client/utils/Size.js +6 -0
- package/lib/client/utils/String.d.ts +6 -0
- package/lib/client/utils/String.js +25 -0
- package/lib/client/utils/Vector2.d.ts +54 -0
- package/lib/client/utils/Vector2.js +106 -0
- package/lib/client/utils/Vector3.d.ts +69 -0
- package/lib/client/utils/Vector3.js +140 -0
- package/lib/client/utils/Vector4.d.ts +62 -0
- package/lib/client/utils/Vector4.js +124 -0
- package/lib/client/utils/enumValues.d.ts +12 -0
- package/lib/client/utils/enumValues.js +14 -0
- package/lib/client/utils/getStringFromUInt8Array.d.ts +8 -0
- package/lib/client/utils/getStringFromUInt8Array.js +10 -0
- package/lib/client/utils/getUInt32FromUint8Array.d.ts +8 -0
- package/lib/client/utils/getUInt32FromUint8Array.js +8 -0
- package/lib/client/utils/index.d.ts +10 -0
- package/lib/client/utils/index.js +10 -0
- package/lib/client/weapon/DlcWeaponData.d.ts +43 -0
- package/lib/client/weapon/DlcWeaponData.js +44 -0
- package/lib/client/weapon/Mk2WeaponHash.d.ts +18 -0
- package/lib/client/weapon/Mk2WeaponHash.js +25 -0
- package/lib/client/weapon/Weapon.d.ts +169 -0
- package/lib/client/weapon/Weapon.js +267 -0
- package/lib/client/weapon/WeaponAsset.d.ts +55 -0
- package/lib/client/weapon/WeaponAsset.js +83 -0
- package/lib/client/weapon/WeaponCollection.d.ts +90 -0
- package/lib/client/weapon/WeaponCollection.js +186 -0
- package/lib/client/weapon/WeaponDisplayNameByHash.d.ts +6 -0
- package/lib/client/weapon/WeaponDisplayNameByHash.js +75 -0
- package/lib/client/weapon/WeaponGroup.d.ts +18 -0
- package/lib/client/weapon/WeaponGroup.js +19 -0
- package/lib/client/weapon/WeaponHudStats.d.ts +27 -0
- package/lib/client/weapon/WeaponHudStats.js +38 -0
- package/lib/client/weapon/WeaponLivery.d.ts +13 -0
- package/lib/client/weapon/WeaponLivery.js +14 -0
- package/lib/client/weapon/WeaponLiveryColor.d.ts +34 -0
- package/lib/client/weapon/WeaponLiveryColor.js +35 -0
- package/lib/client/weapon/WeaponTint.d.ts +42 -0
- package/lib/client/weapon/WeaponTint.js +43 -0
- package/lib/client/weapon/index.d.ts +8 -0
- package/lib/client/weapon/index.js +8 -0
- package/lib/client/weaponComponent/ComponentAttachmentPoint.d.ts +18 -0
- package/lib/client/weaponComponent/ComponentAttachmentPoint.js +19 -0
- package/lib/client/weaponComponent/ComponentAttachmentPointByHash.d.ts +7 -0
- package/lib/client/weaponComponent/ComponentAttachmentPointByHash.js +309 -0
- package/lib/client/weaponComponent/ComponentDisplayNameByHash.d.ts +6 -0
- package/lib/client/weaponComponent/ComponentDisplayNameByHash.js +280 -0
- package/lib/client/weaponComponent/DlcWeaponComponentData.d.ts +40 -0
- package/lib/client/weaponComponent/DlcWeaponComponentData.js +44 -0
- package/lib/client/weaponComponent/InvalidWeaponComponent.d.ts +12 -0
- package/lib/client/weaponComponent/InvalidWeaponComponent.js +28 -0
- package/lib/client/weaponComponent/WeaponComponent.d.ts +81 -0
- package/lib/client/weaponComponent/WeaponComponent.js +119 -0
- package/lib/client/weaponComponent/WeaponComponentCollection.d.ts +108 -0
- package/lib/client/weaponComponent/WeaponComponentCollection.js +172 -0
- package/lib/client/weaponComponent/WeaponComponentHash.d.ts +671 -0
- package/lib/client/weaponComponent/WeaponComponentHash.js +887 -0
- package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.d.ts +8 -0
- package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.js +823 -0
- package/lib/client/weaponComponent/WeaponComponentHudStats.d.ts +27 -0
- package/lib/client/weaponComponent/WeaponComponentHudStats.js +34 -0
- package/lib/client/weaponComponent/index.d.ts +5 -0
- package/lib/client/weaponComponent/index.js +5 -0
- package/lib/common/Convar.d.ts +8 -0
- package/lib/common/Convar.js +20 -0
- package/lib/common/Kvp.d.ts +91 -0
- package/lib/common/Kvp.js +161 -0
- package/lib/common/Resource.d.ts +14 -0
- package/lib/common/Resource.js +35 -0
- package/lib/common/index.d.ts +5 -0
- package/lib/common/index.js +5 -0
- package/lib/common/types.d.ts +6 -0
- package/lib/common/types.js +1 -0
- package/lib/common/utils/Color.d.ts +10 -0
- package/lib/common/utils/Color.js +17 -0
- package/lib/common/utils/Maths.d.ts +4 -0
- package/lib/common/utils/Maths.js +10 -0
- package/lib/common/utils/PointF.d.ts +12 -0
- package/lib/common/utils/PointF.js +11 -0
- package/lib/common/utils/Quaternion.d.ts +10 -0
- package/lib/common/utils/Quaternion.js +23 -0
- package/lib/common/utils/Vector2.d.ts +58 -0
- package/lib/common/utils/Vector2.js +113 -0
- package/lib/common/utils/Vector3.d.ts +73 -0
- package/lib/common/utils/Vector3.js +147 -0
- package/lib/common/utils/Vector4.d.ts +66 -0
- package/lib/common/utils/Vector4.js +131 -0
- package/lib/common/utils/cleanPlayerName.d.ts +6 -0
- package/lib/common/utils/cleanPlayerName.js +27 -0
- package/lib/common/utils/enumValues.d.ts +12 -0
- package/lib/common/utils/enumValues.js +14 -0
- package/lib/common/utils/getStringFromUInt8Array.d.ts +8 -0
- package/lib/common/utils/getStringFromUInt8Array.js +10 -0
- package/lib/common/utils/getUInt32FromUint8Array.d.ts +8 -0
- package/lib/common/utils/getUInt32FromUint8Array.js +8 -0
- package/lib/common/utils/index.d.ts +12 -0
- package/lib/common/utils/index.js +12 -0
- package/lib/server/Anticheat.d.ts +0 -0
- package/lib/server/Anticheat.js +25 -0
- package/lib/server/Events.d.ts +35 -0
- package/lib/server/Events.js +102 -0
- package/lib/server/Game.d.ts +56 -0
- package/lib/server/Game.js +86 -0
- package/lib/server/cfx/StateBagChangeHandler.d.ts +9 -0
- package/lib/server/cfx/StateBagChangeHandler.js +4 -0
- package/lib/server/cfx/index.d.ts +7 -0
- package/lib/server/cfx/index.js +1 -0
- package/lib/server/entities/BaseEntity.d.ts +115 -0
- package/lib/server/entities/BaseEntity.js +161 -0
- package/lib/server/entities/Entity.d.ts +18 -0
- package/lib/server/entities/Entity.js +22 -0
- package/lib/server/entities/Ped.d.ts +87 -0
- package/lib/server/entities/Ped.js +122 -0
- package/lib/server/entities/Player.d.ts +163 -0
- package/lib/server/entities/Player.js +235 -0
- package/lib/server/entities/Prop.d.ts +32 -0
- package/lib/server/entities/Prop.js +42 -0
- package/lib/server/entities/Vehicle.d.ts +230 -0
- package/lib/server/entities/Vehicle.js +331 -0
- package/lib/server/entities/index.d.ts +5 -0
- package/lib/server/entities/index.js +5 -0
- package/lib/server/enum/ClassTypes.d.ts +11 -0
- package/lib/server/enum/ClassTypes.js +12 -0
- package/lib/server/enum/PopulationType.d.ts +13 -0
- package/lib/server/enum/PopulationType.js +14 -0
- package/lib/server/enum/VehicleLockStatus.d.ts +9 -0
- package/lib/server/enum/VehicleLockStatus.js +10 -0
- package/lib/server/enum/VehicleType.d.ts +10 -0
- package/lib/server/enum/VehicleType.js +11 -0
- package/lib/server/enum/eEntityType.d.ts +5 -0
- package/lib/server/enum/eEntityType.js +6 -0
- package/lib/server/enum/index.d.ts +5 -0
- package/lib/server/enum/index.js +5 -0
- package/lib/server/index.d.ts +7 -0
- package/lib/server/index.js +7 -0
- package/lib/server/type/Anticheat.d.ts +471 -0
- package/lib/server/type/Anticheat.js +160 -0
- package/lib/server/type/Hash.d.ts +3 -0
- package/lib/server/type/Hash.js +2 -0
- package/lib/server/utils/index.d.ts +1 -0
- package/lib/server/utils/index.js +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class VehicleMod {
|
|
2
|
+
constructor(owner, modType) {
|
|
3
|
+
this._owner = owner;
|
|
4
|
+
this._modType = modType;
|
|
5
|
+
}
|
|
6
|
+
get ModType() {
|
|
7
|
+
return this._modType;
|
|
8
|
+
}
|
|
9
|
+
set ModType(modType) {
|
|
10
|
+
this._modType = modType;
|
|
11
|
+
}
|
|
12
|
+
get Index() {
|
|
13
|
+
return GetVehicleMod(this._owner.Handle, this.ModType);
|
|
14
|
+
}
|
|
15
|
+
set Index(value) {
|
|
16
|
+
SetVehicleMod(this._owner.Handle, this.ModType, value, this.Variation);
|
|
17
|
+
}
|
|
18
|
+
get Variation() {
|
|
19
|
+
return GetVehicleModVariation(this._owner.Handle, this.ModType);
|
|
20
|
+
}
|
|
21
|
+
set Variation(value) {
|
|
22
|
+
SetVehicleMod(this._owner.Handle, this.ModType, this.Index, value);
|
|
23
|
+
}
|
|
24
|
+
get ModCount() {
|
|
25
|
+
return GetNumVehicleMods(this._owner.Handle, this.ModType);
|
|
26
|
+
}
|
|
27
|
+
get Vehicle() {
|
|
28
|
+
return this._owner;
|
|
29
|
+
}
|
|
30
|
+
remove() {
|
|
31
|
+
RemoveVehicleMod(this._owner.Handle, this.ModType);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Vehicle } from './Vehicle';
|
|
2
|
+
import { VehicleColor, VehicleModType, VehicleNeonLight, VehiclePaintType, VehicleToggleModType, VehicleWheelType, VehicleWindowTint, LicensePlateStyle, LicensePlateType } from '../enums';
|
|
3
|
+
import { VehicleMod } from './VehicleMod';
|
|
4
|
+
import { Color } from '../utils';
|
|
5
|
+
import { VehicleToggleMod } from './VehicleToggleMod';
|
|
6
|
+
export declare class VehicleModCollection {
|
|
7
|
+
private _owner;
|
|
8
|
+
private readonly _vehicleMods;
|
|
9
|
+
private readonly _vehicleToggleMods;
|
|
10
|
+
constructor(owner: Vehicle);
|
|
11
|
+
hasVehicleMod(type: VehicleModType): boolean;
|
|
12
|
+
getMod(modType: VehicleModType): VehicleMod | undefined;
|
|
13
|
+
getToggleMod(modType: VehicleToggleModType): VehicleToggleMod | undefined;
|
|
14
|
+
getAllMods(): (VehicleMod | null | undefined)[];
|
|
15
|
+
get WheelType(): VehicleWheelType;
|
|
16
|
+
set WheelType(type: VehicleWheelType);
|
|
17
|
+
installModKit(): void;
|
|
18
|
+
get Livery(): number | undefined;
|
|
19
|
+
set Livery(value: number | undefined);
|
|
20
|
+
get LiveryCount(): number;
|
|
21
|
+
get WindowTint(): VehicleWindowTint;
|
|
22
|
+
set WindowTint(tint: VehicleWindowTint);
|
|
23
|
+
get PrimaryColor(): VehicleColor;
|
|
24
|
+
set PrimaryColor(color: VehicleColor);
|
|
25
|
+
get SecondaryColor(): VehicleColor;
|
|
26
|
+
set SecondaryColor(color: VehicleColor);
|
|
27
|
+
get RimColor(): VehicleColor;
|
|
28
|
+
set RimColor(color: VehicleColor);
|
|
29
|
+
get PearlescentColor(): VehicleColor;
|
|
30
|
+
set PearlescentColor(color: VehicleColor);
|
|
31
|
+
set TrimColor(color: VehicleColor);
|
|
32
|
+
set DashboardColor(color: VehicleColor);
|
|
33
|
+
setModColor1(paintType: VehiclePaintType, color: VehicleColor): void;
|
|
34
|
+
setModColor2(paintType: VehiclePaintType, color: VehicleColor): void;
|
|
35
|
+
get ColorCombination(): number;
|
|
36
|
+
set ColorCombination(value: number);
|
|
37
|
+
get ColorCombinationCount(): number;
|
|
38
|
+
get TireSmokeColor(): Color;
|
|
39
|
+
set TireSmokeColor(color: Color);
|
|
40
|
+
get NeonLightsColor(): Color;
|
|
41
|
+
set NeonLightsColor(color: Color);
|
|
42
|
+
isNeonLightsOn(light: VehicleNeonLight): boolean;
|
|
43
|
+
setNeonLightsOn(light: VehicleNeonLight, on: boolean): void;
|
|
44
|
+
areAllNeonLightsOn(): boolean;
|
|
45
|
+
setAllNeonLightsOn(on: boolean): void;
|
|
46
|
+
get HasAllNeonLights(): boolean;
|
|
47
|
+
hasNeonLight(light: VehicleNeonLight): boolean;
|
|
48
|
+
get CustomPrimaryColor(): Color;
|
|
49
|
+
set CustomPrimaryColor(color: Color);
|
|
50
|
+
get CustomSecondaryColor(): Color;
|
|
51
|
+
set CustomSecondaryColor(color: Color);
|
|
52
|
+
get IsPrimaryColorCustom(): boolean;
|
|
53
|
+
get IsSecondaryColorCustom(): boolean;
|
|
54
|
+
clearCustomPrimaryColor(): void;
|
|
55
|
+
clearCustomSecondaryColor(): void;
|
|
56
|
+
get LicensePlateStyle(): LicensePlateStyle;
|
|
57
|
+
set LicensePlateStyle(style: LicensePlateStyle);
|
|
58
|
+
get LicensePlateType(): LicensePlateType;
|
|
59
|
+
get LicensePlate(): string;
|
|
60
|
+
set LicensePlate(text: string);
|
|
61
|
+
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { VehicleModType, VehicleNeonLight, } from '../enums';
|
|
2
|
+
import { VehicleMod } from './VehicleMod';
|
|
3
|
+
import { Color } from '../utils';
|
|
4
|
+
import { VehicleToggleMod } from './VehicleToggleMod';
|
|
5
|
+
export class VehicleModCollection {
|
|
6
|
+
constructor(owner) {
|
|
7
|
+
this._vehicleMods = new Map();
|
|
8
|
+
this._vehicleToggleMods = new Map();
|
|
9
|
+
this._owner = owner;
|
|
10
|
+
}
|
|
11
|
+
hasVehicleMod(type) {
|
|
12
|
+
return GetNumVehicleMods(this._owner.Handle, type) > 0;
|
|
13
|
+
}
|
|
14
|
+
getMod(modType) {
|
|
15
|
+
if (!this._vehicleMods.has(modType)) {
|
|
16
|
+
this._vehicleMods.set(modType, new VehicleMod(this._owner, modType));
|
|
17
|
+
}
|
|
18
|
+
return this._vehicleMods.get(modType);
|
|
19
|
+
}
|
|
20
|
+
getToggleMod(modType) {
|
|
21
|
+
if (!this._vehicleToggleMods.has(modType)) {
|
|
22
|
+
this._vehicleToggleMods.set(modType, new VehicleToggleMod(this._owner, modType));
|
|
23
|
+
}
|
|
24
|
+
return this._vehicleToggleMods.get(modType);
|
|
25
|
+
}
|
|
26
|
+
getAllMods() {
|
|
27
|
+
return Object.keys(VehicleModType)
|
|
28
|
+
.filter(key => !isNaN(Number(key)))
|
|
29
|
+
.map(key => {
|
|
30
|
+
const index = Number(key);
|
|
31
|
+
if (this.hasVehicleMod(index)) {
|
|
32
|
+
return this.getMod(index);
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
})
|
|
36
|
+
.filter(m => m);
|
|
37
|
+
}
|
|
38
|
+
get WheelType() {
|
|
39
|
+
return GetVehicleWheelType(this._owner.Handle);
|
|
40
|
+
}
|
|
41
|
+
set WheelType(type) {
|
|
42
|
+
SetVehicleWheelType(this._owner.Handle, type);
|
|
43
|
+
}
|
|
44
|
+
installModKit() {
|
|
45
|
+
SetVehicleModKit(this._owner.Handle, 0);
|
|
46
|
+
}
|
|
47
|
+
get Livery() {
|
|
48
|
+
const modCount = this.getMod(VehicleModType.Livery)?.ModCount;
|
|
49
|
+
if (modCount !== undefined && modCount > 0) {
|
|
50
|
+
return this.getMod(VehicleModType.Livery)?.Index;
|
|
51
|
+
}
|
|
52
|
+
return GetVehicleLivery(this._owner.Handle);
|
|
53
|
+
}
|
|
54
|
+
set Livery(value) {
|
|
55
|
+
if (value === undefined)
|
|
56
|
+
return;
|
|
57
|
+
const mod = this.getMod(VehicleModType.Livery);
|
|
58
|
+
if (mod !== undefined && mod.ModCount > 0) {
|
|
59
|
+
mod.Index = value;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
SetVehicleLivery(this._owner.Handle, value);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
get LiveryCount() {
|
|
66
|
+
const modCount = this.getMod(VehicleModType.Livery)?.ModCount;
|
|
67
|
+
if (modCount !== undefined && modCount > 0) {
|
|
68
|
+
return modCount;
|
|
69
|
+
}
|
|
70
|
+
return GetVehicleLiveryCount(this._owner.Handle);
|
|
71
|
+
}
|
|
72
|
+
get WindowTint() {
|
|
73
|
+
return GetVehicleWindowTint(this._owner.Handle);
|
|
74
|
+
}
|
|
75
|
+
set WindowTint(tint) {
|
|
76
|
+
SetVehicleWindowTint(this._owner.Handle, tint);
|
|
77
|
+
}
|
|
78
|
+
get PrimaryColor() {
|
|
79
|
+
return GetVehicleColours(this._owner.Handle)[0];
|
|
80
|
+
}
|
|
81
|
+
set PrimaryColor(color) {
|
|
82
|
+
SetVehicleColours(this._owner.Handle, color, this.SecondaryColor);
|
|
83
|
+
}
|
|
84
|
+
get SecondaryColor() {
|
|
85
|
+
return GetVehicleColours(this._owner.Handle)[1];
|
|
86
|
+
}
|
|
87
|
+
set SecondaryColor(color) {
|
|
88
|
+
SetVehicleColours(this._owner.Handle, this.PrimaryColor, color);
|
|
89
|
+
}
|
|
90
|
+
get RimColor() {
|
|
91
|
+
return GetVehicleExtraColours(this._owner.Handle)[1];
|
|
92
|
+
}
|
|
93
|
+
set RimColor(color) {
|
|
94
|
+
SetVehicleExtraColours(this._owner.Handle, this.PearlescentColor, color);
|
|
95
|
+
}
|
|
96
|
+
get PearlescentColor() {
|
|
97
|
+
return GetVehicleExtraColours(this._owner.Handle)[0];
|
|
98
|
+
}
|
|
99
|
+
set PearlescentColor(color) {
|
|
100
|
+
SetVehicleExtraColours(this._owner.Handle, color, this.RimColor);
|
|
101
|
+
}
|
|
102
|
+
set TrimColor(color) {
|
|
103
|
+
SetVehicleInteriorColour(this._owner.Handle, color);
|
|
104
|
+
}
|
|
105
|
+
set DashboardColor(color) {
|
|
106
|
+
SetVehicleDashboardColour(this._owner.Handle, color);
|
|
107
|
+
}
|
|
108
|
+
setModColor1(paintType, color) {
|
|
109
|
+
SetVehicleModColor_1(this._owner.Handle, paintType, color, 0);
|
|
110
|
+
}
|
|
111
|
+
setModColor2(paintType, color) {
|
|
112
|
+
SetVehicleModColor_2(this._owner.Handle, paintType, color);
|
|
113
|
+
}
|
|
114
|
+
get ColorCombination() {
|
|
115
|
+
return GetVehicleColourCombination(this._owner.Handle);
|
|
116
|
+
}
|
|
117
|
+
set ColorCombination(value) {
|
|
118
|
+
SetVehicleColourCombination(this._owner.Handle, value);
|
|
119
|
+
}
|
|
120
|
+
get ColorCombinationCount() {
|
|
121
|
+
return GetNumberOfVehicleColours(this._owner.Handle);
|
|
122
|
+
}
|
|
123
|
+
get TireSmokeColor() {
|
|
124
|
+
const color = GetVehicleTyreSmokeColor(this._owner.Handle);
|
|
125
|
+
return Color.fromRgb(color[0], color[1], color[2]);
|
|
126
|
+
}
|
|
127
|
+
set TireSmokeColor(color) {
|
|
128
|
+
SetVehicleTyreSmokeColor(this._owner.Handle, color.r, color.g, color.b);
|
|
129
|
+
}
|
|
130
|
+
get NeonLightsColor() {
|
|
131
|
+
const color = GetVehicleNeonLightsColour(this._owner.Handle);
|
|
132
|
+
return Color.fromRgb(color[0], color[1], color[2]);
|
|
133
|
+
}
|
|
134
|
+
set NeonLightsColor(color) {
|
|
135
|
+
SetVehicleNeonLightsColour(this._owner.Handle, color.r, color.g, color.b);
|
|
136
|
+
}
|
|
137
|
+
isNeonLightsOn(light) {
|
|
138
|
+
return IsVehicleNeonLightEnabled(this._owner.Handle, light);
|
|
139
|
+
}
|
|
140
|
+
setNeonLightsOn(light, on) {
|
|
141
|
+
SetVehicleNeonLightEnabled(this._owner.Handle, light, on);
|
|
142
|
+
}
|
|
143
|
+
areAllNeonLightsOn() {
|
|
144
|
+
if (!this.HasAllNeonLights) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
let on = true;
|
|
148
|
+
Object.keys(VehicleNeonLight)
|
|
149
|
+
.filter(key => !isNaN(Number(key)))
|
|
150
|
+
.forEach(key => {
|
|
151
|
+
if (!on) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
on = this.isNeonLightsOn(Number(key));
|
|
155
|
+
});
|
|
156
|
+
return on;
|
|
157
|
+
}
|
|
158
|
+
setAllNeonLightsOn(on) {
|
|
159
|
+
Object.keys(VehicleNeonLight)
|
|
160
|
+
.filter(key => !isNaN(Number(key)))
|
|
161
|
+
.forEach(key => {
|
|
162
|
+
this.setNeonLightsOn(Number(key), on);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
get HasAllNeonLights() {
|
|
166
|
+
return (Object.keys(VehicleNeonLight)
|
|
167
|
+
.filter(key => !isNaN(Number(key)))
|
|
168
|
+
.findIndex(light => !this.hasNeonLight(Number(light))) === -1);
|
|
169
|
+
}
|
|
170
|
+
hasNeonLight(light) {
|
|
171
|
+
if (this._owner.Bones === undefined)
|
|
172
|
+
return false;
|
|
173
|
+
switch (light) {
|
|
174
|
+
case VehicleNeonLight.Left:
|
|
175
|
+
return this._owner.Bones.hasBone('neon_l');
|
|
176
|
+
case VehicleNeonLight.Right:
|
|
177
|
+
return this._owner.Bones.hasBone('neon_r');
|
|
178
|
+
case VehicleNeonLight.Front:
|
|
179
|
+
return this._owner.Bones.hasBone('neon_f');
|
|
180
|
+
case VehicleNeonLight.Back:
|
|
181
|
+
return this._owner.Bones.hasBone('neon_b');
|
|
182
|
+
default:
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
get CustomPrimaryColor() {
|
|
187
|
+
const color = GetVehicleCustomPrimaryColour(this._owner.Handle);
|
|
188
|
+
return Color.fromRgb(color[0], color[1], color[2]);
|
|
189
|
+
}
|
|
190
|
+
set CustomPrimaryColor(color) {
|
|
191
|
+
SetVehicleCustomPrimaryColour(this._owner.Handle, color.r, color.g, color.b);
|
|
192
|
+
}
|
|
193
|
+
get CustomSecondaryColor() {
|
|
194
|
+
const color = GetVehicleCustomSecondaryColour(this._owner.Handle);
|
|
195
|
+
return Color.fromRgb(color[0], color[1], color[2]);
|
|
196
|
+
}
|
|
197
|
+
set CustomSecondaryColor(color) {
|
|
198
|
+
SetVehicleCustomSecondaryColour(this._owner.Handle, color.r, color.g, color.b);
|
|
199
|
+
}
|
|
200
|
+
get IsPrimaryColorCustom() {
|
|
201
|
+
return GetIsVehiclePrimaryColourCustom(this._owner.Handle);
|
|
202
|
+
}
|
|
203
|
+
get IsSecondaryColorCustom() {
|
|
204
|
+
return GetIsVehicleSecondaryColourCustom(this._owner.Handle);
|
|
205
|
+
}
|
|
206
|
+
clearCustomPrimaryColor() {
|
|
207
|
+
ClearVehicleCustomPrimaryColour(this._owner.Handle);
|
|
208
|
+
}
|
|
209
|
+
clearCustomSecondaryColor() {
|
|
210
|
+
ClearVehicleCustomSecondaryColour(this._owner.Handle);
|
|
211
|
+
}
|
|
212
|
+
get LicensePlateStyle() {
|
|
213
|
+
return GetVehicleNumberPlateTextIndex(this._owner.Handle);
|
|
214
|
+
}
|
|
215
|
+
set LicensePlateStyle(style) {
|
|
216
|
+
SetVehicleNumberPlateTextIndex(this._owner.Handle, style);
|
|
217
|
+
}
|
|
218
|
+
get LicensePlateType() {
|
|
219
|
+
return GetVehiclePlateType(this._owner.Handle);
|
|
220
|
+
}
|
|
221
|
+
get LicensePlate() {
|
|
222
|
+
return GetVehicleNumberPlateText(this._owner.Handle);
|
|
223
|
+
}
|
|
224
|
+
set LicensePlate(text) {
|
|
225
|
+
SetVehicleNumberPlateText(this._owner.Handle, text);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Vehicle } from './Vehicle';
|
|
2
|
+
import { VehicleToggleModType } from '../enums';
|
|
3
|
+
export declare class VehicleToggleMod {
|
|
4
|
+
private _owner;
|
|
5
|
+
private _modType;
|
|
6
|
+
constructor(owner: Vehicle, modType: VehicleToggleModType);
|
|
7
|
+
get ModType(): VehicleToggleModType;
|
|
8
|
+
set ModType(modType: VehicleToggleModType);
|
|
9
|
+
get IsInstalled(): boolean;
|
|
10
|
+
set IsInstalled(value: boolean);
|
|
11
|
+
get LocalizedModTypeName(): string;
|
|
12
|
+
get Vehicle(): Vehicle;
|
|
13
|
+
remove(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class VehicleToggleMod {
|
|
2
|
+
constructor(owner, modType) {
|
|
3
|
+
this._owner = owner;
|
|
4
|
+
this._modType = modType;
|
|
5
|
+
}
|
|
6
|
+
get ModType() {
|
|
7
|
+
return this._modType;
|
|
8
|
+
}
|
|
9
|
+
set ModType(modType) {
|
|
10
|
+
this._modType = modType;
|
|
11
|
+
}
|
|
12
|
+
get IsInstalled() {
|
|
13
|
+
return IsToggleModOn(this._owner.Handle, this.ModType);
|
|
14
|
+
}
|
|
15
|
+
set IsInstalled(value) {
|
|
16
|
+
ToggleVehicleMod(this._owner.Handle, this.ModType, value);
|
|
17
|
+
}
|
|
18
|
+
get LocalizedModTypeName() {
|
|
19
|
+
return GetModSlotName(this._owner.Handle, this.ModType);
|
|
20
|
+
}
|
|
21
|
+
get Vehicle() {
|
|
22
|
+
return this._owner;
|
|
23
|
+
}
|
|
24
|
+
remove() {
|
|
25
|
+
RemoveVehicleMod(this._owner.Handle, this.ModType);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Vehicle } from './Vehicle';
|
|
2
|
+
export declare class VehicleWheel {
|
|
3
|
+
private _owner;
|
|
4
|
+
private _index;
|
|
5
|
+
constructor(owner: Vehicle, index: number);
|
|
6
|
+
get Index(): number;
|
|
7
|
+
set Index(index: number);
|
|
8
|
+
get Vehicle(): Vehicle;
|
|
9
|
+
burst(): void;
|
|
10
|
+
fix(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class VehicleWheel {
|
|
2
|
+
constructor(owner, index) {
|
|
3
|
+
this._owner = owner;
|
|
4
|
+
this._index = index;
|
|
5
|
+
}
|
|
6
|
+
get Index() {
|
|
7
|
+
return this._index;
|
|
8
|
+
}
|
|
9
|
+
set Index(index) {
|
|
10
|
+
this._index = index;
|
|
11
|
+
}
|
|
12
|
+
get Vehicle() {
|
|
13
|
+
return this._owner;
|
|
14
|
+
}
|
|
15
|
+
burst() {
|
|
16
|
+
SetVehicleTyreBurst(this._owner.Handle, this.Index, true, 1000);
|
|
17
|
+
}
|
|
18
|
+
fix() {
|
|
19
|
+
SetVehicleTyreFixed(this._owner.Handle, this.Index);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Vehicle } from './Vehicle';
|
|
2
|
+
import { VehicleWheel } from './VehicleWheel';
|
|
3
|
+
import { VehicleWheelIndex } from '../enums';
|
|
4
|
+
export declare class VehicleWheelCollection {
|
|
5
|
+
private _owner;
|
|
6
|
+
private readonly _vehicleWheels;
|
|
7
|
+
constructor(owner: Vehicle);
|
|
8
|
+
getWheel(index: VehicleWheelIndex): VehicleWheel | undefined;
|
|
9
|
+
getAllWheels(): (VehicleWheel | null | undefined)[];
|
|
10
|
+
burstAllWheels(): void;
|
|
11
|
+
fixAllWheels(): void;
|
|
12
|
+
hasWheel(wheel: VehicleWheelIndex): boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { VehicleWheel } from './VehicleWheel';
|
|
2
|
+
import { VehicleWheelIndex } from '../enums';
|
|
3
|
+
export class VehicleWheelCollection {
|
|
4
|
+
constructor(owner) {
|
|
5
|
+
this._vehicleWheels = new Map();
|
|
6
|
+
this._owner = owner;
|
|
7
|
+
}
|
|
8
|
+
getWheel(index) {
|
|
9
|
+
if (!this._vehicleWheels.has(index)) {
|
|
10
|
+
this._vehicleWheels.set(index, new VehicleWheel(this._owner, index));
|
|
11
|
+
}
|
|
12
|
+
return this._vehicleWheels.get(index);
|
|
13
|
+
}
|
|
14
|
+
getAllWheels() {
|
|
15
|
+
return Object.keys(VehicleWheelIndex)
|
|
16
|
+
.filter(key => !isNaN(Number(key)))
|
|
17
|
+
.map(key => {
|
|
18
|
+
const index = Number(key);
|
|
19
|
+
if (this.hasWheel(index)) {
|
|
20
|
+
return this.getWheel(index);
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
})
|
|
24
|
+
.filter(w => w);
|
|
25
|
+
}
|
|
26
|
+
burstAllWheels() {
|
|
27
|
+
this.getAllWheels().forEach(wheel => {
|
|
28
|
+
wheel?.burst();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
fixAllWheels() {
|
|
32
|
+
this.getAllWheels().forEach(wheel => {
|
|
33
|
+
wheel?.fix();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
hasWheel(wheel) {
|
|
37
|
+
if (this._owner.Bones === undefined)
|
|
38
|
+
return false;
|
|
39
|
+
switch (wheel) {
|
|
40
|
+
case VehicleWheelIndex.FrontLeftWheel:
|
|
41
|
+
return this._owner.Bones.hasBone('wheel_lf');
|
|
42
|
+
case VehicleWheelIndex.FrontRightWheel:
|
|
43
|
+
return this._owner.Bones.hasBone('wheel_rf');
|
|
44
|
+
case VehicleWheelIndex.MidLeftWheel:
|
|
45
|
+
return this._owner.Bones.hasBone('wheel_lm');
|
|
46
|
+
case VehicleWheelIndex.MidRightWheel:
|
|
47
|
+
return this._owner.Bones.hasBone('wheel_rm');
|
|
48
|
+
case VehicleWheelIndex.RearLeftWheel:
|
|
49
|
+
return this._owner.Bones.hasBone('wheel_lr');
|
|
50
|
+
case VehicleWheelIndex.RearRightWheel:
|
|
51
|
+
return this._owner.Bones.hasBone('wheel_rr');
|
|
52
|
+
default:
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Vehicle } from './Vehicle';
|
|
2
|
+
import { VehicleWindowIndex } from '../enums';
|
|
3
|
+
export declare class VehicleWindow {
|
|
4
|
+
private _owner;
|
|
5
|
+
private _index;
|
|
6
|
+
constructor(owner: Vehicle, index: VehicleWindowIndex);
|
|
7
|
+
get Index(): VehicleWindowIndex;
|
|
8
|
+
set Index(index: VehicleWindowIndex);
|
|
9
|
+
get IsIntact(): boolean;
|
|
10
|
+
get Vehicle(): Vehicle;
|
|
11
|
+
repair(): void;
|
|
12
|
+
smash(): void;
|
|
13
|
+
rollUp(): void;
|
|
14
|
+
rollDown(): void;
|
|
15
|
+
remove(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class VehicleWindow {
|
|
2
|
+
constructor(owner, index) {
|
|
3
|
+
this._owner = owner;
|
|
4
|
+
this._index = index;
|
|
5
|
+
}
|
|
6
|
+
get Index() {
|
|
7
|
+
return this._index;
|
|
8
|
+
}
|
|
9
|
+
set Index(index) {
|
|
10
|
+
this._index = index;
|
|
11
|
+
}
|
|
12
|
+
get IsIntact() {
|
|
13
|
+
return IsVehicleWindowIntact(this._owner.Handle, this.Index);
|
|
14
|
+
}
|
|
15
|
+
get Vehicle() {
|
|
16
|
+
return this._owner;
|
|
17
|
+
}
|
|
18
|
+
repair() {
|
|
19
|
+
FixVehicleWindow(this._owner.Handle, this.Index);
|
|
20
|
+
}
|
|
21
|
+
smash() {
|
|
22
|
+
SmashVehicleWindow(this._owner.Handle, this.Index);
|
|
23
|
+
}
|
|
24
|
+
rollUp() {
|
|
25
|
+
RollUpWindow(this._owner.Handle, this.Index);
|
|
26
|
+
}
|
|
27
|
+
rollDown() {
|
|
28
|
+
RollDownWindow(this._owner.Handle, this.Index);
|
|
29
|
+
}
|
|
30
|
+
remove() {
|
|
31
|
+
RemoveVehicleWindow(this._owner.Handle, this.Index);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Vehicle } from './Vehicle';
|
|
2
|
+
import { VehicleWindowIndex } from '../enums';
|
|
3
|
+
import { VehicleWindow } from './VehicleWindow';
|
|
4
|
+
export declare class VehicleWindowCollection {
|
|
5
|
+
private _owner;
|
|
6
|
+
private readonly _vehicleWindows;
|
|
7
|
+
constructor(owner: Vehicle);
|
|
8
|
+
getWindow(index: VehicleWindowIndex): VehicleWindow | undefined;
|
|
9
|
+
getAllWindows(): (VehicleWindow | null | undefined)[];
|
|
10
|
+
get AreAllWindowsIntact(): boolean;
|
|
11
|
+
rollDownAllWindows(): void;
|
|
12
|
+
rollUpAllWindows(): void;
|
|
13
|
+
hasWindow(window: VehicleWindowIndex): boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { VehicleWindowIndex } from '../enums';
|
|
2
|
+
import { VehicleWindow } from './VehicleWindow';
|
|
3
|
+
export class VehicleWindowCollection {
|
|
4
|
+
constructor(owner) {
|
|
5
|
+
this._vehicleWindows = new Map();
|
|
6
|
+
this._owner = owner;
|
|
7
|
+
}
|
|
8
|
+
getWindow(index) {
|
|
9
|
+
if (!this._vehicleWindows.has(index)) {
|
|
10
|
+
this._vehicleWindows.set(index, new VehicleWindow(this._owner, index));
|
|
11
|
+
}
|
|
12
|
+
return this._vehicleWindows.get(index);
|
|
13
|
+
}
|
|
14
|
+
getAllWindows() {
|
|
15
|
+
return Object.keys(VehicleWindowIndex)
|
|
16
|
+
.filter(key => !isNaN(Number(key)))
|
|
17
|
+
.map(key => {
|
|
18
|
+
const index = Number(key);
|
|
19
|
+
if (this.hasWindow(index)) {
|
|
20
|
+
return this.getWindow(index);
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
})
|
|
24
|
+
.filter(w => w);
|
|
25
|
+
}
|
|
26
|
+
get AreAllWindowsIntact() {
|
|
27
|
+
return AreAllVehicleWindowsIntact(this._owner.Handle);
|
|
28
|
+
}
|
|
29
|
+
rollDownAllWindows() {
|
|
30
|
+
this.getAllWindows().forEach(window => {
|
|
31
|
+
window?.rollDown();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
rollUpAllWindows() {
|
|
35
|
+
this.getAllWindows().forEach(window => {
|
|
36
|
+
window?.rollUp();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
hasWindow(window) {
|
|
40
|
+
if (this._owner.Bones === undefined)
|
|
41
|
+
return false;
|
|
42
|
+
switch (window) {
|
|
43
|
+
case VehicleWindowIndex.FrontLeftWindow:
|
|
44
|
+
return this._owner.Bones.hasBone('window_lf');
|
|
45
|
+
case VehicleWindowIndex.FrontRightWindow:
|
|
46
|
+
return this._owner.Bones.hasBone('window_rf');
|
|
47
|
+
case VehicleWindowIndex.BackLeftWindow:
|
|
48
|
+
return this._owner.Bones.hasBone('window_lr');
|
|
49
|
+
case VehicleWindowIndex.BackRightWindow:
|
|
50
|
+
return this._owner.Bones.hasBone('window_rr');
|
|
51
|
+
default:
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { Entity } from './Entity';
|
|
2
|
+
export { EntityBone } from './EntityBone';
|
|
3
|
+
export { EntityBoneCollection } from './EntityBoneCollection';
|
|
4
|
+
export { Ped } from './Ped';
|
|
5
|
+
export { PedBone } from './PedBone';
|
|
6
|
+
export { PedBoneCollection } from './PedBoneCollection';
|
|
7
|
+
export { Player } from './Player';
|
|
8
|
+
export { Prop } from './Prop';
|
|
9
|
+
export { Vehicle } from './Vehicle';
|
|
10
|
+
export { VehicleDoor } from './VehicleDoor';
|
|
11
|
+
export { VehicleDoorCollection } from './VehicleDoorCollection';
|
|
12
|
+
export { VehicleMod } from './VehicleMod';
|
|
13
|
+
export { VehicleToggleMod } from './VehicleToggleMod';
|
|
14
|
+
export { VehicleModCollection } from './VehicleModCollection';
|
|
15
|
+
export { VehicleWheel } from './VehicleWheel';
|
|
16
|
+
export { VehicleWheelCollection } from './VehicleWheelCollection';
|
|
17
|
+
export { VehicleWindow } from './VehicleWindow';
|
|
18
|
+
export { VehicleWindowCollection } from './VehicleWindowCollection';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { Entity } from './Entity';
|
|
2
|
+
export { EntityBone } from './EntityBone';
|
|
3
|
+
export { EntityBoneCollection } from './EntityBoneCollection';
|
|
4
|
+
export { Ped } from './Ped';
|
|
5
|
+
export { PedBone } from './PedBone';
|
|
6
|
+
export { PedBoneCollection } from './PedBoneCollection';
|
|
7
|
+
export { Player } from './Player';
|
|
8
|
+
export { Prop } from './Prop';
|
|
9
|
+
export { Vehicle } from './Vehicle';
|
|
10
|
+
export { VehicleDoor } from './VehicleDoor';
|
|
11
|
+
export { VehicleDoorCollection } from './VehicleDoorCollection';
|
|
12
|
+
export { VehicleMod } from './VehicleMod';
|
|
13
|
+
export { VehicleToggleMod } from './VehicleToggleMod';
|
|
14
|
+
export { VehicleModCollection } from './VehicleModCollection';
|
|
15
|
+
export { VehicleWheel } from './VehicleWheel';
|
|
16
|
+
export { VehicleWheelCollection } from './VehicleWheelCollection';
|
|
17
|
+
export { VehicleWindow } from './VehicleWindow';
|
|
18
|
+
export { VehicleWindowCollection } from './VehicleWindowCollection';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Color, Point, Size } from '../utils';
|
|
2
|
+
import { IDrawable } from './';
|
|
3
|
+
export declare class Container implements IDrawable {
|
|
4
|
+
pos: Point;
|
|
5
|
+
size: Size;
|
|
6
|
+
color: Color;
|
|
7
|
+
items: IDrawable[];
|
|
8
|
+
constructor(pos: Point, size: Size, color: Color);
|
|
9
|
+
addItem(items: IDrawable | IDrawable[]): void;
|
|
10
|
+
draw(offset?: Size, resolution?: Size): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Size } from '../utils';
|
|
2
|
+
import { Screen } from './';
|
|
3
|
+
export class Container {
|
|
4
|
+
constructor(pos, size, color) {
|
|
5
|
+
this.items = [];
|
|
6
|
+
this.pos = pos;
|
|
7
|
+
this.size = size;
|
|
8
|
+
this.color = color;
|
|
9
|
+
}
|
|
10
|
+
addItem(items) {
|
|
11
|
+
if (!Array.isArray(items)) {
|
|
12
|
+
items = [items];
|
|
13
|
+
}
|
|
14
|
+
this.items.push(...items);
|
|
15
|
+
}
|
|
16
|
+
draw(offset, resolution) {
|
|
17
|
+
resolution = resolution || new Size(Screen.ScaledWidth, Screen.Height);
|
|
18
|
+
offset = offset || new Size();
|
|
19
|
+
const w = this.size.width / resolution.width;
|
|
20
|
+
const h = this.size.height / resolution.height;
|
|
21
|
+
const x = (this.pos.X + offset.width) / resolution.width + w * 0.5;
|
|
22
|
+
const y = (this.pos.Y + offset.height) / resolution.height + h * 0.5;
|
|
23
|
+
DrawRect(x, y, w, h, this.color.r, this.color.g, this.color.b, this.color.a);
|
|
24
|
+
for (const item of this.items) {
|
|
25
|
+
item.draw(new Size(this.pos.X + offset.width, this.pos.Y + offset.height), resolution);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|