GetClothesByTypeIndex: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 10: | Line 10: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''clothesType''': An integer representing the clothes slot/type to scan through. | *'''clothesType''': An integer representing the clothes slot/type to scan through. | ||
{{Clothes Textures}} | |||
*'''clothesIndex''': An integer representing the index (nth) set of clothes in the list you wish to retrieve. | *'''clothesIndex''': An integer representing the index (nth) set of clothes in the list you wish to retrieve. | ||
| Line 29: | Line 30: | ||
end | end | ||
clothesIndex = clothesIndex + 1 -- increase to the next set | clothesIndex = clothesIndex + 1 -- increase to the next set | ||
texture, model = getClothesByTypeIndex ( type, | texture, model = getClothesByTypeIndex ( type, clothesIndex ) -- our new texture and model | ||
if ( texture == currenttexture ) then -- if they are the same (the last in the list) | if ( texture == currenttexture ) then -- if they are the same (the last in the list) | ||
texture, model = getClothesByTypeIndex ( type, 0 ) -- get the first in the list | texture, model = getClothesByTypeIndex ( type, 0 ) -- get the first in the list | ||
Revision as of 12:44, 26 July 2006
This function is used to get the texture and model of clothes by the clothes type and index. (Scans through the list of clothes for the specific type).
Syntax
string string getClothesByTypeIndex ( int clothesType, int clothesIndex )
Required Arguments
- clothesType: An integer representing the clothes slot/type to scan through.
Clothing Types
- 0: SHIRT
- 1: HEAD
- 2: TROUSERS
- 3: SHOES
- 4: TATTOOS_LEFT_UPPER_ARM
- 5: TATTOOS_LEFT_LOWER_ARM
- 6: TATTOOS_RIGHT_UPPER_ARM
- 7: TATTOOS_RIGHT_LOWER_ARM
- 8: TATTOOS_BACK
- 9: TATTOOS_LEFT_CHEST
- 10: TATTOOS_RIGHT_CHEST
- 11: TATTOOS_STOMACH
- 12: TATTOOS_LOWER_BACK
- 13: NECKLACE
- 14: WATCH
- 15: GLASSES
- 16: HAT
- 17: EXTRA
- clothesIndex: An integer representing the index (nth) set of clothes in the list you wish to retrieve.
Returns
This function returns 2 strings, a texture and model respectively, 'false' if invalid arguments were passed to the function.
Example
This example gets the current clothes of a certain type on a player, then swaps with the next in the clothes list.
addCommandHandler ( "nextClothes", "nextClothes" )
function nextClothes ( thePlayer, key, clothesType )
currentTexture, currentModel = getPlayerClothes ( thePlayer, clothesType ) -- get the current clothes of this type
clothesIndex = -1
if ( currentTexture ) then -- if this clothes slot wasn't empty
tempA, tempB = getTypeIndexFromClothes ( currentTexture, currentModel ) -- get the type and index for these clothes, so we can increase it to get the next set in the list
if ( tempA and tempB ) then -- if we found them
clothesType, clothesIndex = tempA, tempB
end
end
clothesIndex = clothesIndex + 1 -- increase to the next set
texture, model = getClothesByTypeIndex ( type, clothesIndex ) -- our new texture and model
if ( texture == currenttexture ) then -- if they are the same (the last in the list)
texture, model = getClothesByTypeIndex ( type, 0 ) -- get the first in the list
end
setPlayerClothes ( thePlayer, texture, model, type )
end
See Also
- addPedClothes
- getBodyPartName
- getClothesByTypeIndex
- getClothesTypeName
- getPedClothes
- getTypeIndexFromClothes
- removePedClothes