@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.
Files changed (421) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/lib/client/Audio.d.ts +17 -0
  4. package/lib/client/Audio.js +92 -0
  5. package/lib/client/Blip.d.ts +39 -0
  6. package/lib/client/Blip.js +104 -0
  7. package/lib/client/Camera.d.ts +46 -0
  8. package/lib/client/Camera.js +161 -0
  9. package/lib/client/Checkpoint.d.ts +18 -0
  10. package/lib/client/Checkpoint.js +42 -0
  11. package/lib/client/Events.d.ts +11 -0
  12. package/lib/client/Events.js +73 -0
  13. package/lib/client/Game.d.ts +283 -0
  14. package/lib/client/Game.js +451 -0
  15. package/lib/client/GameplayCamera.d.ts +102 -0
  16. package/lib/client/GameplayCamera.js +141 -0
  17. package/lib/client/Model.d.ts +134 -0
  18. package/lib/client/Model.js +198 -0
  19. package/lib/client/NetworkedScene.d.ts +10 -0
  20. package/lib/client/NetworkedScene.js +17 -0
  21. package/lib/client/ParticleEffect.d.ts +80 -0
  22. package/lib/client/ParticleEffect.js +120 -0
  23. package/lib/client/ParticleEffectAsset.d.ts +54 -0
  24. package/lib/client/ParticleEffectAsset.js +104 -0
  25. package/lib/client/Pickup.d.ts +9 -0
  26. package/lib/client/Pickup.js +18 -0
  27. package/lib/client/Raycast.d.ts +49 -0
  28. package/lib/client/Raycast.js +70 -0
  29. package/lib/client/RelationshipGroup.d.ts +49 -0
  30. package/lib/client/RelationshipGroup.js +63 -0
  31. package/lib/client/Rope.d.ts +99 -0
  32. package/lib/client/Rope.js +125 -0
  33. package/lib/client/TaskSequence.d.ts +15 -0
  34. package/lib/client/TaskSequence.js +43 -0
  35. package/lib/client/Tasks.d.ts +66 -0
  36. package/lib/client/Tasks.js +236 -0
  37. package/lib/client/World.d.ts +402 -0
  38. package/lib/client/World.js +726 -0
  39. package/lib/client/cfx/StateBagChangeHandler.d.ts +3 -0
  40. package/lib/client/cfx/StateBagChangeHandler.js +1 -0
  41. package/lib/client/cfx/index.d.ts +7 -0
  42. package/lib/client/cfx/index.js +1 -0
  43. package/lib/client/enums/Alignment.d.ts +5 -0
  44. package/lib/client/enums/Alignment.js +6 -0
  45. package/lib/client/enums/AnimationFlags.d.ts +9 -0
  46. package/lib/client/enums/AnimationFlags.js +10 -0
  47. package/lib/client/enums/AudioFlag.d.ts +37 -0
  48. package/lib/client/enums/AudioFlag.js +38 -0
  49. package/lib/client/enums/BadgeStyle.d.ts +182 -0
  50. package/lib/client/enums/BadgeStyle.js +183 -0
  51. package/lib/client/enums/Blip.d.ts +223 -0
  52. package/lib/client/enums/Blip.js +225 -0
  53. package/lib/client/enums/Bone.d.ts +101 -0
  54. package/lib/client/enums/Bone.js +103 -0
  55. package/lib/client/enums/CameraShake.d.ts +13 -0
  56. package/lib/client/enums/CameraShake.js +14 -0
  57. package/lib/client/enums/CameraTypes.d.ts +7 -0
  58. package/lib/client/enums/CameraTypes.js +8 -0
  59. package/lib/client/enums/CheckboxStyle.d.ts +4 -0
  60. package/lib/client/enums/CheckboxStyle.js +5 -0
  61. package/lib/client/enums/Checkpoint.d.ts +62 -0
  62. package/lib/client/enums/Checkpoint.js +67 -0
  63. package/lib/client/enums/ClassTypes.d.ts +11 -0
  64. package/lib/client/enums/ClassTypes.js +12 -0
  65. package/lib/client/enums/CloudHat.d.ts +26 -0
  66. package/lib/client/enums/CloudHat.js +27 -0
  67. package/lib/client/enums/Control.d.ts +360 -0
  68. package/lib/client/enums/Control.js +361 -0
  69. package/lib/client/enums/CursorSprite.d.ts +14 -0
  70. package/lib/client/enums/CursorSprite.js +15 -0
  71. package/lib/client/enums/Driving.d.ts +32 -0
  72. package/lib/client/enums/Driving.js +34 -0
  73. package/lib/client/enums/ExplosionType.d.ts +44 -0
  74. package/lib/client/enums/ExplosionType.js +45 -0
  75. package/lib/client/enums/FiringPattern.d.ts +19 -0
  76. package/lib/client/enums/FiringPattern.js +20 -0
  77. package/lib/client/enums/Font.d.ts +7 -0
  78. package/lib/client/enums/Font.js +8 -0
  79. package/lib/client/enums/ForceType.d.ts +8 -0
  80. package/lib/client/enums/ForceType.js +9 -0
  81. package/lib/client/enums/Gender.d.ts +4 -0
  82. package/lib/client/enums/Gender.js +5 -0
  83. package/lib/client/enums/HelmetType.d.ts +5 -0
  84. package/lib/client/enums/HelmetType.js +6 -0
  85. package/lib/client/enums/HudColor.d.ts +183 -0
  86. package/lib/client/enums/HudColor.js +184 -0
  87. package/lib/client/enums/HudComponent.d.ts +53 -0
  88. package/lib/client/enums/HudComponent.js +54 -0
  89. package/lib/client/enums/InputMode.d.ts +4 -0
  90. package/lib/client/enums/InputMode.js +5 -0
  91. package/lib/client/enums/IntersectOptions.d.ts +15 -0
  92. package/lib/client/enums/IntersectOptions.js +16 -0
  93. package/lib/client/enums/InvertAxis.d.ts +9 -0
  94. package/lib/client/enums/InvertAxis.js +7 -0
  95. package/lib/client/enums/Language.d.ts +14 -0
  96. package/lib/client/enums/Language.js +15 -0
  97. package/lib/client/enums/LeaveVehicleFlags.d.ts +10 -0
  98. package/lib/client/enums/LeaveVehicleFlags.js +11 -0
  99. package/lib/client/enums/LoadingSpinnerType.d.ts +7 -0
  100. package/lib/client/enums/LoadingSpinnerType.js +8 -0
  101. package/lib/client/enums/MarkerType.d.ts +49 -0
  102. package/lib/client/enums/MarkerType.js +50 -0
  103. package/lib/client/enums/MenuAlignment.d.ts +4 -0
  104. package/lib/client/enums/MenuAlignment.js +5 -0
  105. package/lib/client/enums/NotificationType.d.ts +10 -0
  106. package/lib/client/enums/NotificationType.js +11 -0
  107. package/lib/client/enums/Parachute.d.ts +13 -0
  108. package/lib/client/enums/Parachute.js +15 -0
  109. package/lib/client/enums/PickupType.d.ts +73 -0
  110. package/lib/client/enums/PickupType.js +74 -0
  111. package/lib/client/enums/RadioStation.d.ts +24 -0
  112. package/lib/client/enums/RadioStation.js +25 -0
  113. package/lib/client/enums/RagdollType.d.ts +6 -0
  114. package/lib/client/enums/RagdollType.js +7 -0
  115. package/lib/client/enums/Relationship.d.ts +9 -0
  116. package/lib/client/enums/Relationship.js +10 -0
  117. package/lib/client/enums/RopeType.d.ts +5 -0
  118. package/lib/client/enums/RopeType.js +6 -0
  119. package/lib/client/enums/ScreenEffect.d.ts +83 -0
  120. package/lib/client/enums/ScreenEffect.js +84 -0
  121. package/lib/client/enums/SpeechModifier.d.ts +39 -0
  122. package/lib/client/enums/SpeechModifier.js +40 -0
  123. package/lib/client/enums/Vehicle.d.ts +358 -0
  124. package/lib/client/enums/Vehicle.js +376 -0
  125. package/lib/client/enums/Weather.d.ts +21 -0
  126. package/lib/client/enums/Weather.js +22 -0
  127. package/lib/client/enums/ZoneID.d.ts +94 -0
  128. package/lib/client/enums/ZoneID.js +95 -0
  129. package/lib/client/enums/index.d.ts +42 -0
  130. package/lib/client/enums/index.js +42 -0
  131. package/lib/client/hashes/MaterialHash.d.ts +216 -0
  132. package/lib/client/hashes/MaterialHash.js +217 -0
  133. package/lib/client/hashes/PedHash.d.ts +724 -0
  134. package/lib/client/hashes/PedHash.js +725 -0
  135. package/lib/client/hashes/VehicleHash.d.ts +522 -0
  136. package/lib/client/hashes/VehicleHash.js +523 -0
  137. package/lib/client/hashes/WeaponHash.d.ts +147 -0
  138. package/lib/client/hashes/WeaponHash.js +161 -0
  139. package/lib/client/hashes/WeatherTypeHash.d.ts +21 -0
  140. package/lib/client/hashes/WeatherTypeHash.js +22 -0
  141. package/lib/client/hashes/index.d.ts +5 -0
  142. package/lib/client/hashes/index.js +5 -0
  143. package/lib/client/index.d.ts +24 -0
  144. package/lib/client/index.js +25 -0
  145. package/lib/client/interfaces/Dimensions.d.ts +5 -0
  146. package/lib/client/interfaces/Dimensions.js +1 -0
  147. package/lib/client/models/BaseEntity.d.ts +169 -0
  148. package/lib/client/models/BaseEntity.js +459 -0
  149. package/lib/client/models/Entity.d.ts +9 -0
  150. package/lib/client/models/Entity.js +24 -0
  151. package/lib/client/models/EntityBone.d.ts +12 -0
  152. package/lib/client/models/EntityBone.js +24 -0
  153. package/lib/client/models/EntityBoneCollection.d.ts +11 -0
  154. package/lib/client/models/EntityBoneCollection.js +16 -0
  155. package/lib/client/models/Ped.d.ts +199 -0
  156. package/lib/client/models/Ped.js +685 -0
  157. package/lib/client/models/PedBone.d.ts +6 -0
  158. package/lib/client/models/PedBone.js +9 -0
  159. package/lib/client/models/PedBoneCollection.d.ts +8 -0
  160. package/lib/client/models/PedBoneCollection.js +19 -0
  161. package/lib/client/models/Player.d.ts +63 -0
  162. package/lib/client/models/Player.js +174 -0
  163. package/lib/client/models/Prop.d.ts +11 -0
  164. package/lib/client/models/Prop.js +26 -0
  165. package/lib/client/models/Vehicle.d.ts +171 -0
  166. package/lib/client/models/Vehicle.js +551 -0
  167. package/lib/client/models/VehicleDoor.d.ts +19 -0
  168. package/lib/client/models/VehicleDoor.js +42 -0
  169. package/lib/client/models/VehicleDoorCollection.d.ts +14 -0
  170. package/lib/client/models/VehicleDoorCollection.js +61 -0
  171. package/lib/client/models/VehicleMod.d.ts +16 -0
  172. package/lib/client/models/VehicleMod.js +33 -0
  173. package/lib/client/models/VehicleModCollection.d.ts +61 -0
  174. package/lib/client/models/VehicleModCollection.js +227 -0
  175. package/lib/client/models/VehicleToggleMod.d.ts +14 -0
  176. package/lib/client/models/VehicleToggleMod.js +27 -0
  177. package/lib/client/models/VehicleWheel.d.ts +11 -0
  178. package/lib/client/models/VehicleWheel.js +21 -0
  179. package/lib/client/models/VehicleWheelCollection.d.ts +13 -0
  180. package/lib/client/models/VehicleWheelCollection.js +56 -0
  181. package/lib/client/models/VehicleWindow.d.ts +16 -0
  182. package/lib/client/models/VehicleWindow.js +33 -0
  183. package/lib/client/models/VehicleWindowCollection.d.ts +14 -0
  184. package/lib/client/models/VehicleWindowCollection.js +55 -0
  185. package/lib/client/models/index.d.ts +18 -0
  186. package/lib/client/models/index.js +18 -0
  187. package/lib/client/types/EntityType.d.ts +2 -0
  188. package/lib/client/types/EntityType.js +1 -0
  189. package/lib/client/ui/Container.d.ts +11 -0
  190. package/lib/client/ui/Container.js +28 -0
  191. package/lib/client/ui/Effects.d.ts +8 -0
  192. package/lib/client/ui/Effects.js +106 -0
  193. package/lib/client/ui/Fading.d.ts +41 -0
  194. package/lib/client/ui/Fading.js +69 -0
  195. package/lib/client/ui/Hud.d.ts +16 -0
  196. package/lib/client/ui/Hud.js +39 -0
  197. package/lib/client/ui/InstructionalButtons.d.ts +33 -0
  198. package/lib/client/ui/InstructionalButtons.js +53 -0
  199. package/lib/client/ui/LoadingPrompt.d.ts +27 -0
  200. package/lib/client/ui/LoadingPrompt.js +45 -0
  201. package/lib/client/ui/Notification.d.ts +5 -0
  202. package/lib/client/ui/Notification.js +8 -0
  203. package/lib/client/ui/Rectangle.d.ts +10 -0
  204. package/lib/client/ui/Rectangle.js +37 -0
  205. package/lib/client/ui/Scaleform.d.ts +106 -0
  206. package/lib/client/ui/Scaleform.js +234 -0
  207. package/lib/client/ui/Screen.d.ts +16 -0
  208. package/lib/client/ui/Screen.js +72 -0
  209. package/lib/client/ui/Sprite.d.ts +17 -0
  210. package/lib/client/ui/Sprite.js +53 -0
  211. package/lib/client/ui/Text.d.ts +31 -0
  212. package/lib/client/ui/Text.js +102 -0
  213. package/lib/client/ui/Timerbar.d.ts +44 -0
  214. package/lib/client/ui/Timerbar.js +241 -0
  215. package/lib/client/ui/index.d.ts +15 -0
  216. package/lib/client/ui/index.js +15 -0
  217. package/lib/client/ui/interfaces/IButton.d.ts +5 -0
  218. package/lib/client/ui/interfaces/IButton.js +1 -0
  219. package/lib/client/ui/interfaces/IDrawable.d.ts +7 -0
  220. package/lib/client/ui/interfaces/IDrawable.js +1 -0
  221. package/lib/client/ui/interfaces/index.d.ts +2 -0
  222. package/lib/client/ui/interfaces/index.js +1 -0
  223. package/lib/client/ui/menu/Menu.d.ts +108 -0
  224. package/lib/client/ui/menu/Menu.js +802 -0
  225. package/lib/client/ui/menu/MenuControl.d.ts +6 -0
  226. package/lib/client/ui/menu/MenuControl.js +11 -0
  227. package/lib/client/ui/menu/MenuControls.d.ts +9 -0
  228. package/lib/client/ui/menu/MenuControls.js +11 -0
  229. package/lib/client/ui/menu/MenuSettings.d.ts +20 -0
  230. package/lib/client/ui/menu/MenuSettings.js +51 -0
  231. package/lib/client/ui/menu/index.d.ts +6 -0
  232. package/lib/client/ui/menu/index.js +6 -0
  233. package/lib/client/ui/menu/items/UIMenuCheckboxItem.d.ts +20 -0
  234. package/lib/client/ui/menu/items/UIMenuCheckboxItem.js +57 -0
  235. package/lib/client/ui/menu/items/UIMenuItem.d.ts +78 -0
  236. package/lib/client/ui/menu/items/UIMenuItem.js +1090 -0
  237. package/lib/client/ui/menu/items/UIMenuListItem.d.ts +31 -0
  238. package/lib/client/ui/menu/items/UIMenuListItem.js +110 -0
  239. package/lib/client/ui/menu/items/UIMenuSeparatorItem.d.ts +11 -0
  240. package/lib/client/ui/menu/items/UIMenuSeparatorItem.js +29 -0
  241. package/lib/client/ui/menu/items/UIMenuSliderItem.d.ts +47 -0
  242. package/lib/client/ui/menu/items/UIMenuSliderItem.js +173 -0
  243. package/lib/client/ui/menu/items/index.d.ts +6 -0
  244. package/lib/client/ui/menu/items/index.js +6 -0
  245. package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.d.ts +17 -0
  246. package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.js +43 -0
  247. package/lib/client/ui/menu/items/panels/UIMenuColorPanel.d.ts +36 -0
  248. package/lib/client/ui/menu/items/panels/UIMenuColorPanel.js +211 -0
  249. package/lib/client/ui/menu/items/panels/UIMenuGridPanel.d.ts +40 -0
  250. package/lib/client/ui/menu/items/panels/UIMenuGridPanel.js +215 -0
  251. package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.d.ts +26 -0
  252. package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.js +115 -0
  253. package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.d.ts +16 -0
  254. package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.js +77 -0
  255. package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.d.ts +13 -0
  256. package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.js +32 -0
  257. package/lib/client/ui/menu/items/panels/index.d.ts +6 -0
  258. package/lib/client/ui/menu/items/panels/index.js +6 -0
  259. package/lib/client/ui/menu/modules/ListItem.d.ts +6 -0
  260. package/lib/client/ui/menu/modules/ListItem.js +8 -0
  261. package/lib/client/ui/menu/modules/index.d.ts +1 -0
  262. package/lib/client/ui/menu/modules/index.js +1 -0
  263. package/lib/client/utils/Animations.d.ts +19 -0
  264. package/lib/client/utils/Animations.js +55 -0
  265. package/lib/client/utils/Color.d.ts +15 -0
  266. package/lib/client/utils/Color.js +22 -0
  267. package/lib/client/utils/Crypto.d.ts +3 -0
  268. package/lib/client/utils/Crypto.js +25 -0
  269. package/lib/client/utils/LiteEvent.d.ts +13 -0
  270. package/lib/client/utils/LiteEvent.js +21 -0
  271. package/lib/client/utils/Maths.d.ts +4 -0
  272. package/lib/client/utils/Maths.js +10 -0
  273. package/lib/client/utils/Point.d.ts +9 -0
  274. package/lib/client/utils/Point.js +28 -0
  275. package/lib/client/utils/PointF.d.ts +12 -0
  276. package/lib/client/utils/PointF.js +11 -0
  277. package/lib/client/utils/Quaternion.d.ts +10 -0
  278. package/lib/client/utils/Quaternion.js +23 -0
  279. package/lib/client/utils/Size.d.ts +5 -0
  280. package/lib/client/utils/Size.js +6 -0
  281. package/lib/client/utils/String.d.ts +6 -0
  282. package/lib/client/utils/String.js +25 -0
  283. package/lib/client/utils/Vector2.d.ts +54 -0
  284. package/lib/client/utils/Vector2.js +106 -0
  285. package/lib/client/utils/Vector3.d.ts +69 -0
  286. package/lib/client/utils/Vector3.js +140 -0
  287. package/lib/client/utils/Vector4.d.ts +62 -0
  288. package/lib/client/utils/Vector4.js +124 -0
  289. package/lib/client/utils/enumValues.d.ts +12 -0
  290. package/lib/client/utils/enumValues.js +14 -0
  291. package/lib/client/utils/getStringFromUInt8Array.d.ts +8 -0
  292. package/lib/client/utils/getStringFromUInt8Array.js +10 -0
  293. package/lib/client/utils/getUInt32FromUint8Array.d.ts +8 -0
  294. package/lib/client/utils/getUInt32FromUint8Array.js +8 -0
  295. package/lib/client/utils/index.d.ts +10 -0
  296. package/lib/client/utils/index.js +10 -0
  297. package/lib/client/weapon/DlcWeaponData.d.ts +43 -0
  298. package/lib/client/weapon/DlcWeaponData.js +44 -0
  299. package/lib/client/weapon/Mk2WeaponHash.d.ts +18 -0
  300. package/lib/client/weapon/Mk2WeaponHash.js +25 -0
  301. package/lib/client/weapon/Weapon.d.ts +169 -0
  302. package/lib/client/weapon/Weapon.js +267 -0
  303. package/lib/client/weapon/WeaponAsset.d.ts +55 -0
  304. package/lib/client/weapon/WeaponAsset.js +83 -0
  305. package/lib/client/weapon/WeaponCollection.d.ts +90 -0
  306. package/lib/client/weapon/WeaponCollection.js +186 -0
  307. package/lib/client/weapon/WeaponDisplayNameByHash.d.ts +6 -0
  308. package/lib/client/weapon/WeaponDisplayNameByHash.js +75 -0
  309. package/lib/client/weapon/WeaponGroup.d.ts +18 -0
  310. package/lib/client/weapon/WeaponGroup.js +19 -0
  311. package/lib/client/weapon/WeaponHudStats.d.ts +27 -0
  312. package/lib/client/weapon/WeaponHudStats.js +38 -0
  313. package/lib/client/weapon/WeaponLivery.d.ts +13 -0
  314. package/lib/client/weapon/WeaponLivery.js +14 -0
  315. package/lib/client/weapon/WeaponLiveryColor.d.ts +34 -0
  316. package/lib/client/weapon/WeaponLiveryColor.js +35 -0
  317. package/lib/client/weapon/WeaponTint.d.ts +42 -0
  318. package/lib/client/weapon/WeaponTint.js +43 -0
  319. package/lib/client/weapon/index.d.ts +8 -0
  320. package/lib/client/weapon/index.js +8 -0
  321. package/lib/client/weaponComponent/ComponentAttachmentPoint.d.ts +18 -0
  322. package/lib/client/weaponComponent/ComponentAttachmentPoint.js +19 -0
  323. package/lib/client/weaponComponent/ComponentAttachmentPointByHash.d.ts +7 -0
  324. package/lib/client/weaponComponent/ComponentAttachmentPointByHash.js +309 -0
  325. package/lib/client/weaponComponent/ComponentDisplayNameByHash.d.ts +6 -0
  326. package/lib/client/weaponComponent/ComponentDisplayNameByHash.js +280 -0
  327. package/lib/client/weaponComponent/DlcWeaponComponentData.d.ts +40 -0
  328. package/lib/client/weaponComponent/DlcWeaponComponentData.js +44 -0
  329. package/lib/client/weaponComponent/InvalidWeaponComponent.d.ts +12 -0
  330. package/lib/client/weaponComponent/InvalidWeaponComponent.js +28 -0
  331. package/lib/client/weaponComponent/WeaponComponent.d.ts +81 -0
  332. package/lib/client/weaponComponent/WeaponComponent.js +119 -0
  333. package/lib/client/weaponComponent/WeaponComponentCollection.d.ts +108 -0
  334. package/lib/client/weaponComponent/WeaponComponentCollection.js +172 -0
  335. package/lib/client/weaponComponent/WeaponComponentHash.d.ts +671 -0
  336. package/lib/client/weaponComponent/WeaponComponentHash.js +887 -0
  337. package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.d.ts +8 -0
  338. package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.js +823 -0
  339. package/lib/client/weaponComponent/WeaponComponentHudStats.d.ts +27 -0
  340. package/lib/client/weaponComponent/WeaponComponentHudStats.js +34 -0
  341. package/lib/client/weaponComponent/index.d.ts +5 -0
  342. package/lib/client/weaponComponent/index.js +5 -0
  343. package/lib/common/Convar.d.ts +8 -0
  344. package/lib/common/Convar.js +20 -0
  345. package/lib/common/Kvp.d.ts +91 -0
  346. package/lib/common/Kvp.js +161 -0
  347. package/lib/common/Resource.d.ts +14 -0
  348. package/lib/common/Resource.js +35 -0
  349. package/lib/common/index.d.ts +5 -0
  350. package/lib/common/index.js +5 -0
  351. package/lib/common/types.d.ts +6 -0
  352. package/lib/common/types.js +1 -0
  353. package/lib/common/utils/Color.d.ts +10 -0
  354. package/lib/common/utils/Color.js +17 -0
  355. package/lib/common/utils/Maths.d.ts +4 -0
  356. package/lib/common/utils/Maths.js +10 -0
  357. package/lib/common/utils/PointF.d.ts +12 -0
  358. package/lib/common/utils/PointF.js +11 -0
  359. package/lib/common/utils/Quaternion.d.ts +10 -0
  360. package/lib/common/utils/Quaternion.js +23 -0
  361. package/lib/common/utils/Vector2.d.ts +58 -0
  362. package/lib/common/utils/Vector2.js +113 -0
  363. package/lib/common/utils/Vector3.d.ts +73 -0
  364. package/lib/common/utils/Vector3.js +147 -0
  365. package/lib/common/utils/Vector4.d.ts +66 -0
  366. package/lib/common/utils/Vector4.js +131 -0
  367. package/lib/common/utils/cleanPlayerName.d.ts +6 -0
  368. package/lib/common/utils/cleanPlayerName.js +27 -0
  369. package/lib/common/utils/enumValues.d.ts +12 -0
  370. package/lib/common/utils/enumValues.js +14 -0
  371. package/lib/common/utils/getStringFromUInt8Array.d.ts +8 -0
  372. package/lib/common/utils/getStringFromUInt8Array.js +10 -0
  373. package/lib/common/utils/getUInt32FromUint8Array.d.ts +8 -0
  374. package/lib/common/utils/getUInt32FromUint8Array.js +8 -0
  375. package/lib/common/utils/index.d.ts +12 -0
  376. package/lib/common/utils/index.js +12 -0
  377. package/lib/server/Anticheat.d.ts +0 -0
  378. package/lib/server/Anticheat.js +25 -0
  379. package/lib/server/Events.d.ts +35 -0
  380. package/lib/server/Events.js +102 -0
  381. package/lib/server/Game.d.ts +56 -0
  382. package/lib/server/Game.js +86 -0
  383. package/lib/server/cfx/StateBagChangeHandler.d.ts +9 -0
  384. package/lib/server/cfx/StateBagChangeHandler.js +4 -0
  385. package/lib/server/cfx/index.d.ts +7 -0
  386. package/lib/server/cfx/index.js +1 -0
  387. package/lib/server/entities/BaseEntity.d.ts +115 -0
  388. package/lib/server/entities/BaseEntity.js +161 -0
  389. package/lib/server/entities/Entity.d.ts +18 -0
  390. package/lib/server/entities/Entity.js +22 -0
  391. package/lib/server/entities/Ped.d.ts +87 -0
  392. package/lib/server/entities/Ped.js +122 -0
  393. package/lib/server/entities/Player.d.ts +163 -0
  394. package/lib/server/entities/Player.js +235 -0
  395. package/lib/server/entities/Prop.d.ts +32 -0
  396. package/lib/server/entities/Prop.js +42 -0
  397. package/lib/server/entities/Vehicle.d.ts +230 -0
  398. package/lib/server/entities/Vehicle.js +331 -0
  399. package/lib/server/entities/index.d.ts +5 -0
  400. package/lib/server/entities/index.js +5 -0
  401. package/lib/server/enum/ClassTypes.d.ts +11 -0
  402. package/lib/server/enum/ClassTypes.js +12 -0
  403. package/lib/server/enum/PopulationType.d.ts +13 -0
  404. package/lib/server/enum/PopulationType.js +14 -0
  405. package/lib/server/enum/VehicleLockStatus.d.ts +9 -0
  406. package/lib/server/enum/VehicleLockStatus.js +10 -0
  407. package/lib/server/enum/VehicleType.d.ts +10 -0
  408. package/lib/server/enum/VehicleType.js +11 -0
  409. package/lib/server/enum/eEntityType.d.ts +5 -0
  410. package/lib/server/enum/eEntityType.js +6 -0
  411. package/lib/server/enum/index.d.ts +5 -0
  412. package/lib/server/enum/index.js +5 -0
  413. package/lib/server/index.d.ts +7 -0
  414. package/lib/server/index.js +7 -0
  415. package/lib/server/type/Anticheat.d.ts +471 -0
  416. package/lib/server/type/Anticheat.js +160 -0
  417. package/lib/server/type/Hash.d.ts +3 -0
  418. package/lib/server/type/Hash.js +2 -0
  419. package/lib/server/utils/index.d.ts +1 -0
  420. package/lib/server/utils/index.js +1 -0
  421. package/package.json +54 -0
@@ -0,0 +1,104 @@
1
+ import { InvertAxisFlags } from './enums';
2
+ import { Vector3 } from './utils';
3
+ /**
4
+ * UNFINISHED! Class that represents a particle effect asset.
5
+ */
6
+ export class ParticleEffectAsset {
7
+ /**
8
+ * Returns the name of the asset. Same as AssetName.
9
+ */
10
+ get Asset() {
11
+ return this.assetName;
12
+ }
13
+ constructor(assetName) {
14
+ this.assetName = assetName;
15
+ }
16
+ /**
17
+ * Get the name of the particle effect.
18
+ */
19
+ get AssetName() {
20
+ return this.assetName;
21
+ }
22
+ /**
23
+ * Get whether the particle effect has loaded into game memory.
24
+ */
25
+ get IsLoaded() {
26
+ return HasNamedPtfxAssetLoaded(this.assetName);
27
+ }
28
+ /**
29
+ * Start a particle effect at a world position.
30
+ *
31
+ * @param effectName Name of effect.
32
+ * @param rot Rotation from entity position.
33
+ * @param scale Size of the effect.
34
+ * @param invertAxis Which axis to invert (default none).
35
+ */
36
+ startNonLoopedAtCoord(effectName, pos, rot = new Vector3(0, 0, 0), scale = 1.0, invertAxis = { flags: InvertAxisFlags.None }) {
37
+ if (!this.setNextCall()) {
38
+ return false;
39
+ }
40
+ const invertAxisFlags = invertAxis.flags;
41
+ SetPtfxAssetNextCall(this.assetName);
42
+ return (StartParticleFxLoopedAtCoord(effectName, pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, scale, !!(invertAxisFlags & InvertAxisFlags.X), !!(invertAxisFlags & InvertAxisFlags.Y), !!(invertAxisFlags & InvertAxisFlags.Z), false) > 0);
43
+ }
44
+ /**
45
+ * Start a particle effect on an entity
46
+ *
47
+ * @param effectName Name of effect.
48
+ * @param entity Entity to use effect on.
49
+ * @param off Offset from entity position.
50
+ * @param rot Rotation from entity position.
51
+ * @param scale Size of the effect.
52
+ * @param invertAxis Which axis to invert (default none).
53
+ */
54
+ startNonLoopedOnEntity(effectName, entity, off = new Vector3(0, 0, 0), rot = new Vector3(0, 0, 0), scale = 1.0, invertAxis = { flags: InvertAxisFlags.None }) {
55
+ if (!this.setNextCall()) {
56
+ return false;
57
+ }
58
+ const invertAxisFlags = invertAxis.flags;
59
+ SetPtfxAssetNextCall(this.assetName);
60
+ // This still returns
61
+ return !!StartParticleFxLoopedOnEntity(effectName, entity.Handle, off.x, off.y, off.z, rot.x, rot.y, rot.z, scale, !!(invertAxisFlags & InvertAxisFlags.X), !!(invertAxisFlags & InvertAxisFlags.Y), !!(invertAxisFlags & InvertAxisFlags.Z));
62
+ }
63
+ /**
64
+ * Load a particle effect into the game memory.
65
+ *
66
+ * @param timeout Max time to load Particle Effect
67
+ */
68
+ request(timeout) {
69
+ return new Promise(resolve => {
70
+ if (!this.IsLoaded) {
71
+ RequestNamedPtfxAsset(this.assetName);
72
+ const start = GetGameTimer();
73
+ const interval = setInterval(() => {
74
+ if (this.IsLoaded || GetGameTimer() - start >= timeout) {
75
+ clearInterval(interval);
76
+ resolve(this.IsLoaded);
77
+ }
78
+ }, 0);
79
+ }
80
+ else {
81
+ resolve(this.IsLoaded);
82
+ }
83
+ });
84
+ }
85
+ /**
86
+ * Allow game engine to safely unload particle effect model from memory.
87
+ */
88
+ markAsNoLongerNeeded() {
89
+ RemoveNamedPtfxAsset(this.assetName);
90
+ }
91
+ toString() {
92
+ return this.assetName;
93
+ }
94
+ setNextCall() {
95
+ if (!this.IsLoaded) {
96
+ RequestNamedPtfxAsset(this.assetName);
97
+ }
98
+ else {
99
+ SetPtfxAssetNextCall(this.assetName);
100
+ return true;
101
+ }
102
+ return false;
103
+ }
104
+ }
@@ -0,0 +1,9 @@
1
+ import { Vector3 } from './utils';
2
+ export declare class Pickup {
3
+ private handle;
4
+ constructor(handle: number);
5
+ get Position(): Vector3;
6
+ get IsCollected(): boolean;
7
+ delete(): void;
8
+ exists(): boolean;
9
+ }
@@ -0,0 +1,18 @@
1
+ import { Vector3 } from './utils';
2
+ export class Pickup {
3
+ constructor(handle) {
4
+ this.handle = handle;
5
+ }
6
+ get Position() {
7
+ return Vector3.fromArray(GetPickupCoords(this.handle));
8
+ }
9
+ get IsCollected() {
10
+ return HasPickupBeenCollected(this.handle);
11
+ }
12
+ delete() {
13
+ RemovePickup(this.handle);
14
+ }
15
+ exists() {
16
+ return DoesPickupExist(this.handle);
17
+ }
18
+ }
@@ -0,0 +1,49 @@
1
+ import { MaterialHash } from './hashes';
2
+ import { Ped, Prop, Vehicle } from './models';
3
+ import { Vector3 } from './utils';
4
+ /**
5
+ * Class that represents the result of a raycast.
6
+ */
7
+ export declare class RaycastResult {
8
+ /**
9
+ * Return the entity that was hit.
10
+ */
11
+ get HitEntity(): Ped | Vehicle | Prop | null;
12
+ /**
13
+ * Get the position of the entity that was hit.
14
+ */
15
+ get HitPosition(): Vector3;
16
+ /**
17
+ * Return the vector perpendicular to the tangent plane.
18
+ */
19
+ get SurfaceNormal(): Vector3;
20
+ /**
21
+ * Whether we hit anything.
22
+ */
23
+ get DidHit(): boolean;
24
+ /**
25
+ * Whether the entity hit exists.
26
+ */
27
+ get DidHitEntity(): boolean;
28
+ /**
29
+ * Material type that was hit.
30
+ */
31
+ get Material(): MaterialHash;
32
+ /**
33
+ * Raycast result's handle.
34
+ */
35
+ get Result(): number;
36
+ private handle;
37
+ private hitPositionArg;
38
+ private hitSomethingArg;
39
+ private entityHandleArg;
40
+ private surfaceNormalArg;
41
+ private materialArg;
42
+ private result;
43
+ /**
44
+ * Create a RaycastResult object that gets the results from a StartShapeTestRay()
45
+ *
46
+ * @param handle The handle returned from StartShapeTestRay()
47
+ */
48
+ constructor(handle: number);
49
+ }
@@ -0,0 +1,70 @@
1
+ import { Game } from './Game';
2
+ import { Vector3 } from './utils';
3
+ /**
4
+ * Class that represents the result of a raycast.
5
+ */
6
+ export class RaycastResult {
7
+ /**
8
+ * Return the entity that was hit.
9
+ */
10
+ get HitEntity() {
11
+ return this.entityHandleArg;
12
+ }
13
+ /**
14
+ * Get the position of the entity that was hit.
15
+ */
16
+ get HitPosition() {
17
+ return this.hitPositionArg;
18
+ }
19
+ /**
20
+ * Return the vector perpendicular to the tangent plane.
21
+ */
22
+ get SurfaceNormal() {
23
+ return this.surfaceNormalArg;
24
+ }
25
+ /**
26
+ * Whether we hit anything.
27
+ */
28
+ get DidHit() {
29
+ return this.hitSomethingArg;
30
+ }
31
+ /**
32
+ * Whether the entity hit exists.
33
+ */
34
+ get DidHitEntity() {
35
+ return this.entityHandleArg?.Handle !== 0;
36
+ }
37
+ /**
38
+ * Material type that was hit.
39
+ */
40
+ get Material() {
41
+ return this.materialArg;
42
+ }
43
+ /**
44
+ * Raycast result's handle.
45
+ */
46
+ get Result() {
47
+ return this.result;
48
+ }
49
+ // FIXME: This only works with StartExpensiveSynchronousShapeTestLosProbe, this should have some getter you have to await afterwards for all of the data
50
+ /**
51
+ * Create a RaycastResult object that gets the results from a StartShapeTestRay()
52
+ *
53
+ * @param handle The handle returned from StartShapeTestRay()
54
+ */
55
+ constructor(handle) {
56
+ this.handle = handle;
57
+ this.hitPositionArg = new Vector3(0, 0, 0);
58
+ this.hitSomethingArg = false;
59
+ this.entityHandleArg = null;
60
+ this.surfaceNormalArg = new Vector3(0, 0, 0);
61
+ this.materialArg = 0;
62
+ const [result, hit, endCoords, surfaceNormal, materialHash, entityHit] = GetShapeTestResultIncludingMaterial(this.handle);
63
+ this.hitSomethingArg = hit;
64
+ this.hitPositionArg = Vector3.fromArray(endCoords);
65
+ this.surfaceNormalArg = Vector3.fromArray(surfaceNormal);
66
+ this.materialArg = materialHash;
67
+ this.entityHandleArg = Game.entityFromHandle(entityHit);
68
+ this.result = result;
69
+ }
70
+ }
@@ -0,0 +1,49 @@
1
+ import { Relationship } from './enums';
2
+ /**
3
+ * Class to create and manage a relationship group. Useful to manage behavior between Peds.
4
+ */
5
+ export declare class RelationshipGroup {
6
+ /**
7
+ * The hash of the relationship group
8
+ */
9
+ private hash;
10
+ /**
11
+ * Create a relationship group. Optionally pass a group hash.
12
+ *
13
+ * @param name Name of the relationship group.
14
+ */
15
+ constructor(name: string);
16
+ /**
17
+ * Gets the hash of the relationship group.
18
+ *
19
+ * @returns The hash of this object.
20
+ */
21
+ get Hash(): number;
22
+ /**
23
+ * Get the relationship between two relationship groups.
24
+ *
25
+ * @param targetGroup The other relationship group.
26
+ * @returns The relationship
27
+ */
28
+ getRelationshipBetweenGroups(targetGroup: RelationshipGroup): Relationship;
29
+ /**
30
+ * Set the relationship group between this relationship group and another one.
31
+ *
32
+ * @param targetGroup The other relationship group.
33
+ * @param relationship The desired relationship.
34
+ * @param biDirectionally If target group should have same relationship towards this.
35
+ */
36
+ setRelationshipBetweenGroups(targetGroup: RelationshipGroup, relationship: Relationship, biDirectionally?: boolean): void;
37
+ /**
38
+ * Clear the relationship between this relationship group and another.
39
+ *
40
+ * @param targetGroup The other relationship group.
41
+ * @param relationship The desired relationship to clear.
42
+ * @param biDirectionally Whether the target group should also clear the relationship.
43
+ */
44
+ clearRelationshipBetweenGroups(targetGroup: RelationshipGroup, relationship: Relationship, biDirectionally?: boolean): void;
45
+ /**
46
+ * Remove this relationship group from the game. This will not delete this object.
47
+ */
48
+ remove(): void;
49
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Class to create and manage a relationship group. Useful to manage behavior between Peds.
3
+ */
4
+ export class RelationshipGroup {
5
+ /**
6
+ * Create a relationship group. Optionally pass a group hash.
7
+ *
8
+ * @param name Name of the relationship group.
9
+ */
10
+ constructor(name) {
11
+ const [, groupHash] = AddRelationshipGroup(name);
12
+ this.hash = groupHash;
13
+ }
14
+ /**
15
+ * Gets the hash of the relationship group.
16
+ *
17
+ * @returns The hash of this object.
18
+ */
19
+ get Hash() {
20
+ return this.hash;
21
+ }
22
+ /**
23
+ * Get the relationship between two relationship groups.
24
+ *
25
+ * @param targetGroup The other relationship group.
26
+ * @returns The relationship
27
+ */
28
+ getRelationshipBetweenGroups(targetGroup) {
29
+ return GetRelationshipBetweenGroups(this.Hash, targetGroup.Hash);
30
+ }
31
+ /**
32
+ * Set the relationship group between this relationship group and another one.
33
+ *
34
+ * @param targetGroup The other relationship group.
35
+ * @param relationship The desired relationship.
36
+ * @param biDirectionally If target group should have same relationship towards this.
37
+ */
38
+ setRelationshipBetweenGroups(targetGroup, relationship, biDirectionally = false) {
39
+ SetRelationshipBetweenGroups(Number(relationship), this.Hash, targetGroup.Hash);
40
+ if (biDirectionally) {
41
+ SetRelationshipBetweenGroups(Number(relationship), targetGroup.Hash, this.Hash);
42
+ }
43
+ }
44
+ /**
45
+ * Clear the relationship between this relationship group and another.
46
+ *
47
+ * @param targetGroup The other relationship group.
48
+ * @param relationship The desired relationship to clear.
49
+ * @param biDirectionally Whether the target group should also clear the relationship.
50
+ */
51
+ clearRelationshipBetweenGroups(targetGroup, relationship, biDirectionally = false) {
52
+ ClearRelationshipBetweenGroups(Number(relationship), this.Hash, targetGroup.Hash);
53
+ if (biDirectionally) {
54
+ ClearRelationshipBetweenGroups(Number(relationship), targetGroup.Hash, this.Hash);
55
+ }
56
+ }
57
+ /**
58
+ * Remove this relationship group from the game. This will not delete this object.
59
+ */
60
+ remove() {
61
+ RemoveRelationshipGroup(this.Hash);
62
+ }
63
+ }
@@ -0,0 +1,99 @@
1
+ import type { BaseEntity } from './models/BaseEntity';
2
+ import { Vector3 } from './utils';
3
+ /**
4
+ * Class to manage invisible ropes between entities.
5
+ */
6
+ export declare class Rope {
7
+ /**
8
+ * Id of rope entity.
9
+ */
10
+ private readonly handle;
11
+ /**
12
+ * Create a rope object based on an existing rope in the world.
13
+ *
14
+ * @param handle entity Id of rope.
15
+ */
16
+ constructor(handle: number);
17
+ get Handle(): number;
18
+ /**
19
+ * Get the length of the rope.
20
+ *
21
+ * @returns The rope length.
22
+ */
23
+ get Length(): number;
24
+ /**
25
+ * Sets the length of the rope.
26
+ *
27
+ * @param length Desired new length of rope.
28
+ */
29
+ set Length(length: number);
30
+ /**
31
+ * Get the number of vertices on the rope.
32
+ *
33
+ * @returns Returns the number of vertices.
34
+ */
35
+ get VertexCount(): number;
36
+ /**
37
+ * Resets the length of the rope to it's length upon object creation or a length of 1.
38
+ *
39
+ * @param reset Whether to reset the length to it's original length or 1.
40
+ */
41
+ resetLength(reset: boolean): void;
42
+ /**
43
+ * Activates world physics on the rope object.
44
+ */
45
+ activatePhysics(): void;
46
+ /**
47
+ * Attach the rope to an entity.
48
+ *
49
+ * @param entity Entity to attach the rope to.
50
+ * @param position Location where the rope is to be attached.
51
+ */
52
+ attachEntity(entity: BaseEntity, position: Vector3): void;
53
+ /**
54
+ * Attach the rope between two entities at given locations on the entities.
55
+ *
56
+ * @param entityOne The first entity to attach to.
57
+ * @param positionOne Where on the first entity to attach the rope to.
58
+ * @param entityTwo The second entity to attach to.
59
+ * @param positionTwo Where on the second entity to attach the rope to.
60
+ * @param length The desired length of the rope between the two entities.
61
+ */
62
+ attachEntities(entityOne: BaseEntity, positionOne: Vector3, entityTwo: BaseEntity, positionTwo: Vector3, length: number): void;
63
+ /**
64
+ * Detach the rope from an entity.
65
+ *
66
+ * @param entity Entity to detach the rope from.
67
+ */
68
+ detachEntity(entity: BaseEntity): void;
69
+ /**
70
+ * Pin a vertex of the rope to a certain location.
71
+ *
72
+ * @param vertex Vertex to pin.
73
+ * @param position Location to pin the vertex to.
74
+ */
75
+ pinVertex(vertex: number, position: Vector3): void;
76
+ /**
77
+ * Unpin a specified vertex from it's current pinned location (if any).
78
+ *
79
+ * @param vertex Vertex to unpin.
80
+ */
81
+ unpinVertex(vertex: number): void;
82
+ /**
83
+ * Return the world location of a specified vertex on the rope.
84
+ *
85
+ * @param vertex Vertex to get location from.
86
+ * @returns The vector location of the vertex.
87
+ */
88
+ getVertexCoord(vertex: number): Vector3;
89
+ /**
90
+ * Delete the rope from the world. This does not delete the rope object.
91
+ */
92
+ delete(): void;
93
+ /**
94
+ * Check if the rope still exists in the world based on it's handle.
95
+ *
96
+ * @returns Whether the rope exists or not.
97
+ */
98
+ exists(): boolean;
99
+ }
@@ -0,0 +1,125 @@
1
+ import { Vector3 } from './utils';
2
+ /**
3
+ * Class to manage invisible ropes between entities.
4
+ */
5
+ export class Rope {
6
+ /**
7
+ * Create a rope object based on an existing rope in the world.
8
+ *
9
+ * @param handle entity Id of rope.
10
+ */
11
+ constructor(handle) {
12
+ this.handle = handle;
13
+ }
14
+ get Handle() {
15
+ return this.handle;
16
+ }
17
+ /**
18
+ * Get the length of the rope.
19
+ *
20
+ * @returns The rope length.
21
+ */
22
+ get Length() {
23
+ return GetRopeLength(this.handle);
24
+ }
25
+ /**
26
+ * Sets the length of the rope.
27
+ *
28
+ * @param length Desired new length of rope.
29
+ */
30
+ set Length(length) {
31
+ RopeForceLength(this.handle, length);
32
+ }
33
+ /**
34
+ * Get the number of vertices on the rope.
35
+ *
36
+ * @returns Returns the number of vertices.
37
+ */
38
+ get VertexCount() {
39
+ return GetRopeVertexCount(this.handle);
40
+ }
41
+ /**
42
+ * Resets the length of the rope to it's length upon object creation or a length of 1.
43
+ *
44
+ * @param reset Whether to reset the length to it's original length or 1.
45
+ */
46
+ resetLength(reset) {
47
+ RopeResetLength(this.handle, reset ? 1 : this.Length);
48
+ }
49
+ /**
50
+ * Activates world physics on the rope object.
51
+ */
52
+ activatePhysics() {
53
+ ActivatePhysics(this.handle);
54
+ }
55
+ /**
56
+ * Attach the rope to an entity.
57
+ *
58
+ * @param entity Entity to attach the rope to.
59
+ * @param position Location where the rope is to be attached.
60
+ */
61
+ attachEntity(entity, position) {
62
+ AttachRopeToEntity(this.handle, entity.Handle, position.x, position.y, position.z, false);
63
+ }
64
+ /**
65
+ * Attach the rope between two entities at given locations on the entities.
66
+ *
67
+ * @param entityOne The first entity to attach to.
68
+ * @param positionOne Where on the first entity to attach the rope to.
69
+ * @param entityTwo The second entity to attach to.
70
+ * @param positionTwo Where on the second entity to attach the rope to.
71
+ * @param length The desired length of the rope between the two entities.
72
+ */
73
+ attachEntities(entityOne, positionOne, entityTwo, positionTwo, length) {
74
+ AttachEntitiesToRope(this.handle, entityOne.Handle, entityTwo.Handle, positionOne.x, positionOne.y, positionOne.z, positionTwo.x, positionTwo.y, positionTwo.z, length, false, false, '', '');
75
+ }
76
+ /**
77
+ * Detach the rope from an entity.
78
+ *
79
+ * @param entity Entity to detach the rope from.
80
+ */
81
+ detachEntity(entity) {
82
+ DetachRopeFromEntity(this.handle, entity.Handle);
83
+ }
84
+ /**
85
+ * Pin a vertex of the rope to a certain location.
86
+ *
87
+ * @param vertex Vertex to pin.
88
+ * @param position Location to pin the vertex to.
89
+ */
90
+ pinVertex(vertex, position) {
91
+ PinRopeVertex(this.handle, vertex, position.x, position.y, position.z);
92
+ }
93
+ /**
94
+ * Unpin a specified vertex from it's current pinned location (if any).
95
+ *
96
+ * @param vertex Vertex to unpin.
97
+ */
98
+ unpinVertex(vertex) {
99
+ UnpinRopeVertex(this.handle, vertex);
100
+ }
101
+ /**
102
+ * Return the world location of a specified vertex on the rope.
103
+ *
104
+ * @param vertex Vertex to get location from.
105
+ * @returns The vector location of the vertex.
106
+ */
107
+ getVertexCoord(vertex) {
108
+ return Vector3.fromArray(GetRopeVertexCoord(this.handle, vertex));
109
+ }
110
+ /**
111
+ * Delete the rope from the world. This does not delete the rope object.
112
+ */
113
+ delete() {
114
+ DeleteRope(this.handle);
115
+ }
116
+ /**
117
+ * Check if the rope still exists in the world based on it's handle.
118
+ *
119
+ * @returns Whether the rope exists or not.
120
+ */
121
+ exists() {
122
+ const [exists] = DoesRopeExist(this.handle);
123
+ return exists;
124
+ }
125
+ }
@@ -0,0 +1,15 @@
1
+ import { Tasks } from './Tasks';
2
+ export declare class TaskSequence {
3
+ private static nullPed;
4
+ private handle;
5
+ private isClosed;
6
+ private count;
7
+ constructor(handle?: number);
8
+ private create;
9
+ dispose(): void;
10
+ close(repeat?: boolean): void;
11
+ get Handle(): number;
12
+ get AddTask(): Tasks | null | undefined;
13
+ get IsClosed(): boolean;
14
+ get Count(): number;
15
+ }
@@ -0,0 +1,43 @@
1
+ import { Ped } from './models/Ped';
2
+ export class TaskSequence {
3
+ constructor(handle) {
4
+ this.handle = 0;
5
+ handle === undefined ? this.create() : (this.handle = handle);
6
+ if (!TaskSequence.nullPed) {
7
+ TaskSequence.nullPed = new Ped(0);
8
+ }
9
+ this.isClosed = false;
10
+ this.count = 0;
11
+ }
12
+ create() {
13
+ // Docs generate this as 'void' even though it returns a number
14
+ this.handle = OpenSequenceTask(0);
15
+ }
16
+ dispose() {
17
+ ClearSequenceTask(this.handle);
18
+ this.handle = 0;
19
+ }
20
+ close(repeat = false) {
21
+ if (this.isClosed)
22
+ return;
23
+ SetSequenceToRepeat(this.handle, repeat);
24
+ CloseSequenceTask(this.handle);
25
+ this.isClosed = true;
26
+ }
27
+ get Handle() {
28
+ return this.handle;
29
+ }
30
+ get AddTask() {
31
+ if (this.isClosed) {
32
+ throw new Error("You can't add tasks to a closed sequence!");
33
+ }
34
+ this.count += 1;
35
+ return TaskSequence.nullPed?.Task;
36
+ }
37
+ get IsClosed() {
38
+ return this.isClosed;
39
+ }
40
+ get Count() {
41
+ return this.count;
42
+ }
43
+ }