WeaponClient

getPedWeaponComponentTintIndex

GET_PED_WEAPON_COMPONENT_TINT_INDEX0xF0A60040BE558F2D

The GTA V native GET_PED_WEAPON_COMPONENT_TINT_INDEX of the WEAPON namespace, as LS:MP client scripts call it: the global function getPedWeaponComponentTintIndex, in JavaScript and in Lua.

SignatureJavaScript
getPedWeaponComponentTintIndex(
  ped: Ped,
  weaponHash: Hash,
  camoComponentHash: Hash
): number
SignatureLua
getPedWeaponComponentTintIndex(
  ped: Ped,
  weaponHash: Hash,
  camoComponentHash: Hash
): integer

Usage

JavaScript
const result = getPedWeaponComponentTintIndex(ped, weaponHash, camoComponentHash);
Lua
local result = getPedWeaponComponentTintIndex(ped, weaponHash, camoComponentHash)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
camoComponentHashHashnumberinteger

Returns

int JavaScript number, Lua integer

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Returns -1 if camoComponentHash is invalid/not attached to the weapon.
Full list of weapons, components, tint indexes & weapon liveries by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/weapons.json

Reference

Namespace
Weapon WEAPON
In the game
int GET_PED_WEAPON_COMPONENT_TINT_INDEX(Ped ped, Hash weaponHash, Hash camoComponentHash)
Hash
0xF0A60040BE558F2D
Introduced
Game build 1103 legacy numbering
Formerly
_GET_PED_WEAPON_LIVERY_COLOR

Open in the interactive natives reference