Weapon::getWeapontypeModel

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Returns the model of any weapon.

Can also take an ammo hash?
sub_6663a(&l_115B, WEAPON::GET_WEAPONTYPE_MODEL(${ammo_rpg}));

Syntax

mp.game.weapon.getWeapontypeModel(weaponHash);

Required Arguments

  • weaponHash: Model hash or name

Return value

  • Model hash or name

Example

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

See also