M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
pedpedThe ped or player.
modelstringThe piece's model, as the pack's <Clothes> file declares it.
variantint|stringThe 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.

See also