@nativewrappers/redm-codegen 0.0.3 → 0.0.5

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 (313) hide show
  1. package/dist/classes/AnimScene.d.ts +135 -135
  2. package/dist/classes/AnimScene.d.ts.map +1 -1
  3. package/dist/classes/AnimScene.js +208 -208
  4. package/dist/classes/BaseModel.d.ts +21 -21
  5. package/dist/classes/BaseModel.d.ts.map +1 -1
  6. package/dist/classes/BaseModel.js +33 -33
  7. package/dist/classes/BaseTask.d.ts +23 -23
  8. package/dist/classes/BaseTask.d.ts.map +1 -1
  9. package/dist/classes/BaseTask.js +27 -27
  10. package/dist/classes/Cam.d.ts +98 -98
  11. package/dist/classes/Cam.d.ts.map +1 -1
  12. package/dist/classes/Cam.js +134 -134
  13. package/dist/classes/Entity.d.ts +385 -380
  14. package/dist/classes/Entity.d.ts.map +1 -1
  15. package/dist/classes/Entity.js +498 -489
  16. package/dist/classes/Interior.d.ts +5 -5
  17. package/dist/classes/Interior.d.ts.map +1 -1
  18. package/dist/classes/Interior.js +8 -8
  19. package/dist/classes/ItemSet.d.ts +2 -2
  20. package/dist/classes/ItemSet.d.ts.map +1 -1
  21. package/dist/classes/ItemSet.js +3 -3
  22. package/dist/classes/Ped.d.ts +336 -336
  23. package/dist/classes/Ped.d.ts.map +1 -1
  24. package/dist/classes/Ped.js +495 -495
  25. package/dist/classes/PedModel.d.ts +1 -1
  26. package/dist/classes/PedModel.d.ts.map +1 -1
  27. package/dist/classes/PedModel.js +2 -2
  28. package/dist/classes/PedTask.d.ts +255 -255
  29. package/dist/classes/PedTask.d.ts.map +1 -1
  30. package/dist/classes/PedTask.js +345 -345
  31. package/dist/classes/PersChar.d.ts +13 -13
  32. package/dist/classes/PersChar.d.ts.map +1 -1
  33. package/dist/classes/PersChar.js +29 -29
  34. package/dist/classes/Pickup.d.ts +8 -8
  35. package/dist/classes/Pickup.d.ts.map +1 -1
  36. package/dist/classes/Pickup.js +15 -15
  37. package/dist/classes/Player.d.ts +713 -709
  38. package/dist/classes/Player.d.ts.map +1 -1
  39. package/dist/classes/Player.js +979 -973
  40. package/dist/classes/Prop.d.ts +115 -115
  41. package/dist/classes/Prop.d.ts.map +1 -1
  42. package/dist/classes/Prop.js +160 -160
  43. package/dist/classes/PropSet.d.ts +5 -5
  44. package/dist/classes/PropSet.d.ts.map +1 -1
  45. package/dist/classes/PropSet.js +6 -6
  46. package/dist/classes/Vehicle.d.ts +122 -122
  47. package/dist/classes/Vehicle.d.ts.map +1 -1
  48. package/dist/classes/Vehicle.js +147 -147
  49. package/dist/classes/VehicleModel.d.ts +1 -1
  50. package/dist/classes/VehicleModel.d.ts.map +1 -1
  51. package/dist/classes/VehicleModel.js +2 -2
  52. package/dist/classes/VehicleTask.d.ts +9 -9
  53. package/dist/classes/VehicleTask.d.ts.map +1 -1
  54. package/dist/classes/VehicleTask.js +12 -12
  55. package/dist/classes/Volume.d.ts +56 -56
  56. package/dist/classes/Volume.d.ts.map +1 -1
  57. package/dist/classes/Volume.js +84 -84
  58. package/dist/classes/Weapon.d.ts +354 -354
  59. package/dist/classes/Weapon.d.ts.map +1 -1
  60. package/dist/classes/Weapon.js +464 -464
  61. package/dist/namespaces/Aicoverpoint.d.ts +23 -23
  62. package/dist/namespaces/Aicoverpoint.d.ts.map +1 -1
  63. package/dist/namespaces/Aicoverpoint.js +35 -35
  64. package/dist/namespaces/Aitransport.d.ts +78 -78
  65. package/dist/namespaces/Aitransport.d.ts.map +1 -1
  66. package/dist/namespaces/Aitransport.js +95 -95
  67. package/dist/namespaces/Animscene.d.ts +49 -49
  68. package/dist/namespaces/Animscene.d.ts.map +1 -1
  69. package/dist/namespaces/Animscene.js +67 -67
  70. package/dist/namespaces/Audio.d.ts +447 -447
  71. package/dist/namespaces/Audio.d.ts.map +1 -1
  72. package/dist/namespaces/Audio.js +635 -635
  73. package/dist/namespaces/CamStatics.d.ts +441 -441
  74. package/dist/namespaces/CamStatics.d.ts.map +1 -1
  75. package/dist/namespaces/CamStatics.js +675 -675
  76. package/dist/namespaces/Collection.d.ts +6 -6
  77. package/dist/namespaces/Collection.d.ts.map +1 -1
  78. package/dist/namespaces/Collection.js +11 -11
  79. package/dist/namespaces/Companion.d.ts +22 -22
  80. package/dist/namespaces/Companion.d.ts.map +1 -1
  81. package/dist/namespaces/Companion.js +30 -30
  82. package/dist/namespaces/Compapp.js +1 -1
  83. package/dist/namespaces/Compendium.d.ts +82 -82
  84. package/dist/namespaces/Compendium.d.ts.map +1 -1
  85. package/dist/namespaces/Compendium.js +115 -115
  86. package/dist/namespaces/Crashlog.js +9 -9
  87. package/dist/namespaces/Crew.js +4 -4
  88. package/dist/namespaces/Databinding.d.ts +164 -164
  89. package/dist/namespaces/Databinding.d.ts.map +1 -1
  90. package/dist/namespaces/Databinding.js +232 -232
  91. package/dist/namespaces/Datafile.js +4 -4
  92. package/dist/namespaces/Decorator.d.ts +19 -19
  93. package/dist/namespaces/Decorator.d.ts.map +1 -1
  94. package/dist/namespaces/Decorator.js +34 -34
  95. package/dist/namespaces/Dlc.d.ts +5 -5
  96. package/dist/namespaces/Dlc.d.ts.map +1 -1
  97. package/dist/namespaces/Dlc.js +9 -9
  98. package/dist/namespaces/EntityStatics.d.ts +119 -119
  99. package/dist/namespaces/EntityStatics.d.ts.map +1 -1
  100. package/dist/namespaces/EntityStatics.js +164 -164
  101. package/dist/namespaces/Event.js +4 -4
  102. package/dist/namespaces/Fire.d.ts +89 -89
  103. package/dist/namespaces/Fire.d.ts.map +1 -1
  104. package/dist/namespaces/Fire.js +115 -115
  105. package/dist/namespaces/Flock.js +2 -2
  106. package/dist/namespaces/Gang.js +2 -2
  107. package/dist/namespaces/GoogleAnalytics.js +2 -2
  108. package/dist/namespaces/Graphics.d.ts +375 -375
  109. package/dist/namespaces/Graphics.d.ts.map +1 -1
  110. package/dist/namespaces/Graphics.js +569 -569
  111. package/dist/namespaces/Hud.d.ts +507 -507
  112. package/dist/namespaces/Hud.d.ts.map +1 -1
  113. package/dist/namespaces/Hud.js +706 -706
  114. package/dist/namespaces/Ik.js +1 -1
  115. package/dist/namespaces/Interaction.js +3 -3
  116. package/dist/namespaces/InteriorStatics.js +2 -2
  117. package/dist/namespaces/Inventory.d.ts +159 -159
  118. package/dist/namespaces/Inventory.d.ts.map +1 -1
  119. package/dist/namespaces/Inventory.js +214 -214
  120. package/dist/namespaces/Itemdatabase.d.ts +5 -5
  121. package/dist/namespaces/Itemdatabase.d.ts.map +1 -1
  122. package/dist/namespaces/Itemdatabase.js +10 -10
  123. package/dist/namespaces/Itemset.js +2 -2
  124. package/dist/namespaces/Law.d.ts +1 -1
  125. package/dist/namespaces/Law.d.ts.map +1 -1
  126. package/dist/namespaces/Law.js +19 -19
  127. package/dist/namespaces/Localization.js +1 -1
  128. package/dist/namespaces/Map.d.ts +173 -173
  129. package/dist/namespaces/Map.d.ts.map +1 -1
  130. package/dist/namespaces/Map.js +240 -240
  131. package/dist/namespaces/Minigame.d.ts +17 -17
  132. package/dist/namespaces/Minigame.d.ts.map +1 -1
  133. package/dist/namespaces/Minigame.js +25 -25
  134. package/dist/namespaces/Misc.d.ts +3 -3
  135. package/dist/namespaces/Misc.d.ts.map +1 -1
  136. package/dist/namespaces/Misc.js +35 -35
  137. package/dist/namespaces/Missiondata.d.ts +15 -15
  138. package/dist/namespaces/Missiondata.d.ts.map +1 -1
  139. package/dist/namespaces/Missiondata.js +24 -24
  140. package/dist/namespaces/Money.js +3 -3
  141. package/dist/namespaces/Netshopping.d.ts +58 -58
  142. package/dist/namespaces/Netshopping.d.ts.map +1 -1
  143. package/dist/namespaces/Netshopping.js +89 -89
  144. package/dist/namespaces/Network.d.ts +694 -694
  145. package/dist/namespaces/Network.d.ts.map +1 -1
  146. package/dist/namespaces/Network.js +1129 -1129
  147. package/dist/namespaces/Object.d.ts +142 -142
  148. package/dist/namespaces/Object.d.ts.map +1 -1
  149. package/dist/namespaces/Object.js +195 -195
  150. package/dist/namespaces/Pad.d.ts +101 -101
  151. package/dist/namespaces/Pad.d.ts.map +1 -1
  152. package/dist/namespaces/Pad.js +142 -142
  153. package/dist/namespaces/Pathfind.js +10 -10
  154. package/dist/namespaces/PedStatics.d.ts +20 -20
  155. package/dist/namespaces/PedStatics.d.ts.map +1 -1
  156. package/dist/namespaces/PedStatics.js +36 -36
  157. package/dist/namespaces/Perschar.d.ts +49 -49
  158. package/dist/namespaces/Perschar.d.ts.map +1 -1
  159. package/dist/namespaces/Perschar.js +76 -76
  160. package/dist/namespaces/Physics.d.ts +89 -89
  161. package/dist/namespaces/Physics.d.ts.map +1 -1
  162. package/dist/namespaces/Physics.js +125 -125
  163. package/dist/namespaces/PlayerStatics.d.ts +139 -139
  164. package/dist/namespaces/PlayerStatics.d.ts.map +1 -1
  165. package/dist/namespaces/PlayerStatics.js +200 -200
  166. package/dist/namespaces/Population.d.ts +75 -75
  167. package/dist/namespaces/Population.d.ts.map +1 -1
  168. package/dist/namespaces/Population.js +101 -101
  169. package/dist/namespaces/Posse.d.ts +54 -54
  170. package/dist/namespaces/Posse.d.ts.map +1 -1
  171. package/dist/namespaces/Posse.js +86 -86
  172. package/dist/namespaces/Replay.d.ts +1 -1
  173. package/dist/namespaces/Replay.d.ts.map +1 -1
  174. package/dist/namespaces/Replay.js +2 -2
  175. package/dist/namespaces/Scripts.d.ts +1 -1
  176. package/dist/namespaces/Scripts.d.ts.map +1 -1
  177. package/dist/namespaces/Scripts.js +12 -12
  178. package/dist/namespaces/Socialclub.js +8 -8
  179. package/dist/namespaces/Socialclubfeed.js +1 -1
  180. package/dist/namespaces/Spactionproxy.js +4 -4
  181. package/dist/namespaces/Stats.d.ts +197 -197
  182. package/dist/namespaces/Stats.d.ts.map +1 -1
  183. package/dist/namespaces/Stats.js +285 -285
  184. package/dist/namespaces/Streaming.d.ts +46 -46
  185. package/dist/namespaces/Streaming.d.ts.map +1 -1
  186. package/dist/namespaces/Streaming.js +79 -79
  187. package/dist/namespaces/Task.d.ts +138 -138
  188. package/dist/namespaces/Task.d.ts.map +1 -1
  189. package/dist/namespaces/Task.js +204 -204
  190. package/dist/namespaces/Telemetry.d.ts +212 -212
  191. package/dist/namespaces/Telemetry.d.ts.map +1 -1
  192. package/dist/namespaces/Telemetry.js +308 -308
  193. package/dist/namespaces/Txd.js +1 -1
  194. package/dist/namespaces/Uiapps.d.ts +25 -25
  195. package/dist/namespaces/Uiapps.d.ts.map +1 -1
  196. package/dist/namespaces/Uiapps.js +36 -36
  197. package/dist/namespaces/Uievents.js +1 -1
  198. package/dist/namespaces/Uifeed.d.ts +15 -15
  199. package/dist/namespaces/Uifeed.d.ts.map +1 -1
  200. package/dist/namespaces/Uifeed.js +25 -25
  201. package/dist/namespaces/Uistickyfeed.d.ts +16 -16
  202. package/dist/namespaces/Uistickyfeed.d.ts.map +1 -1
  203. package/dist/namespaces/Uistickyfeed.js +21 -21
  204. package/dist/namespaces/Unlock.js +5 -5
  205. package/dist/namespaces/VehicleStatics.js +12 -12
  206. package/dist/namespaces/Voice.d.ts +38 -38
  207. package/dist/namespaces/Voice.d.ts.map +1 -1
  208. package/dist/namespaces/Voice.js +61 -61
  209. package/dist/namespaces/VolumeStatics.d.ts +161 -161
  210. package/dist/namespaces/VolumeStatics.d.ts.map +1 -1
  211. package/dist/namespaces/VolumeStatics.js +217 -217
  212. package/dist/namespaces/Water.d.ts +27 -27
  213. package/dist/namespaces/Water.d.ts.map +1 -1
  214. package/dist/namespaces/Water.js +41 -41
  215. package/dist/namespaces/WeaponStatics.d.ts +274 -274
  216. package/dist/namespaces/WeaponStatics.d.ts.map +1 -1
  217. package/dist/namespaces/WeaponStatics.js +390 -390
  218. package/dist/namespaces/Zone.d.ts +7 -7
  219. package/dist/namespaces/Zone.d.ts.map +1 -1
  220. package/dist/namespaces/Zone.js +9 -9
  221. package/dist/types/NativeAliases.d.ts +3 -1
  222. package/dist/types/NativeAliases.d.ts.map +1 -1
  223. package/dist/types/NativeAliases.js +3 -1
  224. package/package.json +1 -1
  225. package/src/classes/AnimScene.ts +227 -227
  226. package/src/classes/BaseModel.ts +36 -36
  227. package/src/classes/BaseTask.ts +29 -29
  228. package/src/classes/Cam.ts +143 -143
  229. package/src/classes/Entity.ts +517 -506
  230. package/src/classes/Interior.ts +8 -8
  231. package/src/classes/ItemSet.ts +3 -3
  232. package/src/classes/Ped.ts +512 -512
  233. package/src/classes/PedModel.ts +2 -2
  234. package/src/classes/PedTask.ts +429 -429
  235. package/src/classes/PersChar.ts +35 -35
  236. package/src/classes/Pickup.ts +16 -16
  237. package/src/classes/Player.ts +995 -988
  238. package/src/classes/Prop.ts +177 -177
  239. package/src/classes/PropSet.ts +6 -6
  240. package/src/classes/Vehicle.ts +147 -147
  241. package/src/classes/VehicleModel.ts +2 -2
  242. package/src/classes/VehicleTask.ts +13 -13
  243. package/src/classes/Volume.ts +91 -91
  244. package/src/classes/Weapon.ts +489 -489
  245. package/src/namespaces/Aicoverpoint.ts +40 -40
  246. package/src/namespaces/Aitransport.ts +104 -104
  247. package/src/namespaces/Animscene.ts +74 -74
  248. package/src/namespaces/Audio.ts +647 -647
  249. package/src/namespaces/CamStatics.ts +768 -768
  250. package/src/namespaces/Collection.ts +12 -12
  251. package/src/namespaces/Companion.ts +34 -34
  252. package/src/namespaces/Compapp.ts +1 -1
  253. package/src/namespaces/Compendium.ts +120 -120
  254. package/src/namespaces/Crashlog.ts +9 -9
  255. package/src/namespaces/Crew.ts +4 -4
  256. package/src/namespaces/Databinding.ts +249 -249
  257. package/src/namespaces/Datafile.ts +4 -4
  258. package/src/namespaces/Decorator.ts +37 -37
  259. package/src/namespaces/Dlc.ts +9 -9
  260. package/src/namespaces/EntityStatics.ts +172 -172
  261. package/src/namespaces/Event.ts +4 -4
  262. package/src/namespaces/Fire.ts +127 -127
  263. package/src/namespaces/Flock.ts +2 -2
  264. package/src/namespaces/Gang.ts +2 -2
  265. package/src/namespaces/GoogleAnalytics.ts +2 -2
  266. package/src/namespaces/Graphics.ts +583 -583
  267. package/src/namespaces/Hud.ts +741 -741
  268. package/src/namespaces/Ik.ts +1 -1
  269. package/src/namespaces/Interaction.ts +3 -3
  270. package/src/namespaces/InteriorStatics.ts +2 -2
  271. package/src/namespaces/Inventory.ts +236 -236
  272. package/src/namespaces/Itemdatabase.ts +11 -11
  273. package/src/namespaces/Itemset.ts +2 -2
  274. package/src/namespaces/Law.ts +20 -20
  275. package/src/namespaces/Localization.ts +1 -1
  276. package/src/namespaces/Map.ts +256 -256
  277. package/src/namespaces/Minigame.ts +29 -29
  278. package/src/namespaces/Misc.ts +38 -38
  279. package/src/namespaces/Missiondata.ts +28 -28
  280. package/src/namespaces/Money.ts +3 -3
  281. package/src/namespaces/Netshopping.ts +99 -99
  282. package/src/namespaces/Network.ts +1165 -1165
  283. package/src/namespaces/Object.ts +214 -214
  284. package/src/namespaces/Pad.ts +150 -150
  285. package/src/namespaces/Pathfind.ts +10 -10
  286. package/src/namespaces/PedStatics.ts +42 -42
  287. package/src/namespaces/Perschar.ts +78 -78
  288. package/src/namespaces/Physics.ts +141 -141
  289. package/src/namespaces/PlayerStatics.ts +228 -228
  290. package/src/namespaces/Population.ts +114 -114
  291. package/src/namespaces/Posse.ts +87 -87
  292. package/src/namespaces/Replay.ts +3 -3
  293. package/src/namespaces/Scripts.ts +13 -13
  294. package/src/namespaces/Socialclub.ts +8 -8
  295. package/src/namespaces/Socialclubfeed.ts +1 -1
  296. package/src/namespaces/Spactionproxy.ts +4 -4
  297. package/src/namespaces/Stats.ts +293 -293
  298. package/src/namespaces/Streaming.ts +93 -93
  299. package/src/namespaces/Task.ts +228 -228
  300. package/src/namespaces/Telemetry.ts +322 -322
  301. package/src/namespaces/Txd.ts +1 -1
  302. package/src/namespaces/Uiapps.ts +43 -43
  303. package/src/namespaces/Uievents.ts +1 -1
  304. package/src/namespaces/Uifeed.ts +28 -28
  305. package/src/namespaces/Uistickyfeed.ts +23 -23
  306. package/src/namespaces/Unlock.ts +5 -5
  307. package/src/namespaces/VehicleStatics.ts +12 -12
  308. package/src/namespaces/Voice.ts +70 -70
  309. package/src/namespaces/VolumeStatics.ts +222 -222
  310. package/src/namespaces/Water.ts +47 -47
  311. package/src/namespaces/WeaponStatics.ts +402 -402
  312. package/src/namespaces/Zone.ts +10 -10
  313. package/src/types/NativeAliases.ts +6 -1
@@ -20,439 +20,329 @@ export class Weapon {
20
20
  }
21
21
 
22
22
  /**
23
- * @param weaponHash Refer to [enum: eWeaponHash]
24
- * @param ammoHash Refer to [enum: eAmmoType]
25
- */
26
- enableAmmoTypeForPedWeapon(weaponHash: eWeaponHash, ammoHash: eAmmoType): void {
27
- inv<void>('0x23FB9FACA28779C1', this.ped.handle, weaponHash, ammoHash);
28
- }
29
-
30
- /**
31
- * @param toggle
32
- */
33
- N_0x431240A58484D5D0(toggle: boolean): void {
34
- inv<void>('0x431240A58484D5D0', this.ped.handle, toggle);
35
- }
36
-
37
- /**
38
- * @param p2
39
- * @param p3
40
- * @returns outGUID
41
- */
42
- getBestPedShortarmGuid(p2: boolean, p3: boolean): number {
43
- const result = inv<number>('0xF52BD94B47CCF736', this.ped.handle, pvi(), p2, p3);
44
- return result;
45
- }
46
-
47
- /**
48
- * @returns coords
23
+ * @param visible
49
24
  */
50
- getPedLastWeaponImpactCoord(): [boolean, Vector3] {
51
- const result = inv<[boolean, number[]]>('0x6C4D0409BA1A2BC2', this.ped.handle, pvv(), rai());
52
- return [!!result[0], Vector3.fromArray(result[1])];
25
+ set PedAllWeaponsVisibility(visible: boolean) {
26
+ inv<void>('0x4F806A6CFED89468', this.ped.handle, visible);
53
27
  }
54
28
 
55
29
  /**
56
- * Returns WeaponAttachPoint
57
- *
58
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
30
+ * @param weaponHash Refer to [enum: eWeaponHash]
31
+ * @param ammo
59
32
  * @returns
60
33
  */
61
- getWeaponAttachPoint(attachPoint: number): number {
62
- return inv<number>('0xCAD4FE9398820D24', this.ped.handle, attachPoint, rai());
63
- }
64
-
65
- /**
66
- * @param p2
67
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
68
- * @param p4
69
- * @returns weaponHash: Refer to [enum: eWeaponHash]
70
- */
71
- getCurrentPedWeapon(p2: boolean, attachPoint: number, p4: boolean): [boolean, number] {
72
- const result = inv<[boolean, number]>('0x3A87E44BB9A01D54', this.ped.handle, pvi(), p2, attachPoint, p4, rai());
73
- return [!!result[0], result[1]];
34
+ setAmmoInClip(weaponHash: eWeaponHash, ammo: number): boolean {
35
+ return !!inv<boolean>('0xDCD2A934D65CB497', this.ped.handle, weaponHash, ammo, rai());
74
36
  }
75
37
 
76
38
  /**
77
- * Returns whether the ped has a revolver p1: 0 or 1
39
+ * _GET_M* - _GET_PED_A*
78
40
  *
79
41
  * @param p1
80
42
  * @returns
81
43
  */
82
- doesPedHaveRevolver(p1: number): any {
83
- return inv<number>('0x5B235F24472F2C3B', this.ped.handle, p1);
44
+ getPedWeaponObject(p1: boolean): Prop | null {
45
+ return createFromHandle<Prop>('Prop', inv<number>('0x6CA484C9A7377E4F', this.ped.handle, p1, rai()));
84
46
  }
85
47
 
86
48
  /**
87
- * Returns emote Hash
49
+ * slotHash is usually just the weaponHash name, but WEAPON_* is replaced with SLOT_*
88
50
  *
51
+ * @param slotHash
89
52
  * @returns
90
53
  */
91
- getPedGunSpinningEquippedKitEmoteTwirl(): number {
92
- return (inv<number>('0x2C4FEC3D0EFA9FC0', this.ped.handle, rai())) & 0xFFFFFFFF;
54
+ getPedWeaponInSlot(slotHash: string | number): number {
55
+ return (inv<number>('0xDBC4B552B2AE9A83', this.ped.handle, _h(slotHash), rai())) & 0xFFFFFFFF;
93
56
  }
94
57
 
95
58
  /**
96
- * @param weaponHash Refer to [enum: eWeaponHash]
97
- * @returns ammo
59
+ * Outputs cached guids
60
+ *
61
+ * @returns guidPrimary; guidSecondary
98
62
  */
99
- getAmmoInClip(weaponHash: eWeaponHash): [boolean, number] {
100
- const result = inv<[boolean, number]>('0x2E1202248937775C', this.ped.handle, pvi(), weaponHash, rai());
101
- return [!!result[0], result[1]];
63
+ get PlayerPedQuickSwapWeaponByGuid(): [number, number] {
64
+ const result = inv<[number, number]>('0xB7E52A058B07C7E2', this.ped.handle, pvi(), pvi());
65
+ return [result[0], result[1]];
102
66
  }
103
67
 
104
68
  /**
105
- * @param toggle
69
+ * Returns true if the ped is currently holstering or unholstering a weapon
70
+ *
71
+ * @returns
106
72
  */
107
- N_0x16D9841A85FA627E(toggle: boolean): void {
108
- inv<void>('0x16D9841A85FA627E', this.ped.handle, toggle);
73
+ get IsWeaponHolsterStateChanging(): boolean {
74
+ return !!inv<boolean>('0x2387D6E9C6B478AA', this.ped.handle, rai());
109
75
  }
110
76
 
111
77
  /**
112
- * @param weaponHash Refer to [enum: eWeaponHash]
113
- * @param offset
114
- * @param ammoCount
78
+ * @param ammoHash Refer to [enum: eAmmoType]
79
+ * @returns
115
80
  */
116
- setPedDropsInventoryWeapon(weaponHash: eWeaponHash, offset: Vector3, ammoCount: number): void {
117
- inv<void>('0x208A1888007FC0E6', this.ped.handle, weaponHash, f(offset.x), f(offset.y), f(offset.z), ammoCount);
81
+ N_0x44C8F4908F1B2622(ammoHash: eAmmoType): boolean {
82
+ return !!inv<boolean>('0x44C8F4908F1B2622', this.ped.handle, ammoHash, rai());
118
83
  }
119
84
 
120
85
  /**
121
- * spinHash can be -1, 0 to disable
122
- *
123
- * @param weaponEmoteTrickType
124
- * @param spin
86
+ * @param p2
87
+ * @returns clipInventoryUid
125
88
  */
126
- setActiveGunSpinningKitEmoteTwirl(weaponEmoteTrickType: number, spin: string | number): void {
127
- inv<void>('0x01F661BB9C71B465', this.ped.handle, weaponEmoteTrickType, _h(spin));
89
+ refillAmmoInClip(p2: number): [any, number] {
90
+ const result = inv<[number, number]>('0xDF4A3404D022ADDE', this.ped.handle, pvi(), p2);
91
+ return [result[0], result[1]];
128
92
  }
129
93
 
130
94
  /**
131
- * Appears to just send specified weapon to your horse holster without having to be close
132
- * However, the weapon is not visible on the horse holster, but you can reach the weapon on the weapon wheel
95
+ * _SET_A* - _SET_B*
133
96
  *
134
- * @param weaponHash Refer to [enum: eWeaponHash]
97
+ * @param p1
135
98
  */
136
- sendWeaponToInventory(weaponHash: eWeaponHash): void {
137
- inv<void>('0xE9BD19F8121ADE3E', this.ped.handle, weaponHash);
99
+ N_0x2EBF70E1D8C06683(p1: string | number): void {
100
+ inv<void>('0x2EBF70E1D8C06683', this.ped.handle, _h(p1));
138
101
  }
139
102
 
140
103
  /**
141
- * If near your horse when called, weapons stored on your horse will be considered
142
- * Returns weaponHash
143
- *
144
- * @param weaponGroup
145
- * @param p2
146
- * @param p3
104
+ * @param ammoType
147
105
  * @returns
148
106
  */
149
- getBestPedWeaponInGroup(weaponGroup: string | number, p2: boolean, p3: boolean): number {
150
- return (inv<number>('0x9F67929D98E7C6E8', this.ped.handle, _h(weaponGroup), p2, p3, rai())) & 0xFFFFFFFF;
107
+ getPedAmmoByType(ammoType: string | number): number {
108
+ return inv<number>('0x39D22031557946C1', this.ped.handle, _h(ammoType), rai());
151
109
  }
152
110
 
153
111
  /**
154
- * Only used in R* SP Scripts native_son2, native_son3 and smuggler2
155
- * Params: p2 = -1
156
- *
157
112
  * @param p1
158
113
  * @param p2
114
+ * @returns
159
115
  */
160
- N_0x8A779706DA5CA3DD(p1: boolean, p2: number): void {
161
- inv<void>('0x8A779706DA5CA3DD', this.ped.handle, p1, p2);
116
+ getBestPedWeapon(p1: boolean, p2: boolean): number {
117
+ return (inv<number>('0x8483E98E8B888AE2', this.ped.handle, p1, p2, rai())) & 0xFFFFFFFF;
162
118
  }
163
119
 
164
120
  /**
121
+ * @param toggle
165
122
  * @param weaponHash Refer to [enum: eWeaponHash]
166
- * @param ammoHash Refer to [enum: eAmmoType]
167
123
  */
168
- disableAmmoTypeForPedWeapon(weaponHash: eWeaponHash, ammoHash: eAmmoType): void {
169
- inv<void>('0xF0D728EEA3C99775', this.ped.handle, weaponHash, ammoHash);
124
+ setPedInfiniteAmmo(toggle: boolean, weaponHash: eWeaponHash): void {
125
+ inv<void>('0x3EDCB0505123623B', this.ped.handle, toggle, weaponHash);
170
126
  }
171
127
 
172
128
  /**
173
- * @returns data; outData
129
+ * @param weaponHash Refer to [enum: eWeaponHash]
130
+ * @param ammoHash Refer to [enum: eAmmoType]
174
131
  */
175
- giveWeaponToPedWithOptions(): [boolean, number, number] {
176
- const result = inv<[boolean, number, number]>('0xBE7E42B07FD317AC', this.ped.handle, pvi(), pvi(), rai());
177
- return [!!result[0], result[1], result[2]];
132
+ setAmmoTypeForPedWeapon(weaponHash: eWeaponHash, ammoHash: eAmmoType): void {
133
+ inv<void>('0xCC9C4393523833E2', this.ped.handle, weaponHash, ammoHash);
178
134
  }
179
135
 
180
136
  /**
181
- * @returns
137
+ * *GET_BEST** - *GET_CLOSEST**
138
+ *
139
+ * @returns weaponGuid
182
140
  */
183
- getMaxLockonDistanceOfCurrentPedWeapon(): number {
184
- return inv<number>('0x79B1A6E780266DB0', this.ped.handle, raf());
141
+ get CorrectKitEmoteTwirlGun(): [boolean, number] {
142
+ const result = inv<[boolean, number]>('0xCD356B42C57BFE01', this.ped.handle, pvi(), rai());
143
+ return [!!result[0], result[1]];
185
144
  }
186
145
 
187
146
  /**
147
+ * @param weaponHash Refer to [enum: eWeaponHash]
188
148
  * @returns
189
149
  */
190
- getAllowDualWield(): any {
191
- return inv<number>('0x918990BD9CE08582', this.ped.handle);
150
+ setCurrentPedVehicleWeapon(weaponHash: eWeaponHash): boolean {
151
+ return !!inv<boolean>('0x75C55983C2C39DAA', this.ped.handle, weaponHash, rai());
192
152
  }
193
153
 
194
154
  /**
195
- * Returns eCurrentHeldWeapon
196
- * _GET_R* - _GET_T*
155
+ * Returns whether the ped has a rifle p1: 0 or 1
197
156
  *
157
+ * @param p1
198
158
  * @returns
199
159
  */
200
- getPedCurrentHeldWeapon(): number {
201
- return (inv<number>('0x8425C5F057012DAB', this.ped.handle, rai())) & 0xFFFFFFFF;
202
- }
203
-
204
- /**
205
- * @param toggle
206
- */
207
- setForceAutoEquip(toggle: boolean): void {
208
- inv<void>('0xBE711B14A159E84F', this.ped.handle, toggle);
160
+ doesPedHaveRifle(p1: number): any {
161
+ return inv<number>('0x95CA12E2C68043E5', this.ped.handle, p1);
209
162
  }
210
163
 
211
164
  /**
165
+ * Puts the gun visibly in your horse's holster without having to be close to the horse. Use `_SEND_WEAPON_TO_INVENTORY` before using this native
166
+ * _A* or _B*
167
+ *
212
168
  * @param weaponHash Refer to [enum: eWeaponHash]
213
- * @param ammo
169
+ * @param ped
214
170
  */
215
- setPedAmmo(weaponHash: eWeaponHash, ammo: number): void {
216
- inv<void>('0x14E56BC5B5DB6A19', this.ped.handle, weaponHash, ammo);
171
+ N_0x14FF0C2545527F9B(weaponHash: eWeaponHash, ped: Ped): void {
172
+ inv<void>('0x14FF0C2545527F9B', this.ped.handle, weaponHash, ped.handle);
217
173
  }
218
174
 
219
175
  /**
220
- * Gives the ped the weapon.
221
- * List: https://github.com/femga/rdr3_discoveries/blob/master/weapons/weapons.lua Params: p7 is 0.5f, and p8 is 1.0f. p11 and p12 are both 0 in R* Scripts
222
- * permanentDegradation: default 0.5, any higher than 0 it will automatically make the weapon worn, you can also adjust the value to change the weapons maximum cleanliness
176
+ * Returns iSpinHash / iVariationSpin
223
177
  *
224
- * @param weaponHash Refer to [enum: eWeaponHash]
225
- * @param ammoCount
226
- * @param bForceInHand
227
- * @param bForceInHolster
228
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
229
- * @param bAllowMultipleCopies
230
- * @param p7
231
- * @param p8
232
- * @param addReason Refer to [enum: eAddItemReason]
233
- * @param bIgnoreUnlocks
234
- * @param permanentDegradation
235
- * @param p12
178
+ * @param weaponEmoteVariation
236
179
  * @returns
237
180
  */
238
- giveWeaponToPed(weaponHash: eWeaponHash, ammoCount: number, bForceInHand: boolean, bForceInHolster: boolean, attachPoint: number, bAllowMultipleCopies: boolean, p7: number, p8: number, addReason: eAddItemReason, bIgnoreUnlocks: boolean, permanentDegradation: number, p12: boolean): number {
239
- return (inv<number>('0x5E3BDDBCB83F3D84', this.ped.handle, weaponHash, ammoCount, bForceInHand, bForceInHolster, attachPoint, bAllowMultipleCopies, f(p7), f(p8), addReason, bIgnoreUnlocks, f(permanentDegradation), p12, rai())) & 0xFFFFFFFF;
181
+ getPedGunSpinningHashFromWeaponEmoteVariation(weaponEmoteVariation: number): number {
182
+ return (inv<number>('0xF3B1620B920D1708', this.ped.handle, weaponEmoteVariation, rai())) & 0xFFFFFFFF;
240
183
  }
241
184
 
242
185
  /**
243
- * @param weaponHash Refer to [enum: eWeaponHash]
186
+ * Returns whether the ped has a repeater p1: 0 or 1
187
+ *
188
+ * @param p1
244
189
  * @returns
245
190
  */
246
- getAmmoInPedWeapon(weaponHash: eWeaponHash): number {
247
- return inv<number>('0x015A522136D7F951', this.ped.handle, weaponHash, rai());
248
- }
249
-
250
- /**
251
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
252
- * @returns weaponGuid
253
- */
254
- getPedWeaponGuidAtAttachPoint(attachPoint: number): [any, number] {
255
- const result = inv<[number, number]>('0x6929E22158E52265', this.ped.handle, attachPoint, pvi());
256
- return [result[0], result[1]];
191
+ doesPedHaveRepeater(p1: number): any {
192
+ return inv<number>('0x495A04CAEC263AF8', this.ped.handle, p1);
257
193
  }
258
194
 
259
195
  /**
260
- * @param toggle
196
+ * @param weaponCollection
261
197
  */
262
- setAllowAnyWeaponDrop(toggle: boolean): void {
263
- inv<void>('0x78030C7867D8B9B6', this.ped.handle, toggle);
198
+ giveWeaponCollectionToPed(weaponCollection: string | number): void {
199
+ inv<void>('0x899A04AFCC725D04', this.ped.handle, _h(weaponCollection));
264
200
  }
265
201
 
266
202
  /**
267
203
  * @returns
268
204
  */
269
- makePedReload(): any {
270
- return inv<number>('0x79E1E511FF7EFB13', this.ped.handle);
271
- }
272
-
273
- /**
274
- * @param weaponHash Refer to [enum: eWeaponHash]
275
- * @param ammoCount
276
- * @param p3
277
- * @param addReason Refer to [enum: eAddItemReason]
278
- */
279
- giveDelayedWeaponToPed(weaponHash: eWeaponHash, ammoCount: number, p3: boolean, addReason: eAddItemReason): void {
280
- inv<void>('0xB282DC6EBD803C75', this.ped.handle, weaponHash, ammoCount, p3, addReason);
281
- }
282
-
283
- /**
284
- * @param toggle
285
- */
286
- N_0x45E57FDD531C9477(toggle: boolean): void {
287
- inv<void>('0x45E57FDD531C9477', this.ped.handle, toggle);
288
- }
289
-
290
- /**
291
- * @param ammoHash Refer to [enum: eAmmoType]
292
- * @returns weaponInventoryUid
293
- */
294
- setAmmoTypeForPedWeaponInventory(ammoHash: eAmmoType): number {
295
- const result = inv<number>('0xEBE46B501BC3FBCF', this.ped.handle, pvi(), ammoHash);
296
- return result;
205
+ enableWeaponRestore(): any {
206
+ return inv<number>('0xC395355843BE134B', this.ped.handle);
297
207
  }
298
208
 
299
209
  /**
300
- * @param weaponHash Refer to [enum: eWeaponHash]
301
- * @param p2
302
- * @param removeReason Refer to [enum: eRemoveItemReason]
210
+ * Returns whether the specified ped is holding a weapon with the given hash.
211
+ * only these weapons below return true
212
+ * WEAPON_BOW, WEAPON_KIT_METAL_DETECTOR, WEAPON_MELEE_CLEAVER, WEAPON_MELEE_DAVY_LANTERN, WEAPON_MELEE_HATCHET, WEAPON_MELEE_HATCHET_HUNTER, WEAPON_MELEE_KNIFE_JAWBONE, WEAPON_MELEE_LANTERN WEAPON_MELEE_TORCH, WEAPON_MOONSHINEJUG_MP, WEAPON_RIFLE_BOLTACTION, WEAPON_SHOTGUN_PUMP, WEAPON_THROWN_BOLAS, WEAPON_THROWN_MOLOTOV
213
+ *
214
+ * @param weapon
215
+ * @returns
303
216
  */
304
- removeWeaponFromPed(weaponHash: eWeaponHash, p2: boolean, removeReason: eRemoveItemReason): void {
305
- inv<void>('0x4899CB088EDF59B8', this.ped.handle, weaponHash, p2, removeReason);
217
+ isPedHoldingWeapon(weapon: string | number): boolean {
218
+ return !!inv<boolean>('0x07E1C35F0078C3F9', this.ped.handle, _h(weapon), rai());
306
219
  }
307
220
 
308
221
  /**
309
- * @param visible
222
+ * _GET_D* - _GET_L*
223
+ *
224
+ * @returns
310
225
  */
311
- setPedAllWeaponsVisibility(visible: boolean): void {
312
- inv<void>('0x4F806A6CFED89468', this.ped.handle, visible);
226
+ N_0x0DE0944ECCB3DF5D(): boolean {
227
+ return !!inv<boolean>('0x0DE0944ECCB3DF5D', this.ped.handle, rai());
313
228
  }
314
229
 
315
230
  /**
316
- * @param weaponHash Refer to [enum: eWeaponHash]
317
- * @param ammo
231
+ * @param flags
318
232
  * @returns
319
233
  */
320
- setAmmoInClip(weaponHash: eWeaponHash, ammo: number): boolean {
321
- return inv<boolean>('0xDCD2A934D65CB497', this.ped.handle, weaponHash, ammo, rai());
234
+ isPedArmed(flags: number): boolean {
235
+ return !!inv<boolean>('0xCB690F680A3EA971', this.ped.handle, flags, rai());
322
236
  }
323
237
 
324
238
  /**
325
- * _GET_M* - _GET_PED_A*
239
+ * Returns whether the ped has a sniper p1: 0 or 1
326
240
  *
327
241
  * @param p1
328
242
  * @returns
329
243
  */
330
- getPedWeaponObject(p1: boolean): Prop | null {
331
- return createFromHandle<Prop>('Prop', inv<number>('0x6CA484C9A7377E4F', this.ped.handle, p1, rai()));
244
+ doesPedHaveSniper(p1: number): any {
245
+ return inv<number>('0x80BB243789008A82', this.ped.handle, p1);
332
246
  }
333
247
 
334
248
  /**
335
- * slotHash is usually just the weaponHash name, but WEAPON_* is replaced with SLOT_*
249
+ * Returns the ped's default unarmed weapon hash as defined in CPedModelInfo (DefaultUnarmedWeapon).
250
+ * Falls back to WEAPON_UNARMED if the ped doesn't have a valid model info pointer, or 0 if the ped doesn't exist.
336
251
  *
337
- * @param slotHash
338
252
  * @returns
339
253
  */
340
- getPedWeaponInSlot(slotHash: string | number): number {
341
- return (inv<number>('0xDBC4B552B2AE9A83', this.ped.handle, _h(slotHash), rai())) & 0xFFFFFFFF;
342
- }
343
-
344
- /**
345
- * Outputs cached guids
346
- *
347
- * @returns guidPrimary; guidSecondary
348
- */
349
- getPlayerPedQuickSwapWeaponByGuid(): [number, number] {
350
- const result = inv<[number, number]>('0xB7E52A058B07C7E2', this.ped.handle, pvi(), pvi());
351
- return [result[0], result[1]];
254
+ get DefaultUnarmedWeaponHash(): number {
255
+ return (inv<number>('0x08FF1099ED2E6E21', this.ped.handle, rai())) & 0xFFFFFFFF;
352
256
  }
353
257
 
354
258
  /**
355
- * Returns true if the ped is currently holstering or unholstering a weapon
356
- *
259
+ * @param weaponHash Refer to [enum: eWeaponHash]
260
+ * @param p2
357
261
  * @returns
358
262
  */
359
- isWeaponHolsterStateChanging(): boolean {
360
- return inv<boolean>('0x2387D6E9C6B478AA', this.ped.handle, rai());
263
+ getMaxAmmoInClip(weaponHash: eWeaponHash, p2: boolean): number {
264
+ return inv<number>('0xA38DCFFCEA8962FA', this.ped.handle, weaponHash, p2, rai());
361
265
  }
362
266
 
363
267
  /**
364
- * @param ammoHash Refer to [enum: eAmmoType]
365
- * @returns
268
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
269
+ * @returns Returns the weapon entity
366
270
  */
367
- N_0x44C8F4908F1B2622(ammoHash: eAmmoType): boolean {
368
- return inv<boolean>('0x44C8F4908F1B2622', this.ped.handle, ammoHash, rai());
271
+ getCurrentPedWeaponEntityIndex(attachPoint: number): Entity | null {
272
+ return createFromHandle<Entity>('Entity', inv<number>('0x3B390A939AF0B5FC', this.ped.handle, attachPoint, rai()));
369
273
  }
370
274
 
371
275
  /**
372
- * @param p2
373
- * @returns clipInventoryUid
276
+ * @param weaponHash Refer to [enum: eWeaponHash]
277
+ * @param ammoHash Refer to [enum: eAmmoType]
374
278
  */
375
- refillAmmoInClip(p2: number): [any, number] {
376
- const result = inv<[number, number]>('0xDF4A3404D022ADDE', this.ped.handle, pvi(), p2);
377
- return [result[0], result[1]];
279
+ enableAmmoTypeForPedWeapon(weaponHash: eWeaponHash, ammoHash: eAmmoType): void {
280
+ inv<void>('0x23FB9FACA28779C1', this.ped.handle, weaponHash, ammoHash);
378
281
  }
379
282
 
380
283
  /**
381
- * _SET_A* - _SET_B*
382
- *
383
- * @param p1
284
+ * @param toggle
384
285
  */
385
- N_0x2EBF70E1D8C06683(p1: string | number): void {
386
- inv<void>('0x2EBF70E1D8C06683', this.ped.handle, _h(p1));
286
+ N_0x431240A58484D5D0(toggle: boolean): void {
287
+ inv<void>('0x431240A58484D5D0', this.ped.handle, toggle);
387
288
  }
388
289
 
389
290
  /**
390
- * @param ammoHash Refer to [enum: eAmmoType]
291
+ * @param p2
292
+ * @param p3
293
+ * @returns outGUID
391
294
  */
392
- disableAmmoTypeForPed(ammoHash: eAmmoType): void {
393
- inv<void>('0xAA5A52204E077883', this.ped.handle, ammoHash);
295
+ getBestPedShortarmGuid(p2: boolean, p3: boolean): number {
296
+ const result = inv<number>('0xF52BD94B47CCF736', this.ped.handle, pvi(), p2, p3);
297
+ return result;
394
298
  }
395
299
 
396
300
  /**
397
- * Returns whether the ped has a shotgun p1: 0 or 1
398
- *
399
- * @param p1
400
- * @returns
301
+ * @returns coords
401
302
  */
402
- doesPedHaveShotgun(p1: number): any {
403
- return inv<number>('0xABC18A28BAD4B46F', this.ped.handle, p1);
404
- }
405
-
406
- clearPedLastWeaponDamage(): void {
407
- inv<void>('0x087D8F4BC65F68E4', this.ped.handle);
303
+ get PedLastWeaponImpactCoord(): [boolean, Vector3] {
304
+ const result = inv<[boolean, number[]]>('0x6C4D0409BA1A2BC2', this.ped.handle, pvv(), rai());
305
+ return [!!result[0], Vector3.fromArray(result[1])];
408
306
  }
409
307
 
410
308
  /**
411
- * Returns true if ped is on a horse while inside of a town
412
- * Params: p1 = 0
413
- * GET_L* - GET_MA*
309
+ * Returns WeaponAttachPoint
414
310
  *
415
- * @param p1
311
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
416
312
  * @returns
417
313
  */
418
- N_0x5A695BD328586B44(p1: number): any {
419
- return inv<number>('0x5A695BD328586B44', this.ped.handle, p1);
420
- }
421
-
422
- /**
423
- * @param weaponHash Refer to [enum: eWeaponHash]
424
- * @param amount
425
- * @param removeReason Refer to [enum: eRemoveItemReason]
426
- */
427
- removeAmmoFromPed(weaponHash: eWeaponHash, amount: number, removeReason: eRemoveItemReason): void {
428
- inv<void>('0xF4823C813CB8277D', this.ped.handle, weaponHash, amount, removeReason);
314
+ getWeaponAttachPoint(attachPoint: number): number {
315
+ return inv<number>('0xCAD4FE9398820D24', this.ped.handle, attachPoint, rai());
429
316
  }
430
317
 
431
318
  /**
432
- * @param p1
433
319
  * @param p2
320
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
321
+ * @param p4
322
+ * @returns weaponHash: Refer to [enum: eWeaponHash]
434
323
  */
435
- setPedAmmoToDrop(p1: number, p2: number): void {
436
- inv<void>('0xA4EFEF9440A5B0EF', this.ped.handle, p1, p2);
324
+ getCurrentPedWeapon(p2: boolean, attachPoint: number, p4: boolean): [boolean, number] {
325
+ const result = inv<[boolean, number]>('0x3A87E44BB9A01D54', this.ped.handle, pvi(), p2, attachPoint, p4, rai());
326
+ return [!!result[0], result[1]];
437
327
  }
438
328
 
439
329
  /**
440
- * Returns the current ammo type of the specified ped's specified weapon.
330
+ * Returns whether the ped has a revolver p1: 0 or 1
441
331
  *
442
- * @param weaponHash Refer to [enum: eWeaponHash]
332
+ * @param p1
443
333
  * @returns
444
334
  */
445
- getPedAmmoTypeFromWeapon(weaponHash: eWeaponHash): number {
446
- return (inv<number>('0x7FEAD38B326B9F74', this.ped.handle, weaponHash, rai())) & 0xFFFFFFFF;
335
+ doesPedHaveRevolver(p1: number): any {
336
+ return inv<number>('0x5B235F24472F2C3B', this.ped.handle, p1);
447
337
  }
448
338
 
449
339
  /**
450
- * @param weaponHash Refer to [enum: eWeaponHash]
451
- * @returns ammo
452
- */
453
- getMaxAmmo(weaponHash: eWeaponHash): [boolean, number] {
454
- const result = inv<[boolean, number]>('0xDC16122C7A20C933', this.ped.handle, pvi(), weaponHash, rai());
455
- return [!!result[0], result[1]];
340
+ * Returns emote Hash
341
+ *
342
+ * @returns
343
+ */
344
+ get PedGunSpinningEquippedKitEmoteTwirl(): number {
345
+ return (inv<number>('0x2C4FEC3D0EFA9FC0', this.ped.handle, rai())) & 0xFFFFFFFF;
456
346
  }
457
347
 
458
348
  /**
@@ -475,14 +365,14 @@ export class Weapon {
475
365
  /**
476
366
  * @returns
477
367
  */
478
- isPedCurrentWeaponHolstered(): any {
368
+ get IsPedCurrentWeaponHolstered(): any {
479
369
  return inv<number>('0xBDD9C235D8D1052E', this.ped.handle);
480
370
  }
481
371
 
482
372
  /**
483
373
  * @param toggle
484
374
  */
485
- setInstantlyEquipWeaponPickups(toggle: boolean): void {
375
+ set InstantlyEquipWeaponPickups(toggle: boolean) {
486
376
  inv<void>('0x739B9C6D0E7F7F93', this.ped.handle, toggle);
487
377
  }
488
378
 
@@ -506,7 +396,7 @@ export class Weapon {
506
396
  /**
507
397
  * @returns Returns the total ammo in the ped weapon from it's guid, or `0`.; guid
508
398
  */
509
- getAmmoInPedWeaponFromGuid(): [number, number] {
399
+ get AmmoInPedWeaponFromGuid(): [number, number] {
510
400
  const result = inv<[number, number]>('0x4823F13A21F51964', this.ped.handle, pvi(), rai());
511
401
  return [result[0], result[1]];
512
402
  }
@@ -519,68 +409,6 @@ export class Weapon {
519
409
  inv<void>('0xF25DF915FA38C5F3', this.ped.handle, p1, p2);
520
410
  }
521
411
 
522
- /**
523
- * Returns ammoHash from weaponObject (Returned by 0x6CA484C9A7377E4F)
524
- *
525
- * @param weaponObject
526
- * @returns
527
- */
528
- getCurrentPedWeaponAmmoType(weaponObject: Prop): number {
529
- return (inv<number>('0x7E7B19A4355FEE13', this.ped.handle, weaponObject.handle, rai())) & 0xFFFFFFFF;
530
- }
531
-
532
- /**
533
- * @param p1
534
- * @param p2
535
- * @param p3
536
- * @returns
537
- */
538
- getPedWorstWeapon(p1: boolean, p2: boolean, p3: boolean): number {
539
- return (inv<number>('0xDA37A053C1522F5D', this.ped.handle, p1, p2, p3, rai())) & 0xFFFFFFFF;
540
- }
541
-
542
- /**
543
- * @param toggle
544
- */
545
- setPedDropsWeaponsWhenDead(toggle: boolean): void {
546
- inv<void>('0x476AE72C1D19D1A8', this.ped.handle, toggle);
547
- }
548
-
549
- /**
550
- * Returns ammoHash
551
- *
552
- * @returns Returns the [enum: eAmmoType]; weaponGuid
553
- */
554
- getCurrentAmmoTypeFromGuid(): [number, number] {
555
- const result = inv<[number, number]>('0xAF9D167A5656D6A6', this.ped.handle, pvi(), rai());
556
- return [result[0] & 0xFFFFFFFF, result[1]];
557
- }
558
-
559
- /**
560
- * @param toggle
561
- */
562
- setPedInfiniteAmmoClip(toggle: boolean): void {
563
- inv<void>('0xFBAA1E06B6BCA741', this.ped.handle, toggle);
564
- }
565
-
566
- /**
567
- * returns the amount of peds that were restrained with the weapon thrown bolas
568
- *
569
- * @returns
570
- */
571
- getNumPedsRestrainedFromWeaponBolas(): any {
572
- return inv<number>('0x46D42883E873C1D7', this.ped.handle);
573
- }
574
-
575
- /**
576
- * emote hashes: KIT_EMOTE_TWIRL_GUN, KIT_EMOTE_TWIRL_GUN_LEFT_HOLSTER, KIT_EMOTE_TWIRL_GUN_DUAL, 0 (to unequip)
577
- *
578
- * @param emote
579
- */
580
- setActiveGunSpinningEquipKitEmoteTwirl(emote: string | number): void {
581
- inv<void>('0xCBCFFF805F1B4596', this.ped.handle, _h(emote));
582
- }
583
-
584
412
  /**
585
413
  * Stores longarms to your horse on dismount
586
414
  * Params: p2 = 0
@@ -661,7 +489,7 @@ export class Weapon {
661
489
  * @returns
662
490
  */
663
491
  isTargetPedConstrainedByPedUsingBolas(targetPed: Ped): boolean {
664
- return inv<boolean>('0x8D50F43298AB9545', this.ped.handle, targetPed.handle, rai());
492
+ return !!inv<boolean>('0x8D50F43298AB9545', this.ped.handle, targetPed.handle, rai());
665
493
  }
666
494
 
667
495
  /**
@@ -673,6 +501,148 @@ export class Weapon {
673
501
  return [result[0], result[1]];
674
502
  }
675
503
 
504
+ /**
505
+ * @param toggle
506
+ */
507
+ set AllowAnyWeaponDrop(toggle: boolean) {
508
+ inv<void>('0x78030C7867D8B9B6', this.ped.handle, toggle);
509
+ }
510
+
511
+ /**
512
+ * @returns
513
+ */
514
+ makePedReload(): any {
515
+ return inv<number>('0x79E1E511FF7EFB13', this.ped.handle);
516
+ }
517
+
518
+ /**
519
+ * @param weaponHash Refer to [enum: eWeaponHash]
520
+ * @param ammoCount
521
+ * @param p3
522
+ * @param addReason Refer to [enum: eAddItemReason]
523
+ */
524
+ giveDelayedWeaponToPed(weaponHash: eWeaponHash, ammoCount: number, p3: boolean, addReason: eAddItemReason): void {
525
+ inv<void>('0xB282DC6EBD803C75', this.ped.handle, weaponHash, ammoCount, p3, addReason);
526
+ }
527
+
528
+ /**
529
+ * @param toggle
530
+ */
531
+ N_0x45E57FDD531C9477(toggle: boolean): void {
532
+ inv<void>('0x45E57FDD531C9477', this.ped.handle, toggle);
533
+ }
534
+
535
+ /**
536
+ * @param ammoHash Refer to [enum: eAmmoType]
537
+ * @returns weaponInventoryUid
538
+ */
539
+ setAmmoTypeForPedWeaponInventory(ammoHash: eAmmoType): number {
540
+ const result = inv<number>('0xEBE46B501BC3FBCF', this.ped.handle, pvi(), ammoHash);
541
+ return result;
542
+ }
543
+
544
+ /**
545
+ * @param weaponHash Refer to [enum: eWeaponHash]
546
+ * @param p2
547
+ * @param removeReason Refer to [enum: eRemoveItemReason]
548
+ */
549
+ removeWeaponFromPed(weaponHash: eWeaponHash, p2: boolean, removeReason: eRemoveItemReason): void {
550
+ inv<void>('0x4899CB088EDF59B8', this.ped.handle, weaponHash, p2, removeReason);
551
+ }
552
+
553
+ /**
554
+ * @returns
555
+ */
556
+ get IsPedWeaponReadyToShoot(): boolean {
557
+ return !!inv<boolean>('0xB80CA294F2F26749', this.ped.handle, rai());
558
+ }
559
+
560
+ /**
561
+ * @param componentHash
562
+ * @param weaponHash Refer to [enum: eWeaponHash]
563
+ */
564
+ removeWeaponComponentFromPed(componentHash: string | number, weaponHash: eWeaponHash): void {
565
+ inv<void>('0x19F70C4D80494FF8', this.ped.handle, _h(componentHash), weaponHash);
566
+ }
567
+
568
+ /**
569
+ * @param visible
570
+ * @param deselectWeapon
571
+ * @param p3
572
+ * @param p4
573
+ */
574
+ setPedCurrentWeaponVisible(visible: boolean, deselectWeapon: boolean, p3: boolean, p4: boolean): void {
575
+ inv<void>('0x0725A4CCFDED9A70', this.ped.handle, visible, deselectWeapon, p3, p4);
576
+ }
577
+
578
+ /**
579
+ * Old name: _DROP_CURRENT_PED_WEAPON
580
+ *
581
+ * @param p1
582
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
583
+ * @param p3
584
+ * @param p4
585
+ * @returns
586
+ */
587
+ makePedDropWeapon(p1: boolean, attachPoint: number, p3: boolean, p4: boolean): Entity | null {
588
+ return createFromHandle<Entity>('Entity', inv<number>('0xCEF4C65DE502D367', this.ped.handle, p1, attachPoint, p3, p4, rai()));
589
+ }
590
+
591
+ removeAllPedAmmo(): void {
592
+ inv<void>('0x1B83C0DEEBCBB214', this.ped.handle);
593
+ }
594
+
595
+ /**
596
+ * @param allow
597
+ */
598
+ set AllowDualWield(allow: boolean) {
599
+ inv<void>('0x83B8D50EB9446BBA', this.ped.handle, allow);
600
+ }
601
+
602
+ /**
603
+ * Returns weaponEmoteVariation WEAPON_EMOTE_VARIATION_INVALID = -2,
604
+ * WEAPON_EMOTE_VARIATION_BASE,
605
+ * WEAPON_EMOTE_VARIATION_A,
606
+ * WEAPON_EMOTE_VARIATION_B,
607
+ * WEAPON_EMOTE_VARIATION_C,
608
+ * WEAPON_EMOTE_VARIATION_D,
609
+ * WEAPON_EMOTE_VARIATION_PREVIEW,
610
+ * WEAPON_EMOTE_NUM_VARIATIONS
611
+ *
612
+ * @param variation
613
+ * @returns
614
+ */
615
+ getWeaponEmoteVariation(variation: number): number {
616
+ return inv<number>('0x86147D05FA831D3A', this.ped.handle, variation, rai());
617
+ }
618
+
619
+ /**
620
+ * @param weaponHash Refer to [enum: eWeaponHash]
621
+ * @returns
622
+ */
623
+ isPedCarryingWeapon(weaponHash: eWeaponHash): boolean {
624
+ return !!inv<boolean>('0xF29A186ED428B552', this.ped.handle, weaponHash, rai());
625
+ }
626
+
627
+ /**
628
+ * @returns
629
+ */
630
+ refillAmmoInCurrentPedWeapon(): any {
631
+ return inv<number>('0x0A2AB7B7ABC055F4', this.ped.handle);
632
+ }
633
+
634
+ /**
635
+ * Unequip current weapon and set current weapon to WEAPON_UNARMED.
636
+ * p0 usually 2 in R* scripts. Doesn't seem to have any effect if changed....
637
+ * immediately: if true it will instantly switch to unarmed
638
+ *
639
+ * @param p0
640
+ * @param immediately
641
+ */
642
+ hidePedWeapons(p0: number, immediately: boolean): void {
643
+ inv<void>('0xFCCC886EDE3C63EC', this.ped.handle, p0, immediately);
644
+ }
645
+
676
646
  /**
677
647
  * @param toggle
678
648
  */
@@ -683,7 +653,7 @@ export class Weapon {
683
653
  /**
684
654
  * @returns ammo; inventoryUid
685
655
  */
686
- getAmmoInClipByInventoryUid(): [any, number, number] {
656
+ get AmmoInClipByInventoryUid(): [any, number, number] {
687
657
  const result = inv<[number, number, number]>('0x678F00858980F516', this.ped.handle, pvi(), pvi());
688
658
  return [result[0], result[1], result[2]];
689
659
  }
@@ -704,7 +674,7 @@ export class Weapon {
704
674
  *
705
675
  * @param disableAnim
706
676
  */
707
- setPedWeaponOnBack(disableAnim: boolean): void {
677
+ set PedWeaponOnBack(disableAnim: boolean) {
708
678
  inv<void>('0x4820A6939D7CEF28', this.ped.handle, disableAnim);
709
679
  }
710
680
 
@@ -727,279 +697,228 @@ export class Weapon {
727
697
  /**
728
698
  * @param attachPoint Refer to [enum: eWeaponAttachPoint]
729
699
  */
730
- setForceCurrentWeaponIntoCockedState(attachPoint: number): void {
700
+ set ForceCurrentWeaponIntoCockedState(attachPoint: number) {
731
701
  inv<void>('0x5230D3F6EE56CFE6', this.ped.handle, attachPoint);
732
702
  }
733
703
 
734
704
  /**
735
- * @returns
736
- */
737
- enableWeaponRestore(): any {
738
- return inv<number>('0xC395355843BE134B', this.ped.handle);
739
- }
740
-
741
- /**
742
- * Returns whether the specified ped is holding a weapon with the given hash.
743
- * only these weapons below return true
744
- * WEAPON_BOW, WEAPON_KIT_METAL_DETECTOR, WEAPON_MELEE_CLEAVER, WEAPON_MELEE_DAVY_LANTERN, WEAPON_MELEE_HATCHET, WEAPON_MELEE_HATCHET_HUNTER, WEAPON_MELEE_KNIFE_JAWBONE, WEAPON_MELEE_LANTERN WEAPON_MELEE_TORCH, WEAPON_MOONSHINEJUG_MP, WEAPON_RIFLE_BOLTACTION, WEAPON_SHOTGUN_PUMP, WEAPON_THROWN_BOLAS, WEAPON_THROWN_MOLOTOV
745
- *
746
- * @param weapon
747
- * @returns
748
- */
749
- isPedHoldingWeapon(weapon: string | number): boolean {
750
- return inv<boolean>('0x07E1C35F0078C3F9', this.ped.handle, _h(weapon), rai());
751
- }
752
-
753
- /**
754
- * _GET_D* - _GET_L*
755
- *
756
- * @returns
705
+ * @param weaponHash Refer to [enum: eWeaponHash]
706
+ * @returns ammo
757
707
  */
758
- N_0x0DE0944ECCB3DF5D(): boolean {
759
- return inv<boolean>('0x0DE0944ECCB3DF5D', this.ped.handle, rai());
708
+ getAmmoInClip(weaponHash: eWeaponHash): [boolean, number] {
709
+ const result = inv<[boolean, number]>('0x2E1202248937775C', this.ped.handle, pvi(), weaponHash, rai());
710
+ return [!!result[0], result[1]];
760
711
  }
761
712
 
762
713
  /**
763
- * @param flags
764
- * @returns
714
+ * @param toggle
765
715
  */
766
- isPedArmed(flags: number): any {
767
- return inv<number>('0xCB690F680A3EA971', this.ped.handle, flags);
716
+ N_0x16D9841A85FA627E(toggle: boolean): void {
717
+ inv<void>('0x16D9841A85FA627E', this.ped.handle, toggle);
768
718
  }
769
719
 
770
720
  /**
771
- * Returns whether the ped has a sniper p1: 0 or 1
772
- *
773
- * @param p1
774
- * @returns
721
+ * @param weaponHash Refer to [enum: eWeaponHash]
722
+ * @param offset
723
+ * @param ammoCount
775
724
  */
776
- doesPedHaveSniper(p1: number): any {
777
- return inv<number>('0x80BB243789008A82', this.ped.handle, p1);
725
+ setPedDropsInventoryWeapon(weaponHash: eWeaponHash, offset: Vector3, ammoCount: number): void {
726
+ inv<void>('0x208A1888007FC0E6', this.ped.handle, weaponHash, f(offset.x), f(offset.y), f(offset.z), ammoCount);
778
727
  }
779
728
 
780
729
  /**
781
- * Returns the ped's default unarmed weapon hash as defined in CPedModelInfo (DefaultUnarmedWeapon).
782
- * Falls back to WEAPON_UNARMED if the ped doesn't have a valid model info pointer, or 0 if the ped doesn't exist.
730
+ * spinHash can be -1, 0 to disable
783
731
  *
784
- * @returns
785
- */
786
- getDefaultUnarmedWeaponHash(): number {
787
- return (inv<number>('0x08FF1099ED2E6E21', this.ped.handle, rai())) & 0xFFFFFFFF;
788
- }
789
-
790
- /**
791
- * @param weaponHash Refer to [enum: eWeaponHash]
792
- * @param p2
793
- * @returns
732
+ * @param weaponEmoteTrickType
733
+ * @param spin
794
734
  */
795
- getMaxAmmoInClip(weaponHash: eWeaponHash, p2: boolean): number {
796
- return inv<number>('0xA38DCFFCEA8962FA', this.ped.handle, weaponHash, p2, rai());
735
+ setActiveGunSpinningKitEmoteTwirl(weaponEmoteTrickType: number, spin: string | number): void {
736
+ inv<void>('0x01F661BB9C71B465', this.ped.handle, weaponEmoteTrickType, _h(spin));
797
737
  }
798
738
 
799
739
  /**
800
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
801
- * @returns Returns the weapon entity
740
+ * Appears to just send specified weapon to your horse holster without having to be close
741
+ * However, the weapon is not visible on the horse holster, but you can reach the weapon on the weapon wheel
742
+ *
743
+ * @param weaponHash Refer to [enum: eWeaponHash]
802
744
  */
803
- getCurrentPedWeaponEntityIndex(attachPoint: number): Entity | null {
804
- return createFromHandle<Entity>('Entity', inv<number>('0x3B390A939AF0B5FC', this.ped.handle, attachPoint, rai()));
745
+ sendWeaponToInventory(weaponHash: eWeaponHash): void {
746
+ inv<void>('0xE9BD19F8121ADE3E', this.ped.handle, weaponHash);
805
747
  }
806
748
 
807
749
  /**
808
- * @param ammoType
750
+ * If near your horse when called, weapons stored on your horse will be considered
751
+ * Returns weaponHash
752
+ *
753
+ * @param weaponGroup
754
+ * @param p2
755
+ * @param p3
809
756
  * @returns
810
757
  */
811
- getPedAmmoByType(ammoType: string | number): number {
812
- return inv<number>('0x39D22031557946C1', this.ped.handle, _h(ammoType), rai());
758
+ getBestPedWeaponInGroup(weaponGroup: string | number, p2: boolean, p3: boolean): number {
759
+ return (inv<number>('0x9F67929D98E7C6E8', this.ped.handle, _h(weaponGroup), p2, p3, rai())) & 0xFFFFFFFF;
813
760
  }
814
761
 
815
762
  /**
763
+ * Only used in R* SP Scripts native_son2, native_son3 and smuggler2
764
+ * Params: p2 = -1
765
+ *
816
766
  * @param p1
817
767
  * @param p2
818
- * @returns
819
768
  */
820
- getBestPedWeapon(p1: boolean, p2: boolean): number {
821
- return (inv<number>('0x8483E98E8B888AE2', this.ped.handle, p1, p2, rai())) & 0xFFFFFFFF;
769
+ N_0x8A779706DA5CA3DD(p1: boolean, p2: number): void {
770
+ inv<void>('0x8A779706DA5CA3DD', this.ped.handle, p1, p2);
822
771
  }
823
772
 
824
773
  /**
825
- * @param toggle
826
774
  * @param weaponHash Refer to [enum: eWeaponHash]
775
+ * @param ammoHash Refer to [enum: eAmmoType]
827
776
  */
828
- setPedInfiniteAmmo(toggle: boolean, weaponHash: eWeaponHash): void {
829
- inv<void>('0x3EDCB0505123623B', this.ped.handle, toggle, weaponHash);
777
+ disableAmmoTypeForPedWeapon(weaponHash: eWeaponHash, ammoHash: eAmmoType): void {
778
+ inv<void>('0xF0D728EEA3C99775', this.ped.handle, weaponHash, ammoHash);
830
779
  }
831
780
 
832
781
  /**
833
- * @param weaponHash Refer to [enum: eWeaponHash]
834
- * @param ammoHash Refer to [enum: eAmmoType]
782
+ * @returns data; outData
835
783
  */
836
- setAmmoTypeForPedWeapon(weaponHash: eWeaponHash, ammoHash: eAmmoType): void {
837
- inv<void>('0xCC9C4393523833E2', this.ped.handle, weaponHash, ammoHash);
784
+ giveWeaponToPedWithOptions(): [boolean, number, number] {
785
+ const result = inv<[boolean, number, number]>('0xBE7E42B07FD317AC', this.ped.handle, pvi(), pvi(), rai());
786
+ return [!!result[0], result[1], result[2]];
838
787
  }
839
788
 
840
789
  /**
841
- * *GET_BEST** - *GET_CLOSEST**
842
- *
843
- * @returns weaponGuid
790
+ * @returns
844
791
  */
845
- getCorrectKitEmoteTwirlGun(): [boolean, number] {
846
- const result = inv<[boolean, number]>('0xCD356B42C57BFE01', this.ped.handle, pvi(), rai());
847
- return [!!result[0], result[1]];
792
+ get MaxLockonDistanceOfCurrentPedWeapon(): number {
793
+ return inv<number>('0x79B1A6E780266DB0', this.ped.handle, raf());
848
794
  }
849
795
 
850
796
  /**
851
- * @param weaponHash Refer to [enum: eWeaponHash]
852
- * @returns
797
+ * @param ammoHash Refer to [enum: eAmmoType]
853
798
  */
854
- setCurrentPedVehicleWeapon(weaponHash: eWeaponHash): boolean {
855
- return inv<boolean>('0x75C55983C2C39DAA', this.ped.handle, weaponHash, rai());
799
+ disableAmmoTypeForPed(ammoHash: eAmmoType): void {
800
+ inv<void>('0xAA5A52204E077883', this.ped.handle, ammoHash);
856
801
  }
857
802
 
858
803
  /**
859
- * Returns whether the ped has a rifle p1: 0 or 1
804
+ * Returns whether the ped has a shotgun p1: 0 or 1
860
805
  *
861
806
  * @param p1
862
807
  * @returns
863
808
  */
864
- doesPedHaveRifle(p1: number): any {
865
- return inv<number>('0x95CA12E2C68043E5', this.ped.handle, p1);
809
+ doesPedHaveShotgun(p1: number): any {
810
+ return inv<number>('0xABC18A28BAD4B46F', this.ped.handle, p1);
866
811
  }
867
812
 
868
- /**
869
- * Puts the gun visibly in your horse's holster without having to be close to the horse. Use `_SEND_WEAPON_TO_INVENTORY` before using this native
870
- * _A* or _B*
871
- *
872
- * @param weaponHash Refer to [enum: eWeaponHash]
873
- * @param ped
874
- */
875
- N_0x14FF0C2545527F9B(weaponHash: eWeaponHash, ped: Ped): void {
876
- inv<void>('0x14FF0C2545527F9B', this.ped.handle, weaponHash, ped.handle);
813
+ clearPedLastWeaponDamage(): void {
814
+ inv<void>('0x087D8F4BC65F68E4', this.ped.handle);
877
815
  }
878
816
 
879
817
  /**
880
- * Returns iSpinHash / iVariationSpin
818
+ * Returns true if ped is on a horse while inside of a town
819
+ * Params: p1 = 0
820
+ * GET_L* - GET_MA*
881
821
  *
882
- * @param weaponEmoteVariation
822
+ * @param p1
883
823
  * @returns
884
824
  */
885
- getPedGunSpinningHashFromWeaponEmoteVariation(weaponEmoteVariation: number): number {
886
- return (inv<number>('0xF3B1620B920D1708', this.ped.handle, weaponEmoteVariation, rai())) & 0xFFFFFFFF;
825
+ N_0x5A695BD328586B44(p1: number): any {
826
+ return inv<number>('0x5A695BD328586B44', this.ped.handle, p1);
887
827
  }
888
828
 
889
829
  /**
890
- * Returns whether the ped has a repeater p1: 0 or 1
891
- *
892
- * @param p1
893
- * @returns
830
+ * @param weaponHash Refer to [enum: eWeaponHash]
831
+ * @param amount
832
+ * @param removeReason Refer to [enum: eRemoveItemReason]
894
833
  */
895
- doesPedHaveRepeater(p1: number): any {
896
- return inv<number>('0x495A04CAEC263AF8', this.ped.handle, p1);
834
+ removeAmmoFromPed(weaponHash: eWeaponHash, amount: number, removeReason: eRemoveItemReason): void {
835
+ inv<void>('0xF4823C813CB8277D', this.ped.handle, weaponHash, amount, removeReason);
897
836
  }
898
837
 
899
838
  /**
900
- * @param weaponCollection
839
+ * @param p1
840
+ * @param p2
901
841
  */
902
- giveWeaponCollectionToPed(weaponCollection: string | number): void {
903
- inv<void>('0x899A04AFCC725D04', this.ped.handle, _h(weaponCollection));
842
+ setPedAmmoToDrop(p1: number, p2: number): void {
843
+ inv<void>('0xA4EFEF9440A5B0EF', this.ped.handle, p1, p2);
904
844
  }
905
845
 
906
846
  /**
847
+ * Returns the current ammo type of the specified ped's specified weapon.
848
+ *
849
+ * @param weaponHash Refer to [enum: eWeaponHash]
907
850
  * @returns
908
851
  */
909
- isPedWeaponReadyToShoot(): boolean {
910
- return inv<boolean>('0xB80CA294F2F26749', this.ped.handle, rai());
852
+ getPedAmmoTypeFromWeapon(weaponHash: eWeaponHash): number {
853
+ return (inv<number>('0x7FEAD38B326B9F74', this.ped.handle, weaponHash, rai())) & 0xFFFFFFFF;
911
854
  }
912
855
 
913
856
  /**
914
- * @param componentHash
915
857
  * @param weaponHash Refer to [enum: eWeaponHash]
858
+ * @returns ammo
916
859
  */
917
- removeWeaponComponentFromPed(componentHash: string | number, weaponHash: eWeaponHash): void {
918
- inv<void>('0x19F70C4D80494FF8', this.ped.handle, _h(componentHash), weaponHash);
860
+ getMaxAmmo(weaponHash: eWeaponHash): [boolean, number] {
861
+ const result = inv<[boolean, number]>('0xDC16122C7A20C933', this.ped.handle, pvi(), weaponHash, rai());
862
+ return [!!result[0], result[1]];
919
863
  }
920
864
 
921
865
  /**
922
- * @param visible
923
- * @param deselectWeapon
924
- * @param p3
925
- * @param p4
866
+ * Returns ammoHash from weaponObject (Returned by 0x6CA484C9A7377E4F)
867
+ *
868
+ * @param weaponObject
869
+ * @returns
926
870
  */
927
- setPedCurrentWeaponVisible(visible: boolean, deselectWeapon: boolean, p3: boolean, p4: boolean): void {
928
- inv<void>('0x0725A4CCFDED9A70', this.ped.handle, visible, deselectWeapon, p3, p4);
871
+ getCurrentPedWeaponAmmoType(weaponObject: Prop): number {
872
+ return (inv<number>('0x7E7B19A4355FEE13', this.ped.handle, weaponObject.handle, rai())) & 0xFFFFFFFF;
929
873
  }
930
874
 
931
875
  /**
932
- * Old name: _DROP_CURRENT_PED_WEAPON
933
- *
934
876
  * @param p1
935
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
877
+ * @param p2
936
878
  * @param p3
937
- * @param p4
938
879
  * @returns
939
880
  */
940
- makePedDropWeapon(p1: boolean, attachPoint: number, p3: boolean, p4: boolean): Entity | null {
941
- return createFromHandle<Entity>('Entity', inv<number>('0xCEF4C65DE502D367', this.ped.handle, p1, attachPoint, p3, p4, rai()));
942
- }
943
-
944
- removeAllPedAmmo(): void {
945
- inv<void>('0x1B83C0DEEBCBB214', this.ped.handle);
881
+ getPedWorstWeapon(p1: boolean, p2: boolean, p3: boolean): number {
882
+ return (inv<number>('0xDA37A053C1522F5D', this.ped.handle, p1, p2, p3, rai())) & 0xFFFFFFFF;
946
883
  }
947
884
 
948
885
  /**
949
- * @param allow
886
+ * @param toggle
950
887
  */
951
- setAllowDualWield(allow: boolean): void {
952
- inv<void>('0x83B8D50EB9446BBA', this.ped.handle, allow);
888
+ set PedDropsWeaponsWhenDead(toggle: boolean) {
889
+ inv<void>('0x476AE72C1D19D1A8', this.ped.handle, toggle);
953
890
  }
954
891
 
955
892
  /**
956
- * Returns weaponEmoteVariation WEAPON_EMOTE_VARIATION_INVALID = -2,
957
- * WEAPON_EMOTE_VARIATION_BASE,
958
- * WEAPON_EMOTE_VARIATION_A,
959
- * WEAPON_EMOTE_VARIATION_B,
960
- * WEAPON_EMOTE_VARIATION_C,
961
- * WEAPON_EMOTE_VARIATION_D,
962
- * WEAPON_EMOTE_VARIATION_PREVIEW,
963
- * WEAPON_EMOTE_NUM_VARIATIONS
893
+ * Returns ammoHash
964
894
  *
965
- * @param variation
966
- * @returns
967
- */
968
- getWeaponEmoteVariation(variation: number): number {
969
- return inv<number>('0x86147D05FA831D3A', this.ped.handle, variation, rai());
970
- }
971
-
972
- /**
973
- * @param weaponHash Refer to [enum: eWeaponHash]
974
- * @returns
895
+ * @returns Returns the [enum: eAmmoType]; weaponGuid
975
896
  */
976
- isPedCarryingWeapon(weaponHash: eWeaponHash): any {
977
- return inv<number>('0xF29A186ED428B552', this.ped.handle, weaponHash);
897
+ get CurrentAmmoTypeFromGuid(): [number, number] {
898
+ const result = inv<[number, number]>('0xAF9D167A5656D6A6', this.ped.handle, pvi(), rai());
899
+ return [result[0] & 0xFFFFFFFF, result[1]];
978
900
  }
979
901
 
980
902
  /**
981
- * @returns
903
+ * @param toggle
982
904
  */
983
- refillAmmoInCurrentPedWeapon(): any {
984
- return inv<number>('0x0A2AB7B7ABC055F4', this.ped.handle);
905
+ set PedInfiniteAmmoClip(toggle: boolean) {
906
+ inv<void>('0xFBAA1E06B6BCA741', this.ped.handle, toggle);
985
907
  }
986
908
 
987
909
  /**
988
- * Unequip current weapon and set current weapon to WEAPON_UNARMED.
989
- * p0 usually 2 in R* scripts. Doesn't seem to have any effect if changed....
990
- * immediately: if true it will instantly switch to unarmed
910
+ * returns the amount of peds that were restrained with the weapon thrown bolas
991
911
  *
992
- * @param p0
993
- * @param immediately
912
+ * @returns
994
913
  */
995
- hidePedWeapons(p0: number, immediately: boolean): void {
996
- inv<void>('0xFCCC886EDE3C63EC', this.ped.handle, p0, immediately);
914
+ get NumPedsRestrainedFromWeaponBolas(): any {
915
+ return inv<number>('0x46D42883E873C1D7', this.ped.handle);
997
916
  }
998
917
 
999
918
  /**
1000
919
  * @returns
1001
920
  */
1002
- getPedHogtieWeapon(): number {
921
+ get PedHogtieWeapon(): number {
1003
922
  return (inv<number>('0x90EB1CB189923587', this.ped.handle, rai())) & 0xFFFFFFFF;
1004
923
  }
1005
924
 
@@ -1018,14 +937,14 @@ export class Weapon {
1018
937
  *
1019
938
  * @param emoteType
1020
939
  */
1021
- setGunSpinningInventorySlotIdActivate(emoteType: number): void {
940
+ set GunSpinningInventorySlotIdActivate(emoteType: number) {
1022
941
  inv<void>('0x408CF580C5E96D49', this.ped.handle, emoteType);
1023
942
  }
1024
943
 
1025
944
  /**
1026
945
  * @returns weaponHash: Refer to [enum: eWeaponHash]
1027
946
  */
1028
- getCurrentPedVehicleWeapon(): [boolean, number] {
947
+ get CurrentPedVehicleWeapon(): [boolean, number] {
1029
948
  const result = inv<[boolean, number]>('0x1017582BCD3832DC', this.ped.handle, pvi(), rai());
1030
949
  return [!!result[0], result[1]];
1031
950
  }
@@ -1057,7 +976,88 @@ export class Weapon {
1057
976
  * @returns
1058
977
  */
1059
978
  hasPedGotWeapon(weaponHash: eWeaponHash, p2: number, onlyCheckPlayerInventory: boolean): boolean {
1060
- return inv<boolean>('0x8DECB02F88F428BC', this.ped.handle, weaponHash, p2, onlyCheckPlayerInventory, rai());
979
+ return !!inv<boolean>('0x8DECB02F88F428BC', this.ped.handle, weaponHash, p2, onlyCheckPlayerInventory, rai());
980
+ }
981
+
982
+ /**
983
+ * @returns
984
+ */
985
+ get AllowDualWield(): any {
986
+ return inv<number>('0x918990BD9CE08582', this.ped.handle);
987
+ }
988
+
989
+ /**
990
+ * Returns eCurrentHeldWeapon
991
+ * _GET_R* - _GET_T*
992
+ *
993
+ * @returns
994
+ */
995
+ get PedCurrentHeldWeapon(): number {
996
+ return (inv<number>('0x8425C5F057012DAB', this.ped.handle, rai())) & 0xFFFFFFFF;
997
+ }
998
+
999
+ /**
1000
+ * @param toggle
1001
+ */
1002
+ set ForceAutoEquip(toggle: boolean) {
1003
+ inv<void>('0xBE711B14A159E84F', this.ped.handle, toggle);
1004
+ }
1005
+
1006
+ /**
1007
+ * @param weaponHash Refer to [enum: eWeaponHash]
1008
+ * @param ammo
1009
+ */
1010
+ setPedAmmo(weaponHash: eWeaponHash, ammo: number): void {
1011
+ inv<void>('0x14E56BC5B5DB6A19', this.ped.handle, weaponHash, ammo);
1012
+ }
1013
+
1014
+ /**
1015
+ * Gives the ped the weapon.
1016
+ * List: https://github.com/femga/rdr3_discoveries/blob/master/weapons/weapons.lua Params: p7 is 0.5f, and p8 is 1.0f. p11 and p12 are both 0 in R* Scripts
1017
+ * permanentDegradation: default 0.5, any higher than 0 it will automatically make the weapon worn, you can also adjust the value to change the weapons maximum cleanliness
1018
+ *
1019
+ * @param weaponHash Refer to [enum: eWeaponHash]
1020
+ * @param ammoCount
1021
+ * @param bForceInHand
1022
+ * @param bForceInHolster
1023
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
1024
+ * @param bAllowMultipleCopies
1025
+ * @param p7
1026
+ * @param p8
1027
+ * @param addReason Refer to [enum: eAddItemReason]
1028
+ * @param bIgnoreUnlocks
1029
+ * @param permanentDegradation
1030
+ * @param p12
1031
+ * @returns
1032
+ */
1033
+ giveWeaponToPed(weaponHash: eWeaponHash, ammoCount: number, bForceInHand: boolean, bForceInHolster: boolean, attachPoint: number, bAllowMultipleCopies: boolean, p7: number, p8: number, addReason: eAddItemReason, bIgnoreUnlocks: boolean, permanentDegradation: number, p12: boolean): number {
1034
+ return (inv<number>('0x5E3BDDBCB83F3D84', this.ped.handle, weaponHash, ammoCount, bForceInHand, bForceInHolster, attachPoint, bAllowMultipleCopies, f(p7), f(p8), addReason, bIgnoreUnlocks, f(permanentDegradation), p12, rai())) & 0xFFFFFFFF;
1035
+ }
1036
+
1037
+ /**
1038
+ * @param weaponHash Refer to [enum: eWeaponHash]
1039
+ * @returns
1040
+ */
1041
+ getAmmoInPedWeapon(weaponHash: eWeaponHash): number {
1042
+ return inv<number>('0x015A522136D7F951', this.ped.handle, weaponHash, rai());
1043
+ }
1044
+
1045
+ /**
1046
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
1047
+ * @returns weaponGuid
1048
+ */
1049
+ getPedWeaponGuidAtAttachPoint(attachPoint: number): [any, number] {
1050
+ const result = inv<[number, number]>('0x6929E22158E52265', this.ped.handle, attachPoint, pvi());
1051
+ return [result[0], result[1]];
1052
+ }
1053
+
1054
+ /**
1055
+ * emote hashes: KIT_EMOTE_TWIRL_GUN, KIT_EMOTE_TWIRL_GUN_LEFT_HOLSTER, KIT_EMOTE_TWIRL_GUN_DUAL, 0 (to unequip)
1056
+ *
1057
+ * @param emote
1058
+ */
1059
+ set ActiveGunSpinningEquipKitEmoteTwirl(emote: string | number) {
1060
+ inv<void>('0xCBCFFF805F1B4596', this.ped.handle, _h(emote));
1061
1061
  }
1062
1062
 
1063
1063
  }