M MY Multiplayer: Wiki
Side
Kind

getClothesVariantCount

Shared

Counts how many textures a piece of clothing has for a ped's model.

int|false getClothesVariantCount(ped ped, string model)

Parameters

NameTypeDescription
pedpedThe ped or player whose model wears the piece.
modelstringThe piece of clothing's model.

Returns

The number of variants, which addPedClothes takes from 0 to that number minus 1, or false if the ped's model has no such piece.

Example

addCommandHandler("cor", function(player, command, model)
    local count = getClothesVariantCount(player, model)
    if count then
        addPedClothes(player, model, math.random(0, count - 1))
    end
end)

See also