@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,134 @@
|
|
|
1
|
+
import { Dimensions } from './interfaces/Dimensions';
|
|
2
|
+
/**
|
|
3
|
+
* Class to create and manage entity models.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Model {
|
|
6
|
+
/**
|
|
7
|
+
* Hash of this model.
|
|
8
|
+
*/
|
|
9
|
+
private hash;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a model object based on the hash key or model string.
|
|
12
|
+
*
|
|
13
|
+
* @param hash A number or string of the model's hash. Example: "mp_m_freemode_01"
|
|
14
|
+
*/
|
|
15
|
+
constructor(hash: number | string);
|
|
16
|
+
/**
|
|
17
|
+
* Gets the hash of the model.
|
|
18
|
+
*
|
|
19
|
+
* @returns The hash key.
|
|
20
|
+
*/
|
|
21
|
+
get Hash(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Gets if the model is valid or not.
|
|
24
|
+
*
|
|
25
|
+
* @returns Whether this model is valid.
|
|
26
|
+
*/
|
|
27
|
+
get IsValid(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Gets if the model is in cd image or not.
|
|
30
|
+
*
|
|
31
|
+
* @returns Whether this model is in cd image.
|
|
32
|
+
*/
|
|
33
|
+
get IsInCdImage(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Gets if the model is loaded or not.
|
|
36
|
+
*
|
|
37
|
+
* @returns Whether this model is loaded.
|
|
38
|
+
*/
|
|
39
|
+
get IsLoaded(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Gets if the model collision is loaded or not.
|
|
42
|
+
*
|
|
43
|
+
* @returns Whether this model collision is loaded.
|
|
44
|
+
*/
|
|
45
|
+
get IsCollisionLoaded(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Gets if the model is a bicycle or not.
|
|
48
|
+
*
|
|
49
|
+
* @returns Whether this model is a bicycle.
|
|
50
|
+
*/
|
|
51
|
+
get IsBicycle(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Gets if the model is a motorbike or not.
|
|
54
|
+
*
|
|
55
|
+
* @returns Whether this model is a motorbike.
|
|
56
|
+
*/
|
|
57
|
+
get IsBike(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Gets if the model is a boat or not.
|
|
60
|
+
*
|
|
61
|
+
* @returns Whether this model is a boat.
|
|
62
|
+
*/
|
|
63
|
+
get IsBoat(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Gets if the model is a car or not.
|
|
66
|
+
*
|
|
67
|
+
* @returns Whether this model is a car.
|
|
68
|
+
*/
|
|
69
|
+
get IsCar(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Gets if the model is a cargobob or not.
|
|
72
|
+
*
|
|
73
|
+
* @returns Whether this model is a cargobob.
|
|
74
|
+
*/
|
|
75
|
+
get IsCargobob(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Gets if the model is a helicopter or not.
|
|
78
|
+
*
|
|
79
|
+
* @returns Whether this model is a helicopter.
|
|
80
|
+
*/
|
|
81
|
+
get IsHelicopter(): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Gets if the model is a Ped or not.
|
|
84
|
+
*
|
|
85
|
+
* @returns Whether this model is a Ped.
|
|
86
|
+
*/
|
|
87
|
+
get IsPed(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Gets if the model is a plane or not.
|
|
90
|
+
*
|
|
91
|
+
* @returns Whether this model is a plane.
|
|
92
|
+
*/
|
|
93
|
+
get IsPlane(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Gets if the model is a prop or not.
|
|
96
|
+
*
|
|
97
|
+
* @returns Whether this model is a prop.
|
|
98
|
+
*/
|
|
99
|
+
get IsProp(): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Gets if the model is a quadbike or not.
|
|
102
|
+
*
|
|
103
|
+
* @returns Whether this model is a quadbike.
|
|
104
|
+
*/
|
|
105
|
+
get IsQuadbike(): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Gets if the model is a train or not.
|
|
108
|
+
*
|
|
109
|
+
* @returns Whether this model is a train.
|
|
110
|
+
*/
|
|
111
|
+
get IsTrain(): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Gets if the model is a Vehicle or not.
|
|
114
|
+
*
|
|
115
|
+
* @returns Whether this model is a Vehicle.
|
|
116
|
+
*/
|
|
117
|
+
get IsVehicle(): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Gets the model dimensions.
|
|
120
|
+
*
|
|
121
|
+
* @returns This model min & max dimensions.
|
|
122
|
+
*/
|
|
123
|
+
get Dimensions(): Dimensions;
|
|
124
|
+
/**
|
|
125
|
+
* Request and load the model with a specified timeout. Default timeout is 1000 (recommended).
|
|
126
|
+
*
|
|
127
|
+
* @param timeout Maximum allowed time for model to load.
|
|
128
|
+
*/
|
|
129
|
+
request(timeout?: number): Promise<boolean>;
|
|
130
|
+
/**
|
|
131
|
+
* Sets the model as no longer needed allowing the game engine to free memory.
|
|
132
|
+
*/
|
|
133
|
+
markAsNoLongerNeeded(): void;
|
|
134
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { Game } from './Game';
|
|
2
|
+
import { VehicleHash } from './hashes';
|
|
3
|
+
import { Vector3 } from './utils';
|
|
4
|
+
/**
|
|
5
|
+
* Class to create and manage entity models.
|
|
6
|
+
*/
|
|
7
|
+
export class Model {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a model object based on the hash key or model string.
|
|
10
|
+
*
|
|
11
|
+
* @param hash A number or string of the model's hash. Example: "mp_m_freemode_01"
|
|
12
|
+
*/
|
|
13
|
+
constructor(hash) {
|
|
14
|
+
if (typeof hash === 'string') {
|
|
15
|
+
this.hash = Game.generateHash(hash);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.hash = hash;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets the hash of the model.
|
|
23
|
+
*
|
|
24
|
+
* @returns The hash key.
|
|
25
|
+
*/
|
|
26
|
+
get Hash() {
|
|
27
|
+
return this.hash;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets if the model is valid or not.
|
|
31
|
+
*
|
|
32
|
+
* @returns Whether this model is valid.
|
|
33
|
+
*/
|
|
34
|
+
get IsValid() {
|
|
35
|
+
return IsModelValid(this.hash);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gets if the model is in cd image or not.
|
|
39
|
+
*
|
|
40
|
+
* @returns Whether this model is in cd image.
|
|
41
|
+
*/
|
|
42
|
+
get IsInCdImage() {
|
|
43
|
+
return IsModelInCdimage(this.hash);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Gets if the model is loaded or not.
|
|
47
|
+
*
|
|
48
|
+
* @returns Whether this model is loaded.
|
|
49
|
+
*/
|
|
50
|
+
get IsLoaded() {
|
|
51
|
+
return HasModelLoaded(this.hash);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Gets if the model collision is loaded or not.
|
|
55
|
+
*
|
|
56
|
+
* @returns Whether this model collision is loaded.
|
|
57
|
+
*/
|
|
58
|
+
get IsCollisionLoaded() {
|
|
59
|
+
return HasCollisionForModelLoaded(this.hash);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Gets if the model is a bicycle or not.
|
|
63
|
+
*
|
|
64
|
+
* @returns Whether this model is a bicycle.
|
|
65
|
+
*/
|
|
66
|
+
get IsBicycle() {
|
|
67
|
+
return IsThisModelABicycle(this.hash);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Gets if the model is a motorbike or not.
|
|
71
|
+
*
|
|
72
|
+
* @returns Whether this model is a motorbike.
|
|
73
|
+
*/
|
|
74
|
+
get IsBike() {
|
|
75
|
+
return IsThisModelABike(this.hash);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Gets if the model is a boat or not.
|
|
79
|
+
*
|
|
80
|
+
* @returns Whether this model is a boat.
|
|
81
|
+
*/
|
|
82
|
+
get IsBoat() {
|
|
83
|
+
return IsThisModelABoat(this.hash);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Gets if the model is a car or not.
|
|
87
|
+
*
|
|
88
|
+
* @returns Whether this model is a car.
|
|
89
|
+
*/
|
|
90
|
+
get IsCar() {
|
|
91
|
+
return IsThisModelACar(this.hash);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Gets if the model is a cargobob or not.
|
|
95
|
+
*
|
|
96
|
+
* @returns Whether this model is a cargobob.
|
|
97
|
+
*/
|
|
98
|
+
get IsCargobob() {
|
|
99
|
+
return (this.hash === VehicleHash.Cargobob ||
|
|
100
|
+
this.hash === VehicleHash.Cargobob2 ||
|
|
101
|
+
this.hash === VehicleHash.Cargobob3 ||
|
|
102
|
+
this.hash === VehicleHash.Cargobob4);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Gets if the model is a helicopter or not.
|
|
106
|
+
*
|
|
107
|
+
* @returns Whether this model is a helicopter.
|
|
108
|
+
*/
|
|
109
|
+
get IsHelicopter() {
|
|
110
|
+
return IsThisModelAHeli(this.hash);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Gets if the model is a Ped or not.
|
|
114
|
+
*
|
|
115
|
+
* @returns Whether this model is a Ped.
|
|
116
|
+
*/
|
|
117
|
+
get IsPed() {
|
|
118
|
+
return IsModelAPed(this.hash);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Gets if the model is a plane or not.
|
|
122
|
+
*
|
|
123
|
+
* @returns Whether this model is a plane.
|
|
124
|
+
*/
|
|
125
|
+
get IsPlane() {
|
|
126
|
+
return IsThisModelAPlane(this.hash);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Gets if the model is a prop or not.
|
|
130
|
+
*
|
|
131
|
+
* @returns Whether this model is a prop.
|
|
132
|
+
*/
|
|
133
|
+
get IsProp() {
|
|
134
|
+
return this.IsValid && !this.IsPed && !this.IsVehicle && !IsWeaponValid(this.hash);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Gets if the model is a quadbike or not.
|
|
138
|
+
*
|
|
139
|
+
* @returns Whether this model is a quadbike.
|
|
140
|
+
*/
|
|
141
|
+
get IsQuadbike() {
|
|
142
|
+
return IsThisModelAQuadbike(this.hash);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Gets if the model is a train or not.
|
|
146
|
+
*
|
|
147
|
+
* @returns Whether this model is a train.
|
|
148
|
+
*/
|
|
149
|
+
get IsTrain() {
|
|
150
|
+
return IsThisModelATrain(this.hash);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Gets if the model is a Vehicle or not.
|
|
154
|
+
*
|
|
155
|
+
* @returns Whether this model is a Vehicle.
|
|
156
|
+
*/
|
|
157
|
+
get IsVehicle() {
|
|
158
|
+
return IsModelAVehicle(this.hash);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Gets the model dimensions.
|
|
162
|
+
*
|
|
163
|
+
* @returns This model min & max dimensions.
|
|
164
|
+
*/
|
|
165
|
+
get Dimensions() {
|
|
166
|
+
const [minArray, maxArray] = GetModelDimensions(this.hash);
|
|
167
|
+
const min = Vector3.fromArray(minArray);
|
|
168
|
+
const max = Vector3.fromArray(maxArray);
|
|
169
|
+
return { min, max };
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Request and load the model with a specified timeout. Default timeout is 1000 (recommended).
|
|
173
|
+
*
|
|
174
|
+
* @param timeout Maximum allowed time for model to load.
|
|
175
|
+
*/
|
|
176
|
+
request(timeout = 1000) {
|
|
177
|
+
return new Promise(resolve => {
|
|
178
|
+
if (!this.IsInCdImage && !this.IsValid && !IsWeaponValid(this.hash)) {
|
|
179
|
+
resolve(false);
|
|
180
|
+
}
|
|
181
|
+
RequestModel(this.hash);
|
|
182
|
+
const start = GetGameTimer();
|
|
183
|
+
const interval = setInterval(() => {
|
|
184
|
+
if (this.IsLoaded || GetGameTimer() - start >= timeout) {
|
|
185
|
+
clearInterval(interval);
|
|
186
|
+
this.markAsNoLongerNeeded();
|
|
187
|
+
resolve(this.IsLoaded);
|
|
188
|
+
}
|
|
189
|
+
}, 0);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Sets the model as no longer needed allowing the game engine to free memory.
|
|
194
|
+
*/
|
|
195
|
+
markAsNoLongerNeeded() {
|
|
196
|
+
SetModelAsNoLongerNeeded(this.hash);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Ped, Vector3 } from '.';
|
|
2
|
+
import type { BaseEntity } from './models/BaseEntity';
|
|
3
|
+
export declare class NetworkedScene {
|
|
4
|
+
private scene;
|
|
5
|
+
constructor(pos: Vector3, rot: Vector3, rotationOrder: number, holdLastFrame: boolean, looped: boolean, sceneHash: number, animTime: number, animSpeed: number);
|
|
6
|
+
addPed(ped: Ped, animDict: string, animName: string, blendInSpeed: number, blendOutSpeed: number, duration: number, flag: number, playbackRate: number, p9: number): void;
|
|
7
|
+
addEntity(entity: BaseEntity, animDict: string, animName: string, speed: number, speedMultiplier: number, flag: number): void;
|
|
8
|
+
start(): void;
|
|
9
|
+
stop(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class NetworkedScene {
|
|
2
|
+
constructor(pos, rot, rotationOrder, holdLastFrame, looped, sceneHash, animTime, animSpeed) {
|
|
3
|
+
this.scene = NetworkCreateSynchronisedScene(pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, rotationOrder, holdLastFrame, looped, sceneHash, animTime + 0.0, animSpeed + 0.0);
|
|
4
|
+
}
|
|
5
|
+
addPed(ped, animDict, animName, blendInSpeed, blendOutSpeed, duration, flag, playbackRate, p9) {
|
|
6
|
+
NetworkAddPedToSynchronisedScene(ped.Handle, this.scene, animDict, animName, blendInSpeed, blendOutSpeed, duration, flag, playbackRate, p9);
|
|
7
|
+
}
|
|
8
|
+
addEntity(entity, animDict, animName, speed, speedMultiplier, flag) {
|
|
9
|
+
NetworkAddEntityToSynchronisedScene(entity.Handle, this.scene, animDict, animName, speed, speedMultiplier, flag);
|
|
10
|
+
}
|
|
11
|
+
start() {
|
|
12
|
+
NetworkStartSynchronisedScene(this.scene);
|
|
13
|
+
}
|
|
14
|
+
stop() {
|
|
15
|
+
NetworkStopSynchronisedScene(this.scene);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ParticleEffectAsset } from './';
|
|
2
|
+
import { InvertAxis } from './enums';
|
|
3
|
+
import { Color, Vector3 } from './utils';
|
|
4
|
+
/**
|
|
5
|
+
* UNFINISHED! Class to manage particle effects.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class ParticleEffect {
|
|
8
|
+
protected readonly asset: ParticleEffectAsset;
|
|
9
|
+
protected readonly effectName: string;
|
|
10
|
+
protected offset: Vector3;
|
|
11
|
+
protected rotation: Vector3;
|
|
12
|
+
protected color: Color;
|
|
13
|
+
protected scale: number;
|
|
14
|
+
protected range: number;
|
|
15
|
+
protected invertAxis: InvertAxis;
|
|
16
|
+
private handle;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a particle effect.
|
|
19
|
+
*
|
|
20
|
+
* @param asset Particle effect asset.
|
|
21
|
+
* @param effectName Name of effect.
|
|
22
|
+
*/
|
|
23
|
+
constructor(asset: ParticleEffectAsset, effectName: string);
|
|
24
|
+
/**
|
|
25
|
+
* Get the particle effect handle.
|
|
26
|
+
*/
|
|
27
|
+
get Handle(): number;
|
|
28
|
+
/**
|
|
29
|
+
* Get whether particle effect is currently active.
|
|
30
|
+
*/
|
|
31
|
+
get IsActive(): boolean;
|
|
32
|
+
abstract start(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Stop a particle effect.
|
|
35
|
+
*/
|
|
36
|
+
stop(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Get the rotation of the particle effect.
|
|
39
|
+
*/
|
|
40
|
+
get Rotation(): Vector3;
|
|
41
|
+
/**
|
|
42
|
+
* Set the rotation of the particle effect.
|
|
43
|
+
*/
|
|
44
|
+
set Rotation(rotation: Vector3);
|
|
45
|
+
/**
|
|
46
|
+
* Get the range of the particle effect.
|
|
47
|
+
*/
|
|
48
|
+
get Range(): number;
|
|
49
|
+
/**
|
|
50
|
+
* Set the range of the particle effect.
|
|
51
|
+
*/
|
|
52
|
+
set Range(range: number);
|
|
53
|
+
/**
|
|
54
|
+
* Get the invert axis flag of the particle effect.
|
|
55
|
+
*/
|
|
56
|
+
get InvertAxis(): InvertAxis;
|
|
57
|
+
/**
|
|
58
|
+
* Set the inverted axis of the particle effect.
|
|
59
|
+
*/
|
|
60
|
+
set InvertAxis(invertAxis: InvertAxis);
|
|
61
|
+
/**
|
|
62
|
+
* Set a paramaeter of a particle effect.
|
|
63
|
+
*
|
|
64
|
+
* @param parameterName Name of parameter.
|
|
65
|
+
* @param value Value of parameter.
|
|
66
|
+
*/
|
|
67
|
+
setParameter(parameterName: string, value: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get the name of the particle effect asset. Same as ParticleEffect.AssetName.
|
|
70
|
+
*/
|
|
71
|
+
get AssetName(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Get the name of the particle effect.
|
|
74
|
+
*/
|
|
75
|
+
get EffectName(): string;
|
|
76
|
+
/**
|
|
77
|
+
* Return the particle effect as string. `AssetName`\\`EffectName`.
|
|
78
|
+
*/
|
|
79
|
+
toString(): string;
|
|
80
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { InvertAxisFlags } from './enums';
|
|
2
|
+
import { Color, Vector3 } from './utils';
|
|
3
|
+
// TODO: Lots of Matrix stuff through memory access
|
|
4
|
+
/**
|
|
5
|
+
* UNFINISHED! Class to manage particle effects.
|
|
6
|
+
*/
|
|
7
|
+
export class ParticleEffect {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a particle effect.
|
|
10
|
+
*
|
|
11
|
+
* @param asset Particle effect asset.
|
|
12
|
+
* @param effectName Name of effect.
|
|
13
|
+
*/
|
|
14
|
+
constructor(asset, effectName) {
|
|
15
|
+
this.offset = new Vector3(0, 0, 0);
|
|
16
|
+
this.rotation = new Vector3(0, 0, 0);
|
|
17
|
+
this.color = Color.empty;
|
|
18
|
+
this.scale = 1.0;
|
|
19
|
+
this.range = 1.0;
|
|
20
|
+
this.invertAxis = { flags: InvertAxisFlags.None };
|
|
21
|
+
this.handle = -1;
|
|
22
|
+
this.asset = asset;
|
|
23
|
+
this.effectName = effectName;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the particle effect handle.
|
|
27
|
+
*/
|
|
28
|
+
get Handle() {
|
|
29
|
+
return this.handle;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get whether particle effect is currently active.
|
|
33
|
+
*/
|
|
34
|
+
get IsActive() {
|
|
35
|
+
return this.Handle !== -1 && DoesParticleFxLoopedExist(this.Handle);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Stop a particle effect.
|
|
39
|
+
*/
|
|
40
|
+
stop() {
|
|
41
|
+
if (this.IsActive) {
|
|
42
|
+
RemoveParticleFx(this.Handle, false);
|
|
43
|
+
}
|
|
44
|
+
this.handle = -1;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get the rotation of the particle effect.
|
|
48
|
+
*/
|
|
49
|
+
get Rotation() {
|
|
50
|
+
return this.rotation;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Set the rotation of the particle effect.
|
|
54
|
+
*/
|
|
55
|
+
set Rotation(rotation) {
|
|
56
|
+
this.rotation = rotation;
|
|
57
|
+
if (this.IsActive) {
|
|
58
|
+
const off = this.offset; // TODO Matrix stuff to access from memory
|
|
59
|
+
SetParticleFxLoopedOffsets(this.Handle, off.x, off.y, off.z, rotation.x, rotation.y, rotation.z);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get the range of the particle effect.
|
|
64
|
+
*/
|
|
65
|
+
get Range() {
|
|
66
|
+
return this.range;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Set the range of the particle effect.
|
|
70
|
+
*/
|
|
71
|
+
set Range(range) {
|
|
72
|
+
this.range = range;
|
|
73
|
+
SetParticleFxLoopedRange(this.Handle, range);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get the invert axis flag of the particle effect.
|
|
77
|
+
*/
|
|
78
|
+
get InvertAxis() {
|
|
79
|
+
return this.invertAxis;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Set the inverted axis of the particle effect.
|
|
83
|
+
*/
|
|
84
|
+
set InvertAxis(invertAxis) {
|
|
85
|
+
this.invertAxis = invertAxis;
|
|
86
|
+
if (this.IsActive) {
|
|
87
|
+
this.stop();
|
|
88
|
+
this.start();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Set a paramaeter of a particle effect.
|
|
93
|
+
*
|
|
94
|
+
* @param parameterName Name of parameter.
|
|
95
|
+
* @param value Value of parameter.
|
|
96
|
+
*/
|
|
97
|
+
setParameter(parameterName, value) {
|
|
98
|
+
if (this.IsActive) {
|
|
99
|
+
SetParticleFxLoopedEvolution(this.Handle, parameterName, value, false);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get the name of the particle effect asset. Same as ParticleEffect.AssetName.
|
|
104
|
+
*/
|
|
105
|
+
get AssetName() {
|
|
106
|
+
return this.asset.AssetName;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get the name of the particle effect.
|
|
110
|
+
*/
|
|
111
|
+
get EffectName() {
|
|
112
|
+
return this.effectName;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Return the particle effect as string. `AssetName`\\`EffectName`.
|
|
116
|
+
*/
|
|
117
|
+
toString() {
|
|
118
|
+
return `${this.AssetName}\\${this.EffectName}`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { InvertAxis } from './enums';
|
|
2
|
+
import type { BaseEntity } from './models/BaseEntity';
|
|
3
|
+
import { Vector3 } from './utils';
|
|
4
|
+
/**
|
|
5
|
+
* UNFINISHED! Class that represents a particle effect asset.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ParticleEffectAsset {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the name of the asset. Same as AssetName.
|
|
10
|
+
*/
|
|
11
|
+
get Asset(): string;
|
|
12
|
+
private readonly assetName;
|
|
13
|
+
constructor(assetName: string);
|
|
14
|
+
/**
|
|
15
|
+
* Get the name of the particle effect.
|
|
16
|
+
*/
|
|
17
|
+
get AssetName(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Get whether the particle effect has loaded into game memory.
|
|
20
|
+
*/
|
|
21
|
+
get IsLoaded(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Start a particle effect at a world position.
|
|
24
|
+
*
|
|
25
|
+
* @param effectName Name of effect.
|
|
26
|
+
* @param rot Rotation from entity position.
|
|
27
|
+
* @param scale Size of the effect.
|
|
28
|
+
* @param invertAxis Which axis to invert (default none).
|
|
29
|
+
*/
|
|
30
|
+
startNonLoopedAtCoord(effectName: string, pos: Vector3, rot?: Vector3, scale?: number, invertAxis?: InvertAxis): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Start a particle effect on an entity
|
|
33
|
+
*
|
|
34
|
+
* @param effectName Name of effect.
|
|
35
|
+
* @param entity Entity to use effect on.
|
|
36
|
+
* @param off Offset from entity position.
|
|
37
|
+
* @param rot Rotation from entity position.
|
|
38
|
+
* @param scale Size of the effect.
|
|
39
|
+
* @param invertAxis Which axis to invert (default none).
|
|
40
|
+
*/
|
|
41
|
+
startNonLoopedOnEntity(effectName: string, entity: BaseEntity, off?: Vector3, rot?: Vector3, scale?: number, invertAxis?: InvertAxis): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Load a particle effect into the game memory.
|
|
44
|
+
*
|
|
45
|
+
* @param timeout Max time to load Particle Effect
|
|
46
|
+
*/
|
|
47
|
+
request(timeout: number): Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Allow game engine to safely unload particle effect model from memory.
|
|
50
|
+
*/
|
|
51
|
+
markAsNoLongerNeeded(): void;
|
|
52
|
+
toString(): string;
|
|
53
|
+
private setNextCall;
|
|
54
|
+
}
|