Weapon::getPedTintIndex

From RAGE Multiplayer Wiki
Revision as of 07:46, 25 April 2024 by Shr0x (talk | contribs) (Created page with "{{ClientsideJsFunction}} {{JSContainer| Gets given weapon tint index === Required Params === *'''handle''' {{RageType|number}} *'''weaponhash''' {{RageType|number}} ==Syntax== <pre> mp.game.weapon.getPedTintIndex(handle, weaponhash); </pre> ==Example== {{ClientsideCode| <syntaxhighlight lang="javascript"> mp.players.local.giveWeapon(mp.game.joaat("WEAPON_PISTOL"), 1000, true); mp.game.weapon.setPedTintIndex(mp.players.local.handle, mp.game.joaat("WEAPON_PISTOL"), 1);...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side
Function

 JavaScript



JavaScript Syntax

Gets given weapon tint index

Required Params

  • handle number
  • weaponhash number


Syntax

mp.game.weapon.getPedTintIndex(handle, weaponhash);

Example

Client-Side
mp.players.local.giveWeapon(mp.game.joaat("WEAPON_PISTOL"), 1000, true);
mp.game.weapon.setPedTintIndex(mp.players.local.handle, mp.game.joaat("WEAPON_PISTOL"), 1);

const weaponTint = mp.game.weapon.getPedTintIndex(mp.players.local.handle, mp.game.joaat("WEAPON_PISTOL"));
mp.console.logInfo(`Weapon tint index for player's weapon_pistol is ${weaponTint}`); //1


See also