getForcedComponents
Returns every component GTA forces alongside a garment, arms, undershirts, decals. These are the pieces the game itself considers mandatory for the garment to render correctly, as opposed to the merely suggested ones shown in the GOES WITH panel.
๐ก Syntax
local forced = exports['kartik-clothing']:getForcedComponents(componentId, drawable, texture)๐ฅ Parameters
| Parameter | Type | Optional | Description |
|---|---|---|---|
componentId | number | No | The component the garment sits in, usually 11 for tops. |
drawable | number | No | Drawable index of the garment. |
texture | number | Yes | Texture index. Defaults to 0. |
๐ค Returns
| Type | Description |
|---|---|
table[] | A list of { componentId, drawable, texture }. Empty when the garment forces nothing, or when the game has no record of it. |
๐ป Example
local forced = exports['kartik-clothing']:getForcedComponents(11, 84)
for _, piece in ipairs(forced) do
print(('component %d must be %d/%d'):format(piece.componentId, piece.drawable, piece.texture))
end๐ Related
- getRecommendedArms
/compatdebugin Asset & Development Tools prints the same data plus the underlying component hash.
getRecommendedArms
Returns the arms (component 3) GTA recommends for a given garment, without applying them. Useful for previewing a uniform, or for deciding whether an outfit needs correcting before you commit it.
useClothingItem
Equips a clothing inventory item onto the local player's ped. Both exports are aliases of the same handler, use whichever name reads better against your inventory's API.