Skip to content

Commit 587aa29

Browse files
authoredMar 8, 2024
Add more info for GET_WEAPONTYPE_GROUP (citizenfx#1050)
* docs(natives/WEAPON): more info for GET_WEAPONTYPE_GROUP Adds hashes from meta files along with examples of weapons and some code. * docs(natives/WEAPONS): fix a few silly mistakes
1 parent b9bb128 commit 587aa29

File tree

1 file changed

+44
-11
lines changed

1 file changed

+44
-11
lines changed
 

‎WEAPON/GetWeapontypeGroup.md

+44-11
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,51 @@ ns: WEAPON
88
Hash GET_WEAPONTYPE_GROUP(Hash weaponHash);
99
```
1010
11+
Gets and returns the hash of the group of the specified weapon (group names can be found/changed under "Group" in the weapons' meta file).
12+
Note that the group is **not** the same as the location on the weapon wheel.
1113
1214
## Parameters
13-
* **weaponHash**: The hash of the Weapon.
15+
* **weaponHash**: The hash of the weapon.
1416
1517
## Return value
16-
* **Melee**: 2685387236
17-
* **Handgun**: 416676503
18-
* **Submachine Gun**: -957766203
19-
* **Shotgun**: 860033945
20-
* **Assault Rifle**: 970310034
21-
* **Light Machine Gun**: 1159398588
22-
* **Sniper**: 3082541095
23-
* **Heavy Weapon**: 2725924767
24-
* **Throwables**: 1548507267
25-
* **Misc**: 4257178988
18+
19+
Returns the hash of the group of the weapon. Hashes:
20+
21+
| Group | Unsigned | Signed | Example |
22+
|:----------------------:|:----------:|:-----------:|:-----------------------:|
23+
| GROUP_DIGISCANNER | 3539449195 | -755518101 | WEAPON_DIGISCANNER |
24+
| GROUP_FIREEXTINGUISHER | 4257178988 | -37788308 | WEAPON_FIREEXTINGUISHER |
25+
| GROUP_HACKINGDEVICE | 1175761940 | 1175761940 | WEAPON_HACKINGDEVICE |
26+
| GROUP_HEAVY | 2725924767 | -1569042529 | WEAPON_RPG |
27+
| GROUP_MELEE | 3566412244 | -728555052 | WEAPON_BAT |
28+
| GROUP_METALDETECTOR | 3759491383 | -535475913 | WEAPON_METALDETECTOR |
29+
| GROUP_MG | 1159398588 | 1159398588 | WEAPON_COMBATMG |
30+
| GROUP_NIGHTVISION | 3493187224 | -801780072 | GADGET_NIGHTVISION |
31+
| GROUP_PARACHUTE | 431593103 | 431593103 | GADGET_PARACHUTE |
32+
| GROUP_PETROLCAN | 1595662460 | 1595662460 | WEAPON_PETROLCAN |
33+
| GROUP_PISTOL | 416676503 | 416676503 | WEAPON_PISTOL |
34+
| GROUP_RIFLE | 970310034 | 970310034 | WEAPON_ASSAULTRIFLE |
35+
| GROUP_SHOTGUN | 860033945 | 860033945 | WEAPON_PUMPSHOTGUN |
36+
| GROUP_SMG | 3337201093 | -957766203 | WEAPON_MICROSMG |
37+
| GROUP_SNIPER | 3082541095 | -1212426201 | WEAPON_SNIPERRIFLE |
38+
| GROUP_STUNGUN | 690389602 | 690389602 | WEAPON_STUNGUN |
39+
| GROUP_THROWN | 1548507267 | 1548507267 | WEAPON_SNOWBALL |
40+
| GROUP_TRANQILIZER | 75159441 | 75159441 | WEAPON_TRANQUILIZER |
41+
| GROUP_UNARMED | 2685387236 | -1609580060 | WEAPON_UNARMED |
42+
43+
## Examples
44+
```lua
45+
print(GetWeapontypeGroup(`WEAPON_PISTOL`)) -- Outputs the hash of GROUP_PISTOL
46+
print(GetWeapontypeGroup(`WEAPON_RPG`)) -- Outputs the hash of GROUP_HEAVY
47+
print(GetWeapontypeGroup(`WEAPON_SNOWBALL`)) -- Outputs the hash of GROUP_THROWN
48+
print(GetWeapontypeGroup(`WEAPON_MUSKET`)) -- Outputs the hash of GROUP_SNIPER
49+
print(GetWeapontypeGroup(GetSelectedPedWeapon(PlayerPedId()))) -- Outputs the hash of the currently selected weapon
50+
```
51+
52+
```js
53+
console.log(GetWeapontypeGroup(`WEAPON_PISTOL`)); // Outputs the hash of GROUP_PISTOL
54+
console.log(GetWeapontypeGroup(`WEAPON_RPG`)); // Outputs the hash of GROUP_HEAVY
55+
console.log(GetWeapontypeGroup(`WEAPON_SNOWBALL`)); // Outputs the hash of GROUP_THROWN
56+
console.log(GetWeapontypeGroup(`WEAPON_MUSKET`)); // Outputs the hash of GROUP_SNIPER
57+
console.log(GetWeapontypeGroup(GetSelectedPedWeapon(PlayerPedId()))); // Outputs the hash of the currently selected weapon
58+
```

0 commit comments

Comments
 (0)
Please sign in to comment.