RedM Natives

_ADD_TEXTURE_LAYER

Creates ped overlay in texture override data and returns it's index.

Hash0x86BB5FF45F193A02
Runtime nameAddTextureLayer
NamespacePED
SideClient
NameCommunity guess
Docs
Since build1207

Signature

int _ADD_TEXTURE_LAYER(int textureId, Hash albedoHash, Hash normalHash, Hash materialHash, int blendType, float texAlpha, int sheetGridIndex);

Parameters

NameTypeDescription
textureIdint—
albedoHashHash—
normalHashHash—
materialHashHash—
blendTypeint—
texAlphafloat—
sheetGridIndexint—

Returns int

Description

Creates ped overlay in texture override data and returns it's index.
This index are used for further overlay editing.

albedoHash: a hash of overlay's albedo texture
colorType: a color type(from 0 to 2). 0 is used for overlays with RGB colors usually.

Usage

Lua
local retval = AddTextureLayer(textureId, albedoHash, normalHash, materialHash, blendType, texAlpha, sheetGridIndex)

-- always works, by hash
local retval = Citizen.InvokeNative(0x86BB5FF45F193A02, textureId, albedoHash, normalHash, materialHash, blendType, texAlpha, sheetGridIndex, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = AddTextureLayer(textureId, albedoHash, normalHash, materialHash, blendType, texAlpha, sheetGridIndex);

// by hash
const retval = Citizen.invokeNative('0x86BB5FF45F193A02', textureId, albedoHash, normalHash, materialHash, blendType, texAlpha + 0.0000001, sheetGridIndex, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0x86BB5FF45F193A02, textureId, albedoHash, normalHash, materialHash, blendType, texAlpha, sheetGridIndex);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.