WeaponClient

getWeaponObjectComponentTintIndex

GET_WEAPON_OBJECT_COMPONENT_TINT_INDEX0xB3EA4FEABF41464B

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

SignatureJavaScript
getWeaponObjectComponentTintIndex(
  weaponObject: Object,
  camoComponentHash: Hash
): number
SignatureLua
getWeaponObjectComponentTintIndex(
  weaponObject: Object,
  camoComponentHash: Hash
): integer

Usage

JavaScript
const result = getWeaponObjectComponentTintIndex(weaponObject, camoComponentHash);
Lua
local result = getWeaponObjectComponentTintIndex(weaponObject, camoComponentHash)

Parameters

ParameterTypeJavaScriptLua
weaponObjectObjectnumberinteger
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 object.
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_WEAPON_OBJECT_COMPONENT_TINT_INDEX(Object weaponObject, Hash camoComponentHash)
Hash
0xB3EA4FEABF41464B
Introduced
Game build 1103 legacy numbering
Formerly
_GET_WEAPON_OBJECT_LIVERY_COLOR

Open in the interactive natives reference