@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,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { AnticheatPtFxEvent } from "./type/Anticheat";
|
|
3
|
+
// import { Hash } from "./type/Hash";
|
|
4
|
+
// const handlers = [["ptFxEvent", (caller: number, data: AnticheatPtFxEvent) => {}]];
|
|
5
|
+
// export interface ParticleOptions {
|
|
6
|
+
// allowedCallsPerSecond: number;
|
|
7
|
+
// limitToEntities?: boolean;
|
|
8
|
+
// limitToEntity: number;
|
|
9
|
+
// }
|
|
10
|
+
//
|
|
11
|
+
// export class Anticheat {
|
|
12
|
+
// private allowedParticles: Map<number, ParticleOptions> = new Map();
|
|
13
|
+
//
|
|
14
|
+
// // constructor() {
|
|
15
|
+
// // for
|
|
16
|
+
// // }
|
|
17
|
+
//
|
|
18
|
+
// public allowParticleEffect(particleEffectHash: Hash, options: ParticleOptions) {
|
|
19
|
+
// this.allowedParticles.set(particleEffectHash, options);
|
|
20
|
+
// }
|
|
21
|
+
//
|
|
22
|
+
// public removeAllowedParticleEffect(particleEffectHash: Hash) {
|
|
23
|
+
// this.allowedParticles.delete(particleEffectHash);
|
|
24
|
+
// }
|
|
25
|
+
// }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Player } from './entities/Player';
|
|
2
|
+
/** @typedef {(player: Player, ...args: any[]) => void} NetEvent */
|
|
3
|
+
export type NetEvent = (player: Player, ...args: any[]) => void;
|
|
4
|
+
export declare class Events {
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
* @static
|
|
8
|
+
* @returns {void}
|
|
9
|
+
*/
|
|
10
|
+
static cancel(): void;
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
* @static
|
|
14
|
+
* @returns {boolean}
|
|
15
|
+
*/
|
|
16
|
+
static wasCanceled(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
* @static
|
|
20
|
+
*/
|
|
21
|
+
static get InvokingResource(): string;
|
|
22
|
+
/**
|
|
23
|
+
* An onNet wrapper that properly converts the type into the correct type
|
|
24
|
+
* @public
|
|
25
|
+
* @default (eventName: string, event: import("/home/skaggs/projects/fivem/server/src/Events").NetEvent) => void
|
|
26
|
+
*/
|
|
27
|
+
onNet: (eventName: string, event: NetEvent) => void;
|
|
28
|
+
/**
|
|
29
|
+
* An on wrapper that properly converts the classes
|
|
30
|
+
* @public
|
|
31
|
+
* @default (eventName: string, event: import("/home/skaggs/projects/fivem/server/src/Events").NetEvent) => void
|
|
32
|
+
*/
|
|
33
|
+
on: (eventName: string, event: NetEvent) => void;
|
|
34
|
+
}
|
|
35
|
+
/** @typedef {(player: Player, ...args: any[]) => void} NetEvent */
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { Ped, Prop, Vehicle, Entity } from './entities';
|
|
3
|
+
import { Player } from './entities/Player';
|
|
4
|
+
import { ClassTypes } from './enum/ClassTypes';
|
|
5
|
+
import { Vector2, Vector3, Vector4 } from './utils';
|
|
6
|
+
/**
|
|
7
|
+
* @param {...any} [args]
|
|
8
|
+
* @returns {any[]}
|
|
9
|
+
*/
|
|
10
|
+
const getClassFromArguments = (...args) => {
|
|
11
|
+
const newArgs = [];
|
|
12
|
+
for (const arg of args) {
|
|
13
|
+
switch (arg.type) {
|
|
14
|
+
case ClassTypes.Vector2: {
|
|
15
|
+
newArgs.push(Vector2.create(arg));
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
case ClassTypes.Vector3: {
|
|
19
|
+
newArgs.push(Vector3.create(arg));
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
case ClassTypes.Vector4: {
|
|
23
|
+
newArgs.push(Vector4.create(arg));
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
case ClassTypes.Ped: {
|
|
27
|
+
newArgs.push(Ped.fromNetworkId(arg.handle));
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
case ClassTypes.Player: {
|
|
31
|
+
newArgs.push(new Player(arg.source));
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
case ClassTypes.Prop: {
|
|
35
|
+
newArgs.push(Prop.fromNetworkId(arg.handle));
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
case ClassTypes.Vehicle: {
|
|
39
|
+
newArgs.push(Vehicle.fromNetworkId(arg.netId));
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
case ClassTypes.Entity: {
|
|
43
|
+
newArgs.push(Entity.fromNetworkId(arg.netId));
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
default: {
|
|
47
|
+
newArgs.push(arg);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return newArgs;
|
|
52
|
+
};
|
|
53
|
+
export class Events {
|
|
54
|
+
constructor() {
|
|
55
|
+
/**
|
|
56
|
+
* An onNet wrapper that properly converts the type into the correct type
|
|
57
|
+
* @public
|
|
58
|
+
* @default (eventName: string, event: import("/home/skaggs/projects/fivem/server/src/Events").NetEvent) => void
|
|
59
|
+
*/
|
|
60
|
+
this.onNet = (eventName, event) => {
|
|
61
|
+
onNet(eventName, (...args) => {
|
|
62
|
+
const ply = new Player(source);
|
|
63
|
+
event(ply, ...getClassFromArguments(...args));
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* An on wrapper that properly converts the classes
|
|
68
|
+
* @public
|
|
69
|
+
* @default (eventName: string, event: import("/home/skaggs/projects/fivem/server/src/Events").NetEvent) => void
|
|
70
|
+
*/
|
|
71
|
+
this.on = (eventName, event) => {
|
|
72
|
+
on(eventName, (...args) => {
|
|
73
|
+
const ply = new Player(source);
|
|
74
|
+
event(ply, ...getClassFromArguments(...args));
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @public
|
|
80
|
+
* @static
|
|
81
|
+
* @returns {void}
|
|
82
|
+
*/
|
|
83
|
+
static cancel() {
|
|
84
|
+
CancelEvent();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @public
|
|
88
|
+
* @static
|
|
89
|
+
* @returns {boolean}
|
|
90
|
+
*/
|
|
91
|
+
static wasCanceled() {
|
|
92
|
+
return WasEventCanceled();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @public
|
|
96
|
+
* @static
|
|
97
|
+
*/
|
|
98
|
+
static get InvokingResource() {
|
|
99
|
+
return GetInvokingResource();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** @typedef {(player: Player, ...args: any[]) => void} NetEvent */
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Player } from './entities/Player';
|
|
2
|
+
export declare abstract class Game {
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
* @static
|
|
6
|
+
* @default Map<any, any>
|
|
7
|
+
*/
|
|
8
|
+
static hashCache: Map<string, number>;
|
|
9
|
+
/**
|
|
10
|
+
* Calculate the Jenkins One At A Time (joaat) has from the given string.
|
|
11
|
+
* @public
|
|
12
|
+
* @static
|
|
13
|
+
* @param {string} input The input string to calculate the hash
|
|
14
|
+
* @returns {number}
|
|
15
|
+
*/
|
|
16
|
+
static generateHash(input: string): number;
|
|
17
|
+
/**
|
|
18
|
+
* Gets how many milliseconds the game has been open this session
|
|
19
|
+
* @public
|
|
20
|
+
* @static
|
|
21
|
+
*/
|
|
22
|
+
static get GameTime(): number;
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
* @static
|
|
26
|
+
*/
|
|
27
|
+
static get GameBuild(): number;
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
* @static
|
|
31
|
+
*/
|
|
32
|
+
static get GameName(): string;
|
|
33
|
+
/**
|
|
34
|
+
* @public
|
|
35
|
+
* @static
|
|
36
|
+
* @param {string} name
|
|
37
|
+
* @param {(player: Player, args: any[]) => void} handler
|
|
38
|
+
* @param {boolean} [restricted=false]
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
41
|
+
static registerCommand(name: string, handler: (player: Player, args: any[]) => void, restricted?: boolean): void;
|
|
42
|
+
/**
|
|
43
|
+
* @public
|
|
44
|
+
* @static
|
|
45
|
+
*/
|
|
46
|
+
static get RegisteredCommands(): [{
|
|
47
|
+
name: string;
|
|
48
|
+
}];
|
|
49
|
+
/**
|
|
50
|
+
* Get an iterable list of players currently on the server.
|
|
51
|
+
* @public
|
|
52
|
+
* @static
|
|
53
|
+
* @returns {IterableIterator<Player>} Iterable list of Player objects.
|
|
54
|
+
*/
|
|
55
|
+
static PlayerList(): IterableIterator<Player>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Player } from './entities/Player';
|
|
2
|
+
export class Game {
|
|
3
|
+
/**
|
|
4
|
+
* Calculate the Jenkins One At A Time (joaat) has from the given string.
|
|
5
|
+
* @public
|
|
6
|
+
* @static
|
|
7
|
+
* @param {string} input The input string to calculate the hash
|
|
8
|
+
* @returns {number}
|
|
9
|
+
*/
|
|
10
|
+
static generateHash(input) {
|
|
11
|
+
if (typeof input === 'undefined') {
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
const _hash = this.hashCache.get(input);
|
|
15
|
+
if (_hash)
|
|
16
|
+
return _hash;
|
|
17
|
+
const hash = GetHashKey(input);
|
|
18
|
+
this.hashCache.set(input, hash);
|
|
19
|
+
return hash;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets how many milliseconds the game has been open this session
|
|
23
|
+
* @public
|
|
24
|
+
* @static
|
|
25
|
+
*/
|
|
26
|
+
static get GameTime() {
|
|
27
|
+
return GetGameTimer();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
* @static
|
|
32
|
+
*/
|
|
33
|
+
static get GameBuild() {
|
|
34
|
+
return GetGameBuildNumber();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @public
|
|
38
|
+
* @static
|
|
39
|
+
*/
|
|
40
|
+
static get GameName() {
|
|
41
|
+
return GetGameName();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @public
|
|
45
|
+
* @static
|
|
46
|
+
* @param {string} name
|
|
47
|
+
* @param {(player: Player, args: any[]) => void} handler
|
|
48
|
+
* @param {boolean} [restricted=false]
|
|
49
|
+
* @returns {void}
|
|
50
|
+
*/
|
|
51
|
+
static registerCommand(name,
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
handler, restricted = false) {
|
|
54
|
+
RegisterCommand(name,
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
|
+
(source, args) => {
|
|
57
|
+
const player = new Player(parseInt(source));
|
|
58
|
+
handler(player, args);
|
|
59
|
+
}, restricted);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @public
|
|
63
|
+
* @static
|
|
64
|
+
*/
|
|
65
|
+
static get RegisteredCommands() {
|
|
66
|
+
return GetRegisteredCommands();
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get an iterable list of players currently on the server.
|
|
70
|
+
* @public
|
|
71
|
+
* @static
|
|
72
|
+
* @returns {IterableIterator<Player>} Iterable list of Player objects.
|
|
73
|
+
*/
|
|
74
|
+
static *PlayerList() {
|
|
75
|
+
for (const id of getPlayers()) {
|
|
76
|
+
yield new Player(id);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// A map containing generated hashes.
|
|
81
|
+
/**
|
|
82
|
+
* @public
|
|
83
|
+
* @static
|
|
84
|
+
* @default Map<any, any>
|
|
85
|
+
*/
|
|
86
|
+
Game.hashCache = new Map();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default { Entity, Player };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/// <reference types="@citizenfx/server" />
|
|
2
|
+
import { ClassTypes } from '../enum/ClassTypes';
|
|
3
|
+
import { eEntityType } from '../enum/eEntityType';
|
|
4
|
+
import { PopulationType } from '../enum/PopulationType';
|
|
5
|
+
import { Hash } from '../type/Hash';
|
|
6
|
+
import { Vector4 } from '../utils';
|
|
7
|
+
import { Vector3 } from '../utils';
|
|
8
|
+
export declare class BaseEntity {
|
|
9
|
+
protected handle: number;
|
|
10
|
+
/**
|
|
11
|
+
* @protected
|
|
12
|
+
* @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Entity
|
|
13
|
+
*/
|
|
14
|
+
protected type: ClassTypes;
|
|
15
|
+
constructor(handle: number);
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
get State(): StateBagInterface;
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
get Handle(): number;
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
get Owner(): number;
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
get FirstOwner(): number;
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
get Exists(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
get AttachedTo(): number;
|
|
40
|
+
/**
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
get Position(): Vector3;
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
get Heading(): number;
|
|
48
|
+
/**
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
get PositionAndHeading(): Vector4;
|
|
52
|
+
/**
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
get Health(): number;
|
|
56
|
+
/**
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
get MaxHealth(): number;
|
|
60
|
+
/**
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
get Model(): Hash;
|
|
64
|
+
/**
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
get PopulationType(): PopulationType;
|
|
68
|
+
/**
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
get Rotation(): Vector3;
|
|
72
|
+
/**
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
get RotationVelocity(): Vector3;
|
|
76
|
+
/**
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
get RoutingBucket(): number;
|
|
80
|
+
/**
|
|
81
|
+
* @returns The script that made the entity
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
get Script(): string;
|
|
85
|
+
/**
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
get Speed(): number;
|
|
89
|
+
/**
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
get Type(): eEntityType;
|
|
93
|
+
/**
|
|
94
|
+
* @returns the entitys velocity, if the entity is a ped it will return Vector3(0, 0, 0)
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
get Velocity(): Vector3;
|
|
98
|
+
/**
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
get IsVisible(): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
get NetworkId(): number;
|
|
106
|
+
/**
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
get IsNoLongerNeeded(): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* @public
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
114
|
+
delete(): void;
|
|
115
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import cfx from '../cfx';
|
|
2
|
+
import { ClassTypes } from '../enum/ClassTypes';
|
|
3
|
+
import { Vector4 } from '../utils';
|
|
4
|
+
import { Vector3 } from '../utils';
|
|
5
|
+
export class BaseEntity {
|
|
6
|
+
constructor(handle) {
|
|
7
|
+
this.handle = handle;
|
|
8
|
+
/**
|
|
9
|
+
* @protected
|
|
10
|
+
* @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Entity
|
|
11
|
+
*/
|
|
12
|
+
this.type = ClassTypes.Entity;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
get State() {
|
|
18
|
+
return cfx.Entity(this.handle).state;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
get Handle() {
|
|
24
|
+
return this.handle;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
get Owner() {
|
|
30
|
+
return NetworkGetEntityOwner(this.handle);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
get FirstOwner() {
|
|
36
|
+
return NetworkGetFirstEntityOwner(this.handle);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
get Exists() {
|
|
42
|
+
return this.handle !== 0 && DoesEntityExist(this.handle);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
get AttachedTo() {
|
|
48
|
+
return GetEntityAttachedTo(this.handle);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
get Position() {
|
|
54
|
+
return Vector3.fromArray(GetEntityCoords(this.handle));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
get Heading() {
|
|
60
|
+
return GetEntityHeading(this.handle);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
get PositionAndHeading() {
|
|
66
|
+
return Vector4.fromArray([...GetEntityCoords(this.handle), GetEntityHeading(this.handle)]);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
get Health() {
|
|
72
|
+
return GetEntityHealth(this.handle);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
get MaxHealth() {
|
|
78
|
+
return GetEntityMaxHealth(this.handle);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
get Model() {
|
|
84
|
+
return GetEntityModel(this.handle);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
get PopulationType() {
|
|
90
|
+
return GetEntityPopulationType(this.handle);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
get Rotation() {
|
|
96
|
+
return Vector3.fromArray(GetEntityRotation(this.handle));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
get RotationVelocity() {
|
|
102
|
+
return Vector3.fromArray(GetEntityRotationVelocity(this.handle));
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
107
|
+
get RoutingBucket() {
|
|
108
|
+
return GetEntityRoutingBucket(this.handle);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @returns The script that made the entity
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
get Script() {
|
|
115
|
+
return GetEntityScript(this.handle);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
get Speed() {
|
|
121
|
+
return GetEntitySpeed(this.handle);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
get Type() {
|
|
127
|
+
return GetEntityType(this.handle);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @returns the entitys velocity, if the entity is a ped it will return Vector3(0, 0, 0)
|
|
131
|
+
* @public
|
|
132
|
+
*/
|
|
133
|
+
get Velocity() {
|
|
134
|
+
return Vector3.fromArray(GetEntityVelocity(this.handle));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
get IsVisible() {
|
|
140
|
+
return IsEntityVisible(this.handle);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
get NetworkId() {
|
|
146
|
+
return NetworkGetNetworkIdFromEntity(this.handle);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
get IsNoLongerNeeded() {
|
|
152
|
+
return HasEntityBeenMarkedAsNoLongerNeeded(this.handle);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @public
|
|
156
|
+
* @returns {void}
|
|
157
|
+
*/
|
|
158
|
+
delete() {
|
|
159
|
+
DeleteEntity(this.handle);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseEntity } from './BaseEntity';
|
|
2
|
+
/** @extends BaseEntity */
|
|
3
|
+
export declare class Entity extends BaseEntity {
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
* @static
|
|
7
|
+
* @param {number} netId
|
|
8
|
+
* @returns {Entity}
|
|
9
|
+
*/
|
|
10
|
+
static fromNetworkId(netId: number): Entity;
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
* @static
|
|
14
|
+
* @param {number} handle
|
|
15
|
+
* @returns {Entity}
|
|
16
|
+
*/
|
|
17
|
+
static fromHandle(handle: number): Entity;
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseEntity } from './BaseEntity';
|
|
2
|
+
/** @extends BaseEntity */
|
|
3
|
+
export class Entity extends BaseEntity {
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
* @static
|
|
7
|
+
* @param {number} netId
|
|
8
|
+
* @returns {Entity}
|
|
9
|
+
*/
|
|
10
|
+
static fromNetworkId(netId) {
|
|
11
|
+
return new Entity(NetworkGetEntityFromNetworkId(netId));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
* @static
|
|
16
|
+
* @param {number} handle
|
|
17
|
+
* @returns {Entity}
|
|
18
|
+
*/
|
|
19
|
+
static fromHandle(handle) {
|
|
20
|
+
return new Entity(handle);
|
|
21
|
+
}
|
|
22
|
+
}
|