# addPedClothes (Shared)

> Dresses a ped in a piece of clothing. The piece takes its slot and replaces whatever was in it.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Appearance
- **URL**: https://wiki.mymp.gg/en/addPedClothes

## Syntax

```lua
bool addPedClothes(ped ped, string model [, int|string variant = 0])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. |
| `model` | `string` | The piece's model, as the pack's `<Clothes>` file declares it. |
| `variant` | `int\|string` | The variant's number (from 0, the first being the base texture) or the texture's name. *(default: `0`)* |

## Returns

`true` if the piece was put on, `false` if the ped's model has no such piece or it already wears the maximum of 16 pieces.

On the server, the change is sent to every client. On the client, it applies to this client only.

## Example

```lua
addCommandHandler("camisa", function(player, command, model, variant)
    addPedClothes(player, model, tonumber(variant) or 0)
end)
```

### Coming from MTA

In MTA the function takes the texture, the model and a clothes type number. Here the slot comes from the clothes catalog of the ped's model, and the texture may be given by its variant number.

## See also

- [removePedClothes (Shared)](https://wiki.mymp.gg/en/removePedClothes.md): Takes off the piece of clothing a ped wears in a slot.
- [getPedClothes (Shared)](https://wiki.mymp.gg/en/getPedClothes.md): Tells which clothes a ped wears, all of them or the one in a slot.
- [getClothesVariantCount (Shared)](https://wiki.mymp.gg/en/getClothesVariantCount.md): Counts how many textures a piece of clothing has for a ped's model.
