Weapon::getWeapontypeGroup: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
No edit summary
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
Retrieves the weapon group of the supplied weapon hash.
Weapon Groups (Incomplete list)
* '''melee''': 2685387236
* '''Handguns''': 416676503
* '''Submachine Gun''': 3337201093
* '''Shotgun''': 860033945
* '''Assault Rifle''': 970310034
* '''Light Machine Gun''': 1159398588
* '''Sniper''': 3082541095
* '''Heavy Weapon''': 2725924767
* '''Throwables''': 1548507267
* '''Misc''': 4257178988
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">mp.game.weapon.getWeapontypeGroup(weaponHash);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.weapon.getWeapontypeGroup(weaponHash);</syntaxhighlight>
Line 5: Line 16:
*'''weaponHash:''' Model hash or name
*'''weaponHash:''' Model hash or name
===Return value===
===Return value===
*'''Model hash or name'''
*'''Weapon Group Hash'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
mp.keys.bind(0x76, false, function () { // F7 key
    let weaponHash = mp.game.invoke(`0x0A6DB4965674D243`, mp.players.local.handle); //GET_SELECTED_PED_WEAPON
    let groupHash = mp.game.weapon.getWeapontypeGroup(weaponHash);
    mp.gui.chat.push(`hash: ${weaponHash}, groupHash: ${groupHash}`);
})
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Weapon_s_function_c}}
{{Weapon_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 04:29, 31 July 2018

Retrieves the weapon group of the supplied weapon hash. Weapon Groups (Incomplete list)

  • melee: 2685387236
  • Handguns: 416676503
  • Submachine Gun: 3337201093
  • Shotgun: 860033945
  • Assault Rifle: 970310034
  • Light Machine Gun: 1159398588
  • Sniper: 3082541095
  • Heavy Weapon: 2725924767
  • Throwables: 1548507267
  • Misc: 4257178988

Syntax

mp.game.weapon.getWeapontypeGroup(weaponHash);

Required Arguments

  • weaponHash: Model hash or name

Return value

  • Weapon Group Hash

Example

mp.keys.bind(0x76, false, function () { // F7 key
    let weaponHash = mp.game.invoke(`0x0A6DB4965674D243`, mp.players.local.handle); //GET_SELECTED_PED_WEAPON
    let groupHash = mp.game.weapon.getWeapontypeGroup(weaponHash);
    mp.gui.chat.push(`hash: ${weaponHash}, groupHash: ${groupHash}`);
})

See also