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