<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/HU/getClothesByTypeIndex?action=history&amp;feed=atom</id>
	<title>HU/getClothesByTypeIndex - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/HU/getClothesByTypeIndex?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HU/getClothesByTypeIndex&amp;action=history"/>
	<updated>2026-08-05T15:24:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HU/getClothesByTypeIndex&amp;diff=59276&amp;oldid=prev</id>
		<title>Surge: Created page with &quot;__NOTOC__ {{Server client function}} 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 sp...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HU/getClothesByTypeIndex&amp;diff=59276&amp;oldid=prev"/>
		<updated>2018-09-22T10:15:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{Server client function}} 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 sp...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to get the texture and model of clothes by the clothes type and index.&lt;br /&gt;
(Scans through the list of clothes for the specific type).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string string getClothesByTypeIndex ( int clothesType, int clothesIndex )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''clothesType''': An integer representing the clothes slot/type to scan through.&lt;br /&gt;
{{Clothes Textures}}&lt;br /&gt;
*'''clothesIndex''': An integer representing the index (0 based) set of clothes in the list you wish to retrieve. Each type has a different number of valid indexes.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns 2 strings, a texture and model respectively, ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the current clothes of a certain type on a player, then swaps with the next in the clothes list.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptNextClothes ( thePlayer, key, clothesType )&lt;br /&gt;
  local currentTexture, currentModel = getPedClothes ( thePlayer, clothesType ) -- get the current clothes on this slot&lt;br /&gt;
  local clothesIndex = -1&lt;br /&gt;
  if ( currentTexture ) then -- if he had clothes of that type&lt;br /&gt;
    local 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&lt;br /&gt;
    if ( tempA and tempB ) then -- if we found them&lt;br /&gt;
      clothesType, clothesIndex = tempA, tempB&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  clothesIndex = clothesIndex + 1&lt;br /&gt;
  local texture, model = getClothesByTypeIndex ( clothesType, clothesIndex ) -- get the new texture and model&lt;br /&gt;
  if ( texture == false ) then -- if we've reached the end of the list&lt;br /&gt;
    removePedClothes ( thePlayer, clothesType )&lt;br /&gt;
  else addPedClothes ( thePlayer, texture, model, clothesType )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;nextClothes&amp;quot;, scriptNextClothes )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Clothes and body functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:getClothesByTypeIndex]]&lt;br /&gt;
[[pl:GetClothesByTypeIndex]]&lt;/div&gt;</summary>
		<author><name>Surge</name></author>
	</entry>
</feed>