WeaponClient

setPedWeaponComponentTintIndex

SET_PED_WEAPON_COMPONENT_TINT_INDEX0x9FE5633880ECD8ED

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

SignatureJavaScript
setPedWeaponComponentTintIndex(
  ped: Ped,
  weaponHash: Hash,
  camoComponentHash: Hash,
  colorIndex: number
): void
SignatureLua
setPedWeaponComponentTintIndex(
  ped: Ped,
  weaponHash: Hash,
  camoComponentHash: Hash,
  colorIndex: integer
)

Usage

JavaScript
setPedWeaponComponentTintIndex(ped, weaponHash, camoComponentHash, colorIndex);
Lua
setPedWeaponComponentTintIndex(ped, weaponHash, camoComponentHash, colorIndex)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
camoComponentHashHashnumberinteger
colorIndexintnumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

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

Colors:
0 = Gray
1 = Dark Gray
2 = Black
3 = White
4 = Blue
5 = Cyan
6 = Aqua
7 = Cool Blue
8 = Dark Blue
9 = Royal Blue
10 = Plum
11 = Dark Purple
12 = Purple
13 = Red
14 = Wine Red
15 = Magenta
16 = Pink
17 = Salmon
18 = Hot Pink
19 = Rust Orange
20 = Brown
21 = Earth
22 = Orange
23 = Light Orange
24 = Dark Yellow
25 = Yellow
26 = Light Brown
27 = Lime Green
28 = Olive
29 = Moss
30 = Turquoise
31 = Dark Green
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
void SET_PED_WEAPON_COMPONENT_TINT_INDEX(Ped ped, Hash weaponHash, Hash camoComponentHash, int colorIndex)
Hash
0x9FE5633880ECD8ED
Introduced
Game build 1103 legacy numbering
Formerly
_SET_PED_WEAPON_LIVERY_COLOR

Open in the interactive natives reference