addPedClothes
Shared
Dresses a ped in a piece of clothing. The piece takes its slot and replaces whatever was in it.
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
addCommandHandler("camisa", function(player, command, model, variant)
addPedClothes(player, model, tonumber(variant) or 0)
end)Coming from MTAIn 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.