# PED::_ADD_TEXTURE_LAYER

- **Hash:** `0x86BB5FF45F193A02`
- **Namespace:** PED
- **Runtime name (Lua/JS):** `AddTextureLayer`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/PED/_ADD_TEXTURE_LAYER

## Signature

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

## Parameters

- `textureId` (`int`)
- `albedoHash` (`Hash`)
- `normalHash` (`Hash`)
- `materialHash` (`Hash`)
- `blendType` (`int`)
- `texAlpha` (`float`)
- `sheetGridIndex` (`int`)

## 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

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

-- always available, by hash
local retval = Citizen.InvokeNative(0x86BB5FF45F193A02, textureId, albedoHash, normalHash, materialHash, blendType, texAlpha, sheetGridIndex, Citizen.ResultAsInteger())
```

### JavaScript

```js
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#

```csharp
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.*
