@nativewrappers/redm-codegen 0.0.3 → 0.0.4

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 (205) hide show
  1. package/dist/classes/AnimScene.d.ts +82 -82
  2. package/dist/classes/AnimScene.d.ts.map +1 -1
  3. package/dist/classes/AnimScene.js +124 -124
  4. package/dist/classes/BaseModel.d.ts +29 -29
  5. package/dist/classes/BaseModel.d.ts.map +1 -1
  6. package/dist/classes/BaseModel.js +43 -43
  7. package/dist/classes/BaseTask.d.ts +43 -43
  8. package/dist/classes/BaseTask.d.ts.map +1 -1
  9. package/dist/classes/BaseTask.js +53 -53
  10. package/dist/classes/Cam.d.ts +82 -82
  11. package/dist/classes/Cam.d.ts.map +1 -1
  12. package/dist/classes/Cam.js +115 -115
  13. package/dist/classes/Entity.d.ts +250 -250
  14. package/dist/classes/Entity.d.ts.map +1 -1
  15. package/dist/classes/Entity.js +350 -350
  16. package/dist/classes/Interior.d.ts +27 -27
  17. package/dist/classes/Interior.d.ts.map +1 -1
  18. package/dist/classes/Interior.js +42 -42
  19. package/dist/classes/Ped.d.ts +55 -55
  20. package/dist/classes/Ped.d.ts.map +1 -1
  21. package/dist/classes/Ped.js +76 -76
  22. package/dist/classes/PedTask.d.ts +797 -797
  23. package/dist/classes/PedTask.d.ts.map +1 -1
  24. package/dist/classes/PedTask.js +1023 -1023
  25. package/dist/classes/PersChar.d.ts +13 -13
  26. package/dist/classes/PersChar.d.ts.map +1 -1
  27. package/dist/classes/PersChar.js +27 -27
  28. package/dist/classes/Pickup.d.ts +8 -8
  29. package/dist/classes/Pickup.d.ts.map +1 -1
  30. package/dist/classes/Pickup.js +15 -15
  31. package/dist/classes/Player.d.ts +185 -185
  32. package/dist/classes/Player.d.ts.map +1 -1
  33. package/dist/classes/Player.js +251 -251
  34. package/dist/classes/Prop.d.ts +130 -130
  35. package/dist/classes/Prop.d.ts.map +1 -1
  36. package/dist/classes/Prop.js +188 -188
  37. package/dist/classes/PropSet.d.ts +17 -17
  38. package/dist/classes/PropSet.d.ts.map +1 -1
  39. package/dist/classes/PropSet.js +25 -25
  40. package/dist/classes/VehicleTask.d.ts +23 -23
  41. package/dist/classes/VehicleTask.d.ts.map +1 -1
  42. package/dist/classes/VehicleTask.js +30 -30
  43. package/dist/classes/Volume.d.ts +39 -39
  44. package/dist/classes/Volume.d.ts.map +1 -1
  45. package/dist/classes/Volume.js +54 -54
  46. package/dist/classes/Weapon.d.ts +291 -291
  47. package/dist/classes/Weapon.d.ts.map +1 -1
  48. package/dist/classes/Weapon.js +414 -414
  49. package/dist/namespaces/Animscene.d.ts +63 -63
  50. package/dist/namespaces/Animscene.d.ts.map +1 -1
  51. package/dist/namespaces/Animscene.js +83 -83
  52. package/dist/namespaces/Audio.d.ts +464 -464
  53. package/dist/namespaces/Audio.d.ts.map +1 -1
  54. package/dist/namespaces/Audio.js +650 -650
  55. package/dist/namespaces/Bounty.d.ts +57 -57
  56. package/dist/namespaces/Bounty.d.ts.map +1 -1
  57. package/dist/namespaces/Bounty.js +90 -90
  58. package/dist/namespaces/CamStatics.d.ts +426 -426
  59. package/dist/namespaces/CamStatics.d.ts.map +1 -1
  60. package/dist/namespaces/CamStatics.js +609 -609
  61. package/dist/namespaces/Collection.d.ts +81 -81
  62. package/dist/namespaces/Collection.d.ts.map +1 -1
  63. package/dist/namespaces/Collection.js +113 -113
  64. package/dist/namespaces/Compendium.d.ts +38 -38
  65. package/dist/namespaces/Compendium.d.ts.map +1 -1
  66. package/dist/namespaces/Compendium.js +52 -52
  67. package/dist/namespaces/Crashlog.d.ts +10 -10
  68. package/dist/namespaces/Crashlog.d.ts.map +1 -1
  69. package/dist/namespaces/Crashlog.js +14 -14
  70. package/dist/namespaces/Databinding.d.ts +174 -174
  71. package/dist/namespaces/Databinding.d.ts.map +1 -1
  72. package/dist/namespaces/Databinding.js +266 -266
  73. package/dist/namespaces/EntityStatics.d.ts +110 -110
  74. package/dist/namespaces/EntityStatics.d.ts.map +1 -1
  75. package/dist/namespaces/EntityStatics.js +146 -146
  76. package/dist/namespaces/Graphics.d.ts +547 -547
  77. package/dist/namespaces/Graphics.d.ts.map +1 -1
  78. package/dist/namespaces/Graphics.js +731 -731
  79. package/dist/namespaces/Hud.d.ts +395 -395
  80. package/dist/namespaces/Hud.d.ts.map +1 -1
  81. package/dist/namespaces/Hud.js +564 -564
  82. package/dist/namespaces/InteriorStatics.d.ts +40 -40
  83. package/dist/namespaces/InteriorStatics.d.ts.map +1 -1
  84. package/dist/namespaces/InteriorStatics.js +56 -56
  85. package/dist/namespaces/Inventory.d.ts +107 -107
  86. package/dist/namespaces/Inventory.d.ts.map +1 -1
  87. package/dist/namespaces/Inventory.js +149 -149
  88. package/dist/namespaces/Itemdatabase.d.ts +5 -5
  89. package/dist/namespaces/Itemdatabase.d.ts.map +1 -1
  90. package/dist/namespaces/Itemdatabase.js +7 -7
  91. package/dist/namespaces/Map.d.ts +173 -173
  92. package/dist/namespaces/Map.d.ts.map +1 -1
  93. package/dist/namespaces/Map.js +240 -240
  94. package/dist/namespaces/Minigame.d.ts +56 -56
  95. package/dist/namespaces/Minigame.d.ts.map +1 -1
  96. package/dist/namespaces/Minigame.js +80 -80
  97. package/dist/namespaces/Network.d.ts +964 -964
  98. package/dist/namespaces/Network.d.ts.map +1 -1
  99. package/dist/namespaces/Network.js +1333 -1333
  100. package/dist/namespaces/Object.d.ts +240 -240
  101. package/dist/namespaces/Object.d.ts.map +1 -1
  102. package/dist/namespaces/Object.js +337 -337
  103. package/dist/namespaces/Pad.d.ts +95 -95
  104. package/dist/namespaces/Pad.d.ts.map +1 -1
  105. package/dist/namespaces/Pad.js +127 -127
  106. package/dist/namespaces/PedStatics.d.ts +18 -18
  107. package/dist/namespaces/PedStatics.d.ts.map +1 -1
  108. package/dist/namespaces/PedStatics.js +26 -26
  109. package/dist/namespaces/Perschar.d.ts +46 -46
  110. package/dist/namespaces/Perschar.d.ts.map +1 -1
  111. package/dist/namespaces/Perschar.js +66 -66
  112. package/dist/namespaces/Physics.d.ts +207 -207
  113. package/dist/namespaces/Physics.d.ts.map +1 -1
  114. package/dist/namespaces/Physics.js +315 -315
  115. package/dist/namespaces/PlayerStatics.d.ts +68 -68
  116. package/dist/namespaces/PlayerStatics.d.ts.map +1 -1
  117. package/dist/namespaces/PlayerStatics.js +95 -95
  118. package/dist/namespaces/Population.d.ts +86 -86
  119. package/dist/namespaces/Population.d.ts.map +1 -1
  120. package/dist/namespaces/Population.js +116 -116
  121. package/dist/namespaces/Posse.d.ts +43 -43
  122. package/dist/namespaces/Posse.d.ts.map +1 -1
  123. package/dist/namespaces/Posse.js +67 -67
  124. package/dist/namespaces/Propset.d.ts +59 -59
  125. package/dist/namespaces/Propset.d.ts.map +1 -1
  126. package/dist/namespaces/Propset.js +81 -81
  127. package/dist/namespaces/Shapetest.d.ts +11 -11
  128. package/dist/namespaces/Shapetest.d.ts.map +1 -1
  129. package/dist/namespaces/Shapetest.js +13 -13
  130. package/dist/namespaces/Stats.d.ts +90 -90
  131. package/dist/namespaces/Stats.d.ts.map +1 -1
  132. package/dist/namespaces/Stats.js +127 -127
  133. package/dist/namespaces/Streaming.d.ts +127 -127
  134. package/dist/namespaces/Streaming.d.ts.map +1 -1
  135. package/dist/namespaces/Streaming.js +193 -193
  136. package/dist/namespaces/Task.d.ts +346 -346
  137. package/dist/namespaces/Task.d.ts.map +1 -1
  138. package/dist/namespaces/Task.js +525 -525
  139. package/dist/namespaces/Telemetry.d.ts +176 -176
  140. package/dist/namespaces/Telemetry.d.ts.map +1 -1
  141. package/dist/namespaces/Telemetry.js +255 -255
  142. package/dist/namespaces/VolumeStatics.d.ts +64 -64
  143. package/dist/namespaces/VolumeStatics.d.ts.map +1 -1
  144. package/dist/namespaces/VolumeStatics.js +85 -85
  145. package/dist/namespaces/Water.d.ts +27 -27
  146. package/dist/namespaces/Water.d.ts.map +1 -1
  147. package/dist/namespaces/Water.js +41 -41
  148. package/dist/namespaces/WeaponStatics.d.ts +234 -234
  149. package/dist/namespaces/WeaponStatics.d.ts.map +1 -1
  150. package/dist/namespaces/WeaponStatics.js +320 -320
  151. package/dist/namespaces/Zone.d.ts +7 -7
  152. package/dist/namespaces/Zone.d.ts.map +1 -1
  153. package/dist/namespaces/Zone.js +9 -9
  154. package/package.json +1 -1
  155. package/src/classes/AnimScene.ts +133 -133
  156. package/src/classes/BaseModel.ts +50 -50
  157. package/src/classes/BaseTask.ts +55 -55
  158. package/src/classes/Cam.ts +126 -126
  159. package/src/classes/Entity.ts +365 -365
  160. package/src/classes/Interior.ts +43 -43
  161. package/src/classes/Ped.ts +86 -86
  162. package/src/classes/PedTask.ts +2067 -2067
  163. package/src/classes/PersChar.ts +34 -34
  164. package/src/classes/Pickup.ts +16 -16
  165. package/src/classes/Player.ts +296 -296
  166. package/src/classes/Prop.ts +203 -203
  167. package/src/classes/PropSet.ts +29 -29
  168. package/src/classes/VehicleTask.ts +32 -32
  169. package/src/classes/Volume.ts +61 -61
  170. package/src/classes/Weapon.ts +427 -427
  171. package/src/namespaces/Animscene.ts +86 -86
  172. package/src/namespaces/Audio.ts +760 -760
  173. package/src/namespaces/Bounty.ts +102 -102
  174. package/src/namespaces/CamStatics.ts +631 -631
  175. package/src/namespaces/Collection.ts +114 -114
  176. package/src/namespaces/Compendium.ts +59 -59
  177. package/src/namespaces/Crashlog.ts +16 -16
  178. package/src/namespaces/Databinding.ts +282 -282
  179. package/src/namespaces/EntityStatics.ts +158 -158
  180. package/src/namespaces/Graphics.ts +1140 -1140
  181. package/src/namespaces/Hud.ts +592 -592
  182. package/src/namespaces/InteriorStatics.ts +64 -64
  183. package/src/namespaces/Inventory.ts +165 -165
  184. package/src/namespaces/Itemdatabase.ts +8 -8
  185. package/src/namespaces/Map.ts +256 -256
  186. package/src/namespaces/Minigame.ts +92 -92
  187. package/src/namespaces/Network.ts +1392 -1392
  188. package/src/namespaces/Object.ts +350 -350
  189. package/src/namespaces/Pad.ts +127 -127
  190. package/src/namespaces/PedStatics.ts +30 -30
  191. package/src/namespaces/Perschar.ts +76 -76
  192. package/src/namespaces/Physics.ts +327 -327
  193. package/src/namespaces/PlayerStatics.ts +103 -103
  194. package/src/namespaces/Population.ts +131 -131
  195. package/src/namespaces/Posse.ts +67 -67
  196. package/src/namespaces/Propset.ts +92 -92
  197. package/src/namespaces/Shapetest.ts +14 -14
  198. package/src/namespaces/Stats.ts +143 -143
  199. package/src/namespaces/Streaming.ts +226 -226
  200. package/src/namespaces/Task.ts +498 -498
  201. package/src/namespaces/Telemetry.ts +261 -261
  202. package/src/namespaces/VolumeStatics.ts +87 -87
  203. package/src/namespaces/Water.ts +47 -47
  204. package/src/namespaces/WeaponStatics.ts +325 -325
  205. package/src/namespaces/Zone.ts +10 -10
@@ -71,637 +71,669 @@ export class Weapon {
71
71
  return (inv('0x2C4FEC3D0EFA9FC0', this.ped.handle, rai())) & 0xFFFFFFFF;
72
72
  }
73
73
  /**
74
- * @param weaponHash Refer to [enum: eWeaponHash]
75
- * @returns ammo
74
+ * Returns ammoHash from weaponObject (Returned by 0x6CA484C9A7377E4F)
75
+ *
76
+ * @param weaponObject
77
+ * @returns
76
78
  */
77
- getAmmoInClip(weaponHash) {
78
- const result = inv('0x2E1202248937775C', this.ped.handle, pvi(), weaponHash, rai());
79
- return [!!result[0], result[1]];
79
+ getCurrentPedWeaponAmmoType(weaponObject) {
80
+ return (inv('0x7E7B19A4355FEE13', this.ped.handle, weaponObject.handle, rai())) & 0xFFFFFFFF;
80
81
  }
81
82
  /**
82
- * @param toggle
83
+ * @param p1
84
+ * @param p2
85
+ * @param p3
86
+ * @returns
83
87
  */
84
- N_0x16D9841A85FA627E(toggle) {
85
- inv('0x16D9841A85FA627E', this.ped.handle, toggle);
88
+ getPedWorstWeapon(p1, p2, p3) {
89
+ return (inv('0xDA37A053C1522F5D', this.ped.handle, p1, p2, p3, rai())) & 0xFFFFFFFF;
86
90
  }
87
91
  /**
88
- * @param weaponHash Refer to [enum: eWeaponHash]
89
- * @param offset
90
- * @param ammoCount
92
+ * @param toggle
91
93
  */
92
- setPedDropsInventoryWeapon(weaponHash, offset, ammoCount) {
93
- inv('0x208A1888007FC0E6', this.ped.handle, weaponHash, f(offset.x), f(offset.y), f(offset.z), ammoCount);
94
+ setPedDropsWeaponsWhenDead(toggle) {
95
+ inv('0x476AE72C1D19D1A8', this.ped.handle, toggle);
94
96
  }
95
97
  /**
96
- * spinHash can be -1, 0 to disable
98
+ * Returns ammoHash
97
99
  *
98
- * @param weaponEmoteTrickType
99
- * @param spin
100
+ * @returns Returns the [enum: eAmmoType]; weaponGuid
100
101
  */
101
- setActiveGunSpinningKitEmoteTwirl(weaponEmoteTrickType, spin) {
102
- inv('0x01F661BB9C71B465', this.ped.handle, weaponEmoteTrickType, _h(spin));
102
+ getCurrentAmmoTypeFromGuid() {
103
+ const result = inv('0xAF9D167A5656D6A6', this.ped.handle, pvi(), rai());
104
+ return [result[0] & 0xFFFFFFFF, result[1]];
103
105
  }
104
106
  /**
105
- * Appears to just send specified weapon to your horse holster without having to be close
106
- * However, the weapon is not visible on the horse holster, but you can reach the weapon on the weapon wheel
107
- *
108
- * @param weaponHash Refer to [enum: eWeaponHash]
107
+ * @param toggle
109
108
  */
110
- sendWeaponToInventory(weaponHash) {
111
- inv('0xE9BD19F8121ADE3E', this.ped.handle, weaponHash);
109
+ setPedInfiniteAmmoClip(toggle) {
110
+ inv('0xFBAA1E06B6BCA741', this.ped.handle, toggle);
112
111
  }
113
112
  /**
114
- * If near your horse when called, weapons stored on your horse will be considered
115
- * Returns weaponHash
113
+ * returns the amount of peds that were restrained with the weapon thrown bolas
116
114
  *
117
- * @param weaponGroup
118
- * @param p2
119
- * @param p3
120
115
  * @returns
121
116
  */
122
- getBestPedWeaponInGroup(weaponGroup, p2, p3) {
123
- return (inv('0x9F67929D98E7C6E8', this.ped.handle, _h(weaponGroup), p2, p3, rai())) & 0xFFFFFFFF;
117
+ getNumPedsRestrainedFromWeaponBolas() {
118
+ return inv('0x46D42883E873C1D7', this.ped.handle);
124
119
  }
125
120
  /**
126
- * Only used in R* SP Scripts native_son2, native_son3 and smuggler2
127
- * Params: p2 = -1
121
+ * Stores longarms to your horse on dismount
122
+ * Params: p2 = 0
123
+ * SET_[I - M]*
128
124
  *
129
- * @param p1
125
+ * @param storeLongarms
130
126
  * @param p2
131
127
  */
132
- N_0x8A779706DA5CA3DD(p1, p2) {
133
- inv('0x8A779706DA5CA3DD', this.ped.handle, p1, p2);
128
+ setInstantlyStoreLongarmsOnDismount(storeLongarms, p2) {
129
+ inv('0xB832F1A686B9B810', this.ped.handle, storeLongarms, p2);
134
130
  }
135
131
  /**
132
+ * @param removeReason Refer to [enum: eRemoveItemReason]
133
+ * @returns weaponGuid
134
+ */
135
+ removeWeaponFromPedByGuid(removeReason) {
136
+ const result = inv('0x51C3B71591811485', this.ped.handle, pvi(), removeReason);
137
+ return result;
138
+ }
139
+ /**
140
+ * attachPoint:
141
+ *
136
142
  * @param weaponHash Refer to [enum: eWeaponHash]
137
- * @param ammoHash Refer to [enum: eAmmoType]
143
+ * @param equipNow
144
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
145
+ * @param p4
146
+ * @param p5
138
147
  */
139
- disableAmmoTypeForPedWeapon(weaponHash, ammoHash) {
140
- inv('0xF0D728EEA3C99775', this.ped.handle, weaponHash, ammoHash);
148
+ setCurrentPedWeapon(weaponHash, equipNow, attachPoint, p4, p5) {
149
+ inv('0xADF692B254977C0C', this.ped.handle, weaponHash, equipNow, attachPoint, p4, p5);
141
150
  }
142
151
  /**
143
- * @returns data; outData
152
+ * Equips a weapon from a weaponItem, similar to GIVE_WEAPON_TO_PED
153
+ *
154
+ * @param p2
155
+ * @param p3
156
+ * @param p4
157
+ * @param p5
158
+ * @returns weaponUid
144
159
  */
145
- giveWeaponToPedWithOptions() {
146
- const result = inv('0xBE7E42B07FD317AC', this.ped.handle, pvi(), pvi(), rai());
147
- return [!!result[0], result[1], result[2]];
160
+ setCurrentPedWeaponByGuid(p2, p3, p4, p5) {
161
+ const result = inv('0x12FB95FE3D579238', this.ped.handle, pvi(), p2, p3, p4, p5);
162
+ return result;
148
163
  }
149
164
  /**
165
+ * @param componentHash
166
+ * @param weaponHash Refer to [enum: eWeaponHash]
150
167
  * @returns
151
168
  */
152
- getMaxLockonDistanceOfCurrentPedWeapon() {
153
- return inv('0x79B1A6E780266DB0', this.ped.handle, raf());
169
+ hasPedGotWeaponComponent(componentHash, weaponHash) {
170
+ return inv('0xBBC67A6F965C688A', this.ped.handle, _h(componentHash), weaponHash);
154
171
  }
155
172
  /**
156
- * @returns
173
+ * @param weaponHash Refer to [enum: eWeaponHash]
174
+ * @param amount The amount of ped to add to the ammo
175
+ * @param addReason Refer to [enum: eAddItemReason]
157
176
  */
158
- getAllowDualWield() {
159
- return inv('0x918990BD9CE08582', this.ped.handle);
177
+ addAmmoToPed(weaponHash, amount, addReason) {
178
+ inv('0xB190BCA3F4042F95', this.ped.handle, weaponHash, amount, addReason);
160
179
  }
161
180
  /**
162
- * Returns eCurrentHeldWeapon
163
- * _GET_R* - _GET_T*
164
- *
181
+ * @param ammoType
182
+ * @param amount
183
+ * @param addReason Refer to [enum: eAddItemReason]
184
+ */
185
+ addAmmoToPedByType(ammoType, amount, addReason) {
186
+ inv('0x106A811C6D3035F3', this.ped.handle, _h(ammoType), amount, addReason);
187
+ }
188
+ /**
189
+ * @param targetPed
165
190
  * @returns
166
191
  */
167
- getPedCurrentHeldWeapon() {
168
- return (inv('0x8425C5F057012DAB', this.ped.handle, rai())) & 0xFFFFFFFF;
192
+ isTargetPedConstrainedByPedUsingBolas(targetPed) {
193
+ return inv('0x8D50F43298AB9545', this.ped.handle, targetPed.handle, rai());
169
194
  }
170
195
  /**
171
- * @param toggle
196
+ * @param p1
197
+ * @returns guidPrimary
172
198
  */
173
- setForceAutoEquip(toggle) {
174
- inv('0xBE711B14A159E84F', this.ped.handle, toggle);
199
+ getBestPedWeaponInInventory(p1) {
200
+ const result = inv('0x7B98500614C8E8B8', this.ped.handle, p1, pvi());
201
+ return [result[0], result[1]];
175
202
  }
176
203
  /**
177
204
  * @param weaponHash Refer to [enum: eWeaponHash]
178
- * @param ammo
179
205
  */
180
- setPedAmmo(weaponHash, ammo) {
181
- inv('0x14E56BC5B5DB6A19', this.ped.handle, weaponHash, ammo);
206
+ enableAmmoTypeForPed(weaponHash) {
207
+ inv('0x3B7B7908B7ADFB4B', this.ped.handle, weaponHash);
182
208
  }
183
209
  /**
184
- * Gives the ped the weapon.
185
- * 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
186
- * 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
210
+ * Detaches the weapon from the ped and actually removes the ped's weapon
187
211
  *
188
- * @param weaponHash Refer to [enum: eWeaponHash]
189
- * @param ammoCount
190
- * @param bForceInHand
191
- * @param bForceInHolster
192
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
193
- * @param bAllowMultipleCopies
194
- * @param p7
195
- * @param p8
196
- * @param addReason Refer to [enum: eAddItemReason]
197
- * @param bIgnoreUnlocks
198
- * @param permanentDegradation
199
- * @param p12
212
+ * @param p1
200
213
  * @returns
201
214
  */
202
- giveWeaponToPed(weaponHash, ammoCount, bForceInHand, bForceInHolster, attachPoint, bAllowMultipleCopies, p7, p8, addReason, bIgnoreUnlocks, permanentDegradation, p12) {
203
- return (inv('0x5E3BDDBCB83F3D84', this.ped.handle, weaponHash, ammoCount, bForceInHand, bForceInHolster, attachPoint, bAllowMultipleCopies, f(p7), f(p8), addReason, bIgnoreUnlocks, f(permanentDegradation), p12, rai())) & 0xFFFFFFFF;
215
+ getWeaponObjectFromPed(p1) {
216
+ return createFromHandle('Prop', inv('0xC6A6789BB405D11C', this.ped.handle, p1, rai()));
204
217
  }
205
218
  /**
206
- * @param weaponHash Refer to [enum: eWeaponHash]
207
219
  * @returns
208
220
  */
209
- getAmmoInPedWeapon(weaponHash) {
210
- return inv('0x015A522136D7F951', this.ped.handle, weaponHash, rai());
221
+ isPedCurrentWeaponHolstered() {
222
+ return inv('0xBDD9C235D8D1052E', this.ped.handle);
211
223
  }
212
224
  /**
213
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
214
- * @returns weaponGuid
225
+ * @param toggle
215
226
  */
216
- getPedWeaponGuidAtAttachPoint(attachPoint) {
217
- const result = inv('0x6929E22158E52265', this.ped.handle, attachPoint, pvi());
218
- return [result[0], result[1]];
227
+ setInstantlyEquipWeaponPickups(toggle) {
228
+ inv('0x739B9C6D0E7F7F93', this.ped.handle, toggle);
219
229
  }
220
230
  /**
231
+ * Hides the ped's weapon during a cutscene.
232
+ *
221
233
  * @param toggle
222
234
  */
223
- setAllowAnyWeaponDrop(toggle) {
224
- inv('0x78030C7867D8B9B6', this.ped.handle, toggle);
235
+ hidePedWeaponForScriptedCutscene(toggle) {
236
+ inv('0x6F6981D2253C208F', this.ped.handle, toggle);
225
237
  }
226
238
  /**
227
- * @returns
239
+ * @returns guidPrimary; guidSecondary
228
240
  */
229
- makePedReload() {
230
- return inv('0x79E1E511FF7EFB13', this.ped.handle);
241
+ setPlayerPedQuickSwapWeaponByGuid() {
242
+ const result = inv('0xEC1F85DA51D3D6C4', this.ped.handle, pvi(), pvi());
243
+ return [result[0], result[1]];
231
244
  }
232
245
  /**
233
- * @param weaponHash Refer to [enum: eWeaponHash]
234
- * @param ammoCount
235
- * @param p3
236
- * @param addReason Refer to [enum: eAddItemReason]
246
+ * @returns Returns the total ammo in the ped weapon from it's guid, or `0`.; guid
237
247
  */
238
- giveDelayedWeaponToPed(weaponHash, ammoCount, p3, addReason) {
239
- inv('0xB282DC6EBD803C75', this.ped.handle, weaponHash, ammoCount, p3, addReason);
248
+ getAmmoInPedWeaponFromGuid() {
249
+ const result = inv('0x4823F13A21F51964', this.ped.handle, pvi(), rai());
250
+ return [result[0], result[1]];
240
251
  }
241
252
  /**
242
- * @param toggle
253
+ * @param p1
254
+ * @param p2
243
255
  */
244
- N_0x45E57FDD531C9477(toggle) {
245
- inv('0x45E57FDD531C9477', this.ped.handle, toggle);
256
+ removeAllPedWeapons(p1, p2) {
257
+ inv('0xF25DF915FA38C5F3', this.ped.handle, p1, p2);
246
258
  }
247
259
  /**
248
260
  * @param ammoHash Refer to [enum: eAmmoType]
249
- * @returns weaponInventoryUid
250
261
  */
251
- setAmmoTypeForPedWeaponInventory(ammoHash) {
252
- const result = inv('0xEBE46B501BC3FBCF', this.ped.handle, pvi(), ammoHash);
253
- return result;
262
+ disableAmmoTypeForPed(ammoHash) {
263
+ inv('0xAA5A52204E077883', this.ped.handle, ammoHash);
254
264
  }
255
265
  /**
256
- * @param weaponHash Refer to [enum: eWeaponHash]
257
- * @param p2
258
- * @param removeReason Refer to [enum: eRemoveItemReason]
266
+ * Returns whether the ped has a shotgun p1: 0 or 1
267
+ *
268
+ * @param p1
269
+ * @returns
259
270
  */
260
- removeWeaponFromPed(weaponHash, p2, removeReason) {
261
- inv('0x4899CB088EDF59B8', this.ped.handle, weaponHash, p2, removeReason);
271
+ doesPedHaveShotgun(p1) {
272
+ return inv('0xABC18A28BAD4B46F', this.ped.handle, p1);
273
+ }
274
+ clearPedLastWeaponDamage() {
275
+ inv('0x087D8F4BC65F68E4', this.ped.handle);
262
276
  }
263
277
  /**
264
- * @param visible
278
+ * Returns true if ped is on a horse while inside of a town
279
+ * Params: p1 = 0
280
+ * GET_L* - GET_MA*
281
+ *
282
+ * @param p1
283
+ * @returns
265
284
  */
266
- setPedAllWeaponsVisibility(visible) {
267
- inv('0x4F806A6CFED89468', this.ped.handle, visible);
285
+ N_0x5A695BD328586B44(p1) {
286
+ return inv('0x5A695BD328586B44', this.ped.handle, p1);
268
287
  }
269
288
  /**
270
289
  * @param weaponHash Refer to [enum: eWeaponHash]
271
- * @param ammo
272
- * @returns
290
+ * @param amount
291
+ * @param removeReason Refer to [enum: eRemoveItemReason]
273
292
  */
274
- setAmmoInClip(weaponHash, ammo) {
275
- return inv('0xDCD2A934D65CB497', this.ped.handle, weaponHash, ammo, rai());
293
+ removeAmmoFromPed(weaponHash, amount, removeReason) {
294
+ inv('0xF4823C813CB8277D', this.ped.handle, weaponHash, amount, removeReason);
276
295
  }
277
296
  /**
278
- * _GET_M* - _GET_PED_A*
279
- *
280
297
  * @param p1
281
- * @returns
298
+ * @param p2
282
299
  */
283
- getPedWeaponObject(p1) {
284
- return createFromHandle('Prop', inv('0x6CA484C9A7377E4F', this.ped.handle, p1, rai()));
300
+ setPedAmmoToDrop(p1, p2) {
301
+ inv('0xA4EFEF9440A5B0EF', this.ped.handle, p1, p2);
285
302
  }
286
303
  /**
287
- * slotHash is usually just the weaponHash name, but WEAPON_* is replaced with SLOT_*
304
+ * Returns the current ammo type of the specified ped's specified weapon.
288
305
  *
289
- * @param slotHash
306
+ * @param weaponHash Refer to [enum: eWeaponHash]
290
307
  * @returns
291
308
  */
292
- getPedWeaponInSlot(slotHash) {
293
- return (inv('0xDBC4B552B2AE9A83', this.ped.handle, _h(slotHash), rai())) & 0xFFFFFFFF;
309
+ getPedAmmoTypeFromWeapon(weaponHash) {
310
+ return (inv('0x7FEAD38B326B9F74', this.ped.handle, weaponHash, rai())) & 0xFFFFFFFF;
294
311
  }
295
312
  /**
296
- * Outputs cached guids
297
- *
298
- * @returns guidPrimary; guidSecondary
313
+ * @param weaponHash Refer to [enum: eWeaponHash]
314
+ * @returns ammo
299
315
  */
300
- getPlayerPedQuickSwapWeaponByGuid() {
301
- const result = inv('0xB7E52A058B07C7E2', this.ped.handle, pvi(), pvi());
302
- return [result[0], result[1]];
316
+ getMaxAmmo(weaponHash) {
317
+ const result = inv('0xDC16122C7A20C933', this.ped.handle, pvi(), weaponHash, rai());
318
+ return [!!result[0], result[1]];
303
319
  }
304
320
  /**
305
- * Returns true if the ped is currently holstering or unholstering a weapon
321
+ * emote hashes: KIT_EMOTE_TWIRL_GUN, KIT_EMOTE_TWIRL_GUN_LEFT_HOLSTER, KIT_EMOTE_TWIRL_GUN_DUAL, 0 (to unequip)
306
322
  *
307
- * @returns
323
+ * @param emote
308
324
  */
309
- isWeaponHolsterStateChanging() {
310
- return inv('0x2387D6E9C6B478AA', this.ped.handle, rai());
325
+ setActiveGunSpinningEquipKitEmoteTwirl(emote) {
326
+ inv('0xCBCFFF805F1B4596', this.ped.handle, _h(emote));
311
327
  }
312
328
  /**
313
- * @param ammoHash Refer to [enum: eAmmoType]
314
329
  * @returns
315
330
  */
316
- N_0x44C8F4908F1B2622(ammoHash) {
317
- return inv('0x44C8F4908F1B2622', this.ped.handle, ammoHash, rai());
331
+ enableWeaponRestore() {
332
+ return inv('0xC395355843BE134B', this.ped.handle);
318
333
  }
319
334
  /**
320
- * @param p2
321
- * @returns clipInventoryUid
335
+ * Returns whether the specified ped is holding a weapon with the given hash.
336
+ * only these weapons below return true
337
+ * 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
338
+ *
339
+ * @param weapon
340
+ * @returns
322
341
  */
323
- refillAmmoInClip(p2) {
324
- const result = inv('0xDF4A3404D022ADDE', this.ped.handle, pvi(), p2);
325
- return [result[0], result[1]];
342
+ isPedHoldingWeapon(weapon) {
343
+ return inv('0x07E1C35F0078C3F9', this.ped.handle, _h(weapon), rai());
326
344
  }
327
345
  /**
328
- * _SET_A* - _SET_B*
346
+ * _GET_D* - _GET_L*
329
347
  *
330
- * @param p1
348
+ * @returns
331
349
  */
332
- N_0x2EBF70E1D8C06683(p1) {
333
- inv('0x2EBF70E1D8C06683', this.ped.handle, _h(p1));
350
+ N_0x0DE0944ECCB3DF5D() {
351
+ return inv('0x0DE0944ECCB3DF5D', this.ped.handle, rai());
334
352
  }
335
353
  /**
336
- * @param ammoHash Refer to [enum: eAmmoType]
354
+ * @param flags
355
+ * @returns
337
356
  */
338
- disableAmmoTypeForPed(ammoHash) {
339
- inv('0xAA5A52204E077883', this.ped.handle, ammoHash);
357
+ isPedArmed(flags) {
358
+ return inv('0xCB690F680A3EA971', this.ped.handle, flags);
340
359
  }
341
360
  /**
342
- * Returns whether the ped has a shotgun p1: 0 or 1
361
+ * Returns whether the ped has a sniper p1: 0 or 1
343
362
  *
344
363
  * @param p1
345
364
  * @returns
346
365
  */
347
- doesPedHaveShotgun(p1) {
348
- return inv('0xABC18A28BAD4B46F', this.ped.handle, p1);
349
- }
350
- clearPedLastWeaponDamage() {
351
- inv('0x087D8F4BC65F68E4', this.ped.handle);
366
+ doesPedHaveSniper(p1) {
367
+ return inv('0x80BB243789008A82', this.ped.handle, p1);
352
368
  }
353
369
  /**
354
- * Returns true if ped is on a horse while inside of a town
355
- * Params: p1 = 0
356
- * GET_L* - GET_MA*
370
+ * Returns the ped's default unarmed weapon hash as defined in CPedModelInfo (DefaultUnarmedWeapon).
371
+ * Falls back to WEAPON_UNARMED if the ped doesn't have a valid model info pointer, or 0 if the ped doesn't exist.
357
372
  *
358
- * @param p1
359
373
  * @returns
360
374
  */
361
- N_0x5A695BD328586B44(p1) {
362
- return inv('0x5A695BD328586B44', this.ped.handle, p1);
375
+ getDefaultUnarmedWeaponHash() {
376
+ return (inv('0x08FF1099ED2E6E21', this.ped.handle, rai())) & 0xFFFFFFFF;
363
377
  }
364
378
  /**
365
379
  * @param weaponHash Refer to [enum: eWeaponHash]
366
- * @param amount
367
- * @param removeReason Refer to [enum: eRemoveItemReason]
380
+ * @param p2
381
+ * @returns
368
382
  */
369
- removeAmmoFromPed(weaponHash, amount, removeReason) {
370
- inv('0xF4823C813CB8277D', this.ped.handle, weaponHash, amount, removeReason);
383
+ getMaxAmmoInClip(weaponHash, p2) {
384
+ return inv('0xA38DCFFCEA8962FA', this.ped.handle, weaponHash, p2, rai());
371
385
  }
372
386
  /**
373
- * @param p1
374
- * @param p2
387
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
388
+ * @returns Returns the weapon entity
375
389
  */
376
- setPedAmmoToDrop(p1, p2) {
377
- inv('0xA4EFEF9440A5B0EF', this.ped.handle, p1, p2);
390
+ getCurrentPedWeaponEntityIndex(attachPoint) {
391
+ return createFromHandle('Entity', inv('0x3B390A939AF0B5FC', this.ped.handle, attachPoint, rai()));
378
392
  }
379
393
  /**
380
- * Returns the current ammo type of the specified ped's specified weapon.
381
- *
382
- * @param weaponHash Refer to [enum: eWeaponHash]
383
394
  * @returns
384
395
  */
385
- getPedAmmoTypeFromWeapon(weaponHash) {
386
- return (inv('0x7FEAD38B326B9F74', this.ped.handle, weaponHash, rai())) & 0xFFFFFFFF;
396
+ isPedWeaponReadyToShoot() {
397
+ return inv('0xB80CA294F2F26749', this.ped.handle, rai());
387
398
  }
388
399
  /**
400
+ * @param componentHash
389
401
  * @param weaponHash Refer to [enum: eWeaponHash]
390
- * @returns ammo
391
402
  */
392
- getMaxAmmo(weaponHash) {
393
- const result = inv('0xDC16122C7A20C933', this.ped.handle, pvi(), weaponHash, rai());
394
- return [!!result[0], result[1]];
403
+ removeWeaponComponentFromPed(componentHash, weaponHash) {
404
+ inv('0x19F70C4D80494FF8', this.ped.handle, _h(componentHash), weaponHash);
395
405
  }
396
406
  /**
397
- * @param weaponHash Refer to [enum: eWeaponHash]
407
+ * @param visible
408
+ * @param deselectWeapon
409
+ * @param p3
410
+ * @param p4
398
411
  */
399
- enableAmmoTypeForPed(weaponHash) {
400
- inv('0x3B7B7908B7ADFB4B', this.ped.handle, weaponHash);
412
+ setPedCurrentWeaponVisible(visible, deselectWeapon, p3, p4) {
413
+ inv('0x0725A4CCFDED9A70', this.ped.handle, visible, deselectWeapon, p3, p4);
401
414
  }
402
415
  /**
403
- * Detaches the weapon from the ped and actually removes the ped's weapon
416
+ * Old name: _DROP_CURRENT_PED_WEAPON
404
417
  *
405
418
  * @param p1
419
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
420
+ * @param p3
421
+ * @param p4
406
422
  * @returns
407
423
  */
408
- getWeaponObjectFromPed(p1) {
409
- return createFromHandle('Prop', inv('0xC6A6789BB405D11C', this.ped.handle, p1, rai()));
424
+ makePedDropWeapon(p1, attachPoint, p3, p4) {
425
+ return createFromHandle('Entity', inv('0xCEF4C65DE502D367', this.ped.handle, p1, attachPoint, p3, p4, rai()));
410
426
  }
411
- /**
412
- * @returns
413
- */
414
- isPedCurrentWeaponHolstered() {
415
- return inv('0xBDD9C235D8D1052E', this.ped.handle);
427
+ removeAllPedAmmo() {
428
+ inv('0x1B83C0DEEBCBB214', this.ped.handle);
416
429
  }
417
430
  /**
418
- * @param toggle
431
+ * @param allow
419
432
  */
420
- setInstantlyEquipWeaponPickups(toggle) {
421
- inv('0x739B9C6D0E7F7F93', this.ped.handle, toggle);
433
+ setAllowDualWield(allow) {
434
+ inv('0x83B8D50EB9446BBA', this.ped.handle, allow);
422
435
  }
423
436
  /**
424
- * Hides the ped's weapon during a cutscene.
437
+ * Returns weaponEmoteVariation WEAPON_EMOTE_VARIATION_INVALID = -2,
438
+ * WEAPON_EMOTE_VARIATION_BASE,
439
+ * WEAPON_EMOTE_VARIATION_A,
440
+ * WEAPON_EMOTE_VARIATION_B,
441
+ * WEAPON_EMOTE_VARIATION_C,
442
+ * WEAPON_EMOTE_VARIATION_D,
443
+ * WEAPON_EMOTE_VARIATION_PREVIEW,
444
+ * WEAPON_EMOTE_NUM_VARIATIONS
425
445
  *
426
- * @param toggle
427
- */
428
- hidePedWeaponForScriptedCutscene(toggle) {
429
- inv('0x6F6981D2253C208F', this.ped.handle, toggle);
430
- }
431
- /**
432
- * @returns guidPrimary; guidSecondary
446
+ * @param variation
447
+ * @returns
433
448
  */
434
- setPlayerPedQuickSwapWeaponByGuid() {
435
- const result = inv('0xEC1F85DA51D3D6C4', this.ped.handle, pvi(), pvi());
436
- return [result[0], result[1]];
449
+ getWeaponEmoteVariation(variation) {
450
+ return inv('0x86147D05FA831D3A', this.ped.handle, variation, rai());
437
451
  }
438
452
  /**
439
- * @returns Returns the total ammo in the ped weapon from it's guid, or `0`.; guid
453
+ * @param weaponHash Refer to [enum: eWeaponHash]
454
+ * @returns
440
455
  */
441
- getAmmoInPedWeaponFromGuid() {
442
- const result = inv('0x4823F13A21F51964', this.ped.handle, pvi(), rai());
443
- return [result[0], result[1]];
456
+ isPedCarryingWeapon(weaponHash) {
457
+ return inv('0xF29A186ED428B552', this.ped.handle, weaponHash);
444
458
  }
445
459
  /**
446
- * @param p1
447
- * @param p2
460
+ * @returns
448
461
  */
449
- removeAllPedWeapons(p1, p2) {
450
- inv('0xF25DF915FA38C5F3', this.ped.handle, p1, p2);
462
+ refillAmmoInCurrentPedWeapon() {
463
+ return inv('0x0A2AB7B7ABC055F4', this.ped.handle);
451
464
  }
452
465
  /**
453
- * Returns ammoHash from weaponObject (Returned by 0x6CA484C9A7377E4F)
466
+ * Unequip current weapon and set current weapon to WEAPON_UNARMED.
467
+ * p0 usually 2 in R* scripts. Doesn't seem to have any effect if changed....
468
+ * immediately: if true it will instantly switch to unarmed
454
469
  *
455
- * @param weaponObject
456
- * @returns
470
+ * @param p0
471
+ * @param immediately
457
472
  */
458
- getCurrentPedWeaponAmmoType(weaponObject) {
459
- return (inv('0x7E7B19A4355FEE13', this.ped.handle, weaponObject.handle, rai())) & 0xFFFFFFFF;
473
+ hidePedWeapons(p0, immediately) {
474
+ inv('0xFCCC886EDE3C63EC', this.ped.handle, p0, immediately);
460
475
  }
461
476
  /**
462
- * @param p1
463
- * @param p2
464
- * @param p3
465
- * @returns
477
+ * @param weaponHash Refer to [enum: eWeaponHash]
478
+ * @returns ammo
466
479
  */
467
- getPedWorstWeapon(p1, p2, p3) {
468
- return (inv('0xDA37A053C1522F5D', this.ped.handle, p1, p2, p3, rai())) & 0xFFFFFFFF;
480
+ getAmmoInClip(weaponHash) {
481
+ const result = inv('0x2E1202248937775C', this.ped.handle, pvi(), weaponHash, rai());
482
+ return [!!result[0], result[1]];
469
483
  }
470
484
  /**
471
485
  * @param toggle
472
486
  */
473
- setPedDropsWeaponsWhenDead(toggle) {
474
- inv('0x476AE72C1D19D1A8', this.ped.handle, toggle);
487
+ N_0x16D9841A85FA627E(toggle) {
488
+ inv('0x16D9841A85FA627E', this.ped.handle, toggle);
475
489
  }
476
490
  /**
477
- * Returns ammoHash
478
- *
479
- * @returns Returns the [enum: eAmmoType]; weaponGuid
491
+ * @param weaponHash Refer to [enum: eWeaponHash]
492
+ * @param offset
493
+ * @param ammoCount
480
494
  */
481
- getCurrentAmmoTypeFromGuid() {
482
- const result = inv('0xAF9D167A5656D6A6', this.ped.handle, pvi(), rai());
483
- return [result[0] & 0xFFFFFFFF, result[1]];
495
+ setPedDropsInventoryWeapon(weaponHash, offset, ammoCount) {
496
+ inv('0x208A1888007FC0E6', this.ped.handle, weaponHash, f(offset.x), f(offset.y), f(offset.z), ammoCount);
484
497
  }
485
498
  /**
486
- * @param toggle
499
+ * spinHash can be -1, 0 to disable
500
+ *
501
+ * @param weaponEmoteTrickType
502
+ * @param spin
487
503
  */
488
- setPedInfiniteAmmoClip(toggle) {
489
- inv('0xFBAA1E06B6BCA741', this.ped.handle, toggle);
504
+ setActiveGunSpinningKitEmoteTwirl(weaponEmoteTrickType, spin) {
505
+ inv('0x01F661BB9C71B465', this.ped.handle, weaponEmoteTrickType, _h(spin));
490
506
  }
491
507
  /**
492
- * returns the amount of peds that were restrained with the weapon thrown bolas
508
+ * Appears to just send specified weapon to your horse holster without having to be close
509
+ * However, the weapon is not visible on the horse holster, but you can reach the weapon on the weapon wheel
493
510
  *
494
- * @returns
511
+ * @param weaponHash Refer to [enum: eWeaponHash]
495
512
  */
496
- getNumPedsRestrainedFromWeaponBolas() {
497
- return inv('0x46D42883E873C1D7', this.ped.handle);
513
+ sendWeaponToInventory(weaponHash) {
514
+ inv('0xE9BD19F8121ADE3E', this.ped.handle, weaponHash);
498
515
  }
499
516
  /**
500
- * emote hashes: KIT_EMOTE_TWIRL_GUN, KIT_EMOTE_TWIRL_GUN_LEFT_HOLSTER, KIT_EMOTE_TWIRL_GUN_DUAL, 0 (to unequip)
517
+ * If near your horse when called, weapons stored on your horse will be considered
518
+ * Returns weaponHash
501
519
  *
502
- * @param emote
520
+ * @param weaponGroup
521
+ * @param p2
522
+ * @param p3
523
+ * @returns
503
524
  */
504
- setActiveGunSpinningEquipKitEmoteTwirl(emote) {
505
- inv('0xCBCFFF805F1B4596', this.ped.handle, _h(emote));
525
+ getBestPedWeaponInGroup(weaponGroup, p2, p3) {
526
+ return (inv('0x9F67929D98E7C6E8', this.ped.handle, _h(weaponGroup), p2, p3, rai())) & 0xFFFFFFFF;
506
527
  }
507
528
  /**
508
- * Stores longarms to your horse on dismount
509
- * Params: p2 = 0
510
- * SET_[I - M]*
529
+ * Only used in R* SP Scripts native_son2, native_son3 and smuggler2
530
+ * Params: p2 = -1
511
531
  *
512
- * @param storeLongarms
532
+ * @param p1
513
533
  * @param p2
514
534
  */
515
- setInstantlyStoreLongarmsOnDismount(storeLongarms, p2) {
516
- inv('0xB832F1A686B9B810', this.ped.handle, storeLongarms, p2);
535
+ N_0x8A779706DA5CA3DD(p1, p2) {
536
+ inv('0x8A779706DA5CA3DD', this.ped.handle, p1, p2);
517
537
  }
518
538
  /**
519
- * @param removeReason Refer to [enum: eRemoveItemReason]
520
- * @returns weaponGuid
539
+ * @param weaponHash Refer to [enum: eWeaponHash]
540
+ * @param ammoHash Refer to [enum: eAmmoType]
521
541
  */
522
- removeWeaponFromPedByGuid(removeReason) {
523
- const result = inv('0x51C3B71591811485', this.ped.handle, pvi(), removeReason);
524
- return result;
542
+ disableAmmoTypeForPedWeapon(weaponHash, ammoHash) {
543
+ inv('0xF0D728EEA3C99775', this.ped.handle, weaponHash, ammoHash);
525
544
  }
526
545
  /**
527
- * attachPoint:
528
- *
529
- * @param weaponHash Refer to [enum: eWeaponHash]
530
- * @param equipNow
531
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
532
- * @param p4
533
- * @param p5
546
+ * @returns data; outData
534
547
  */
535
- setCurrentPedWeapon(weaponHash, equipNow, attachPoint, p4, p5) {
536
- inv('0xADF692B254977C0C', this.ped.handle, weaponHash, equipNow, attachPoint, p4, p5);
548
+ giveWeaponToPedWithOptions() {
549
+ const result = inv('0xBE7E42B07FD317AC', this.ped.handle, pvi(), pvi(), rai());
550
+ return [!!result[0], result[1], result[2]];
537
551
  }
538
552
  /**
539
- * Equips a weapon from a weaponItem, similar to GIVE_WEAPON_TO_PED
540
- *
541
- * @param p2
542
- * @param p3
543
- * @param p4
544
- * @param p5
545
- * @returns weaponUid
553
+ * @returns
546
554
  */
547
- setCurrentPedWeaponByGuid(p2, p3, p4, p5) {
548
- const result = inv('0x12FB95FE3D579238', this.ped.handle, pvi(), p2, p3, p4, p5);
549
- return result;
555
+ getMaxLockonDistanceOfCurrentPedWeapon() {
556
+ return inv('0x79B1A6E780266DB0', this.ped.handle, raf());
550
557
  }
551
558
  /**
552
- * @param componentHash
553
- * @param weaponHash Refer to [enum: eWeaponHash]
554
- * @returns
559
+ * @param visible
555
560
  */
556
- hasPedGotWeaponComponent(componentHash, weaponHash) {
557
- return inv('0xBBC67A6F965C688A', this.ped.handle, _h(componentHash), weaponHash);
561
+ setPedAllWeaponsVisibility(visible) {
562
+ inv('0x4F806A6CFED89468', this.ped.handle, visible);
558
563
  }
559
564
  /**
560
565
  * @param weaponHash Refer to [enum: eWeaponHash]
561
- * @param amount The amount of ped to add to the ammo
562
- * @param addReason Refer to [enum: eAddItemReason]
566
+ * @param ammo
567
+ * @returns
563
568
  */
564
- addAmmoToPed(weaponHash, amount, addReason) {
565
- inv('0xB190BCA3F4042F95', this.ped.handle, weaponHash, amount, addReason);
569
+ setAmmoInClip(weaponHash, ammo) {
570
+ return inv('0xDCD2A934D65CB497', this.ped.handle, weaponHash, ammo, rai());
566
571
  }
567
572
  /**
568
- * @param ammoType
569
- * @param amount
570
- * @param addReason Refer to [enum: eAddItemReason]
573
+ * _GET_M* - _GET_PED_A*
574
+ *
575
+ * @param p1
576
+ * @returns
571
577
  */
572
- addAmmoToPedByType(ammoType, amount, addReason) {
573
- inv('0x106A811C6D3035F3', this.ped.handle, _h(ammoType), amount, addReason);
578
+ getPedWeaponObject(p1) {
579
+ return createFromHandle('Prop', inv('0x6CA484C9A7377E4F', this.ped.handle, p1, rai()));
574
580
  }
575
581
  /**
576
- * @param targetPed
582
+ * slotHash is usually just the weaponHash name, but WEAPON_* is replaced with SLOT_*
583
+ *
584
+ * @param slotHash
577
585
  * @returns
578
586
  */
579
- isTargetPedConstrainedByPedUsingBolas(targetPed) {
580
- return inv('0x8D50F43298AB9545', this.ped.handle, targetPed.handle, rai());
587
+ getPedWeaponInSlot(slotHash) {
588
+ return (inv('0xDBC4B552B2AE9A83', this.ped.handle, _h(slotHash), rai())) & 0xFFFFFFFF;
581
589
  }
582
590
  /**
583
- * @param p1
584
- * @returns guidPrimary
591
+ * Outputs cached guids
592
+ *
593
+ * @returns guidPrimary; guidSecondary
585
594
  */
586
- getBestPedWeaponInInventory(p1) {
587
- const result = inv('0x7B98500614C8E8B8', this.ped.handle, p1, pvi());
595
+ getPlayerPedQuickSwapWeaponByGuid() {
596
+ const result = inv('0xB7E52A058B07C7E2', this.ped.handle, pvi(), pvi());
588
597
  return [result[0], result[1]];
589
598
  }
590
599
  /**
591
- * @param toggle
600
+ * Returns true if the ped is currently holstering or unholstering a weapon
601
+ *
602
+ * @returns
592
603
  */
593
- N_0xF08D8FEB455F2C8C(toggle) {
594
- inv('0xF08D8FEB455F2C8C', this.ped.handle, toggle);
604
+ isWeaponHolsterStateChanging() {
605
+ return inv('0x2387D6E9C6B478AA', this.ped.handle, rai());
595
606
  }
596
607
  /**
597
- * @returns ammo; inventoryUid
608
+ * @param ammoHash Refer to [enum: eAmmoType]
609
+ * @returns
598
610
  */
599
- getAmmoInClipByInventoryUid() {
600
- const result = inv('0x678F00858980F516', this.ped.handle, pvi(), pvi());
601
- return [result[0], result[1], result[2]];
611
+ N_0x44C8F4908F1B2622(ammoHash) {
612
+ return inv('0x44C8F4908F1B2622', this.ped.handle, ammoHash, rai());
602
613
  }
603
614
  /**
604
- * removeReason must be REMOVE_REASON_USED, REMOVE_REASON_GIVEN, REMOVE_REASON_DROPPED or REMOVE_REASON_DEBUG, unless amount is -1
605
- *
606
- * @param ammoHash Refer to [enum: eAmmoType]
607
- * @param amount
608
- * @param removeReason Refer to [enum: eRemoveItemReason]
615
+ * @param p2
616
+ * @returns clipInventoryUid
609
617
  */
610
- removeAmmoFromPedByType(ammoHash, amount, removeReason) {
611
- inv('0xB6CFEC32E3742779', this.ped.handle, ammoHash, amount, removeReason);
618
+ refillAmmoInClip(p2) {
619
+ const result = inv('0xDF4A3404D022ADDE', this.ped.handle, pvi(), p2);
620
+ return [result[0], result[1]];
612
621
  }
613
622
  /**
614
- * Holster the holded shoulder weapon. Precisions: 0 means with anim while 1 means direct holster
623
+ * _SET_A* - _SET_B*
615
624
  *
616
- * @param disableAnim
625
+ * @param p1
617
626
  */
618
- setPedWeaponOnBack(disableAnim) {
619
- inv('0x4820A6939D7CEF28', this.ped.handle, disableAnim);
627
+ N_0x2EBF70E1D8C06683(p1) {
628
+ inv('0x2EBF70E1D8C06683', this.ped.handle, _h(p1));
620
629
  }
621
630
  /**
622
- * @param ammoType
623
- * @param ammo
631
+ * @returns
624
632
  */
625
- setPedAmmoByType(ammoType, ammo) {
626
- inv('0x5FD1E1F011E76D7E', this.ped.handle, _h(ammoType), ammo);
633
+ getAllowDualWield() {
634
+ return inv('0x918990BD9CE08582', this.ped.handle);
627
635
  }
628
636
  /**
629
- * @param p1
637
+ * Returns eCurrentHeldWeapon
638
+ * _GET_R* - _GET_T*
639
+ *
630
640
  * @returns
631
641
  */
632
- getPedBackupWeapon(p1) {
633
- return (inv('0xC71FE230A513C30F', this.ped.handle, p1, rai())) & 0xFFFFFFFF;
642
+ getPedCurrentHeldWeapon() {
643
+ return (inv('0x8425C5F057012DAB', this.ped.handle, rai())) & 0xFFFFFFFF;
634
644
  }
635
645
  /**
636
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
646
+ * @param toggle
637
647
  */
638
- setForceCurrentWeaponIntoCockedState(attachPoint) {
639
- inv('0x5230D3F6EE56CFE6', this.ped.handle, attachPoint);
648
+ setForceAutoEquip(toggle) {
649
+ inv('0xBE711B14A159E84F', this.ped.handle, toggle);
640
650
  }
641
651
  /**
642
- * @returns
652
+ * @param weaponHash Refer to [enum: eWeaponHash]
653
+ * @param ammo
643
654
  */
644
- enableWeaponRestore() {
645
- return inv('0xC395355843BE134B', this.ped.handle);
655
+ setPedAmmo(weaponHash, ammo) {
656
+ inv('0x14E56BC5B5DB6A19', this.ped.handle, weaponHash, ammo);
646
657
  }
647
658
  /**
648
- * Returns whether the specified ped is holding a weapon with the given hash.
649
- * only these weapons below return true
650
- * 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
659
+ * Gives the ped the weapon.
660
+ * 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
661
+ * 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
651
662
  *
652
- * @param weapon
663
+ * @param weaponHash Refer to [enum: eWeaponHash]
664
+ * @param ammoCount
665
+ * @param bForceInHand
666
+ * @param bForceInHolster
667
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
668
+ * @param bAllowMultipleCopies
669
+ * @param p7
670
+ * @param p8
671
+ * @param addReason Refer to [enum: eAddItemReason]
672
+ * @param bIgnoreUnlocks
673
+ * @param permanentDegradation
674
+ * @param p12
653
675
  * @returns
654
676
  */
655
- isPedHoldingWeapon(weapon) {
656
- return inv('0x07E1C35F0078C3F9', this.ped.handle, _h(weapon), rai());
677
+ giveWeaponToPed(weaponHash, ammoCount, bForceInHand, bForceInHolster, attachPoint, bAllowMultipleCopies, p7, p8, addReason, bIgnoreUnlocks, permanentDegradation, p12) {
678
+ return (inv('0x5E3BDDBCB83F3D84', this.ped.handle, weaponHash, ammoCount, bForceInHand, bForceInHolster, attachPoint, bAllowMultipleCopies, f(p7), f(p8), addReason, bIgnoreUnlocks, f(permanentDegradation), p12, rai())) & 0xFFFFFFFF;
657
679
  }
658
680
  /**
659
- * _GET_D* - _GET_L*
660
- *
681
+ * @param weaponHash Refer to [enum: eWeaponHash]
661
682
  * @returns
662
683
  */
663
- N_0x0DE0944ECCB3DF5D() {
664
- return inv('0x0DE0944ECCB3DF5D', this.ped.handle, rai());
684
+ getAmmoInPedWeapon(weaponHash) {
685
+ return inv('0x015A522136D7F951', this.ped.handle, weaponHash, rai());
665
686
  }
666
687
  /**
667
- * @param flags
668
- * @returns
688
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
689
+ * @returns weaponGuid
669
690
  */
670
- isPedArmed(flags) {
671
- return inv('0xCB690F680A3EA971', this.ped.handle, flags);
691
+ getPedWeaponGuidAtAttachPoint(attachPoint) {
692
+ const result = inv('0x6929E22158E52265', this.ped.handle, attachPoint, pvi());
693
+ return [result[0], result[1]];
672
694
  }
673
695
  /**
674
- * Returns whether the ped has a sniper p1: 0 or 1
675
- *
676
- * @param p1
677
- * @returns
696
+ * @param toggle
678
697
  */
679
- doesPedHaveSniper(p1) {
680
- return inv('0x80BB243789008A82', this.ped.handle, p1);
698
+ setAllowAnyWeaponDrop(toggle) {
699
+ inv('0x78030C7867D8B9B6', this.ped.handle, toggle);
681
700
  }
682
701
  /**
683
- * Returns the ped's default unarmed weapon hash as defined in CPedModelInfo (DefaultUnarmedWeapon).
684
- * Falls back to WEAPON_UNARMED if the ped doesn't have a valid model info pointer, or 0 if the ped doesn't exist.
685
- *
686
702
  * @returns
687
703
  */
688
- getDefaultUnarmedWeaponHash() {
689
- return (inv('0x08FF1099ED2E6E21', this.ped.handle, rai())) & 0xFFFFFFFF;
704
+ makePedReload() {
705
+ return inv('0x79E1E511FF7EFB13', this.ped.handle);
690
706
  }
691
707
  /**
692
708
  * @param weaponHash Refer to [enum: eWeaponHash]
693
- * @param p2
694
- * @returns
709
+ * @param ammoCount
710
+ * @param p3
711
+ * @param addReason Refer to [enum: eAddItemReason]
695
712
  */
696
- getMaxAmmoInClip(weaponHash, p2) {
697
- return inv('0xA38DCFFCEA8962FA', this.ped.handle, weaponHash, p2, rai());
713
+ giveDelayedWeaponToPed(weaponHash, ammoCount, p3, addReason) {
714
+ inv('0xB282DC6EBD803C75', this.ped.handle, weaponHash, ammoCount, p3, addReason);
698
715
  }
699
716
  /**
700
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
701
- * @returns Returns the weapon entity
717
+ * @param toggle
702
718
  */
703
- getCurrentPedWeaponEntityIndex(attachPoint) {
704
- return createFromHandle('Entity', inv('0x3B390A939AF0B5FC', this.ped.handle, attachPoint, rai()));
719
+ N_0x45E57FDD531C9477(toggle) {
720
+ inv('0x45E57FDD531C9477', this.ped.handle, toggle);
721
+ }
722
+ /**
723
+ * @param ammoHash Refer to [enum: eAmmoType]
724
+ * @returns weaponInventoryUid
725
+ */
726
+ setAmmoTypeForPedWeaponInventory(ammoHash) {
727
+ const result = inv('0xEBE46B501BC3FBCF', this.ped.handle, pvi(), ammoHash);
728
+ return result;
729
+ }
730
+ /**
731
+ * @param weaponHash Refer to [enum: eWeaponHash]
732
+ * @param p2
733
+ * @param removeReason Refer to [enum: eRemoveItemReason]
734
+ */
735
+ removeWeaponFromPed(weaponHash, p2, removeReason) {
736
+ inv('0x4899CB088EDF59B8', this.ped.handle, weaponHash, p2, removeReason);
705
737
  }
706
738
  /**
707
739
  * @param ammoType
@@ -792,87 +824,55 @@ export class Weapon {
792
824
  inv('0x899A04AFCC725D04', this.ped.handle, _h(weaponCollection));
793
825
  }
794
826
  /**
795
- * @returns
796
- */
797
- isPedWeaponReadyToShoot() {
798
- return inv('0xB80CA294F2F26749', this.ped.handle, rai());
799
- }
800
- /**
801
- * @param componentHash
802
- * @param weaponHash Refer to [enum: eWeaponHash]
827
+ * @param toggle
803
828
  */
804
- removeWeaponComponentFromPed(componentHash, weaponHash) {
805
- inv('0x19F70C4D80494FF8', this.ped.handle, _h(componentHash), weaponHash);
829
+ N_0xF08D8FEB455F2C8C(toggle) {
830
+ inv('0xF08D8FEB455F2C8C', this.ped.handle, toggle);
806
831
  }
807
832
  /**
808
- * @param visible
809
- * @param deselectWeapon
810
- * @param p3
811
- * @param p4
833
+ * @returns ammo; inventoryUid
812
834
  */
813
- setPedCurrentWeaponVisible(visible, deselectWeapon, p3, p4) {
814
- inv('0x0725A4CCFDED9A70', this.ped.handle, visible, deselectWeapon, p3, p4);
835
+ getAmmoInClipByInventoryUid() {
836
+ const result = inv('0x678F00858980F516', this.ped.handle, pvi(), pvi());
837
+ return [result[0], result[1], result[2]];
815
838
  }
816
839
  /**
817
- * Old name: _DROP_CURRENT_PED_WEAPON
840
+ * removeReason must be REMOVE_REASON_USED, REMOVE_REASON_GIVEN, REMOVE_REASON_DROPPED or REMOVE_REASON_DEBUG, unless amount is -1
818
841
  *
819
- * @param p1
820
- * @param attachPoint Refer to [enum: eWeaponAttachPoint]
821
- * @param p3
822
- * @param p4
823
- * @returns
824
- */
825
- makePedDropWeapon(p1, attachPoint, p3, p4) {
826
- return createFromHandle('Entity', inv('0xCEF4C65DE502D367', this.ped.handle, p1, attachPoint, p3, p4, rai()));
827
- }
828
- removeAllPedAmmo() {
829
- inv('0x1B83C0DEEBCBB214', this.ped.handle);
830
- }
831
- /**
832
- * @param allow
842
+ * @param ammoHash Refer to [enum: eAmmoType]
843
+ * @param amount
844
+ * @param removeReason Refer to [enum: eRemoveItemReason]
833
845
  */
834
- setAllowDualWield(allow) {
835
- inv('0x83B8D50EB9446BBA', this.ped.handle, allow);
846
+ removeAmmoFromPedByType(ammoHash, amount, removeReason) {
847
+ inv('0xB6CFEC32E3742779', this.ped.handle, ammoHash, amount, removeReason);
836
848
  }
837
849
  /**
838
- * Returns weaponEmoteVariation WEAPON_EMOTE_VARIATION_INVALID = -2,
839
- * WEAPON_EMOTE_VARIATION_BASE,
840
- * WEAPON_EMOTE_VARIATION_A,
841
- * WEAPON_EMOTE_VARIATION_B,
842
- * WEAPON_EMOTE_VARIATION_C,
843
- * WEAPON_EMOTE_VARIATION_D,
844
- * WEAPON_EMOTE_VARIATION_PREVIEW,
845
- * WEAPON_EMOTE_NUM_VARIATIONS
850
+ * Holster the holded shoulder weapon. Precisions: 0 means with anim while 1 means direct holster
846
851
  *
847
- * @param variation
848
- * @returns
852
+ * @param disableAnim
849
853
  */
850
- getWeaponEmoteVariation(variation) {
851
- return inv('0x86147D05FA831D3A', this.ped.handle, variation, rai());
854
+ setPedWeaponOnBack(disableAnim) {
855
+ inv('0x4820A6939D7CEF28', this.ped.handle, disableAnim);
852
856
  }
853
857
  /**
854
- * @param weaponHash Refer to [enum: eWeaponHash]
855
- * @returns
858
+ * @param ammoType
859
+ * @param ammo
856
860
  */
857
- isPedCarryingWeapon(weaponHash) {
858
- return inv('0xF29A186ED428B552', this.ped.handle, weaponHash);
861
+ setPedAmmoByType(ammoType, ammo) {
862
+ inv('0x5FD1E1F011E76D7E', this.ped.handle, _h(ammoType), ammo);
859
863
  }
860
864
  /**
865
+ * @param p1
861
866
  * @returns
862
867
  */
863
- refillAmmoInCurrentPedWeapon() {
864
- return inv('0x0A2AB7B7ABC055F4', this.ped.handle);
868
+ getPedBackupWeapon(p1) {
869
+ return (inv('0xC71FE230A513C30F', this.ped.handle, p1, rai())) & 0xFFFFFFFF;
865
870
  }
866
871
  /**
867
- * Unequip current weapon and set current weapon to WEAPON_UNARMED.
868
- * p0 usually 2 in R* scripts. Doesn't seem to have any effect if changed....
869
- * immediately: if true it will instantly switch to unarmed
870
- *
871
- * @param p0
872
- * @param immediately
872
+ * @param attachPoint Refer to [enum: eWeaponAttachPoint]
873
873
  */
874
- hidePedWeapons(p0, immediately) {
875
- inv('0xFCCC886EDE3C63EC', this.ped.handle, p0, immediately);
874
+ setForceCurrentWeaponIntoCockedState(attachPoint) {
875
+ inv('0x5230D3F6EE56CFE6', this.ped.handle, attachPoint);
876
876
  }
877
877
  /**
878
878
  * @returns