<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shaneprod</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shaneprod"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Shaneprod"/>
	<updated>2026-04-10T06:18:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedClothes&amp;diff=76025</id>
		<title>SetPedClothes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedClothes&amp;diff=76025"/>
		<updated>2023-01-13T18:47:29Z</updated>

		<summary type="html">&lt;p&gt;Shaneprod: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you set a ped's clothes with just the slot and clothing index, allowing you to forget about texture and model names.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setPedClothes(ped thePed, int clothingSlot, int/bool clothingID)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePed''': The ped to dress up.&lt;br /&gt;
* '''clothingSlot''': The clothing slot to change. See the [[CJ Clothes|clothes catalog]] for more info.&lt;br /&gt;
* '''clothingID''': The clothing ID to set the slot to, or false to remove clothing from this slot (only applicable to slot IDs &amp;gt; 3). See the [[CJ Clothes|clothes catalog]] for more info.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns ''true'' if the clothes were set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setPedClothes(thePed, clothingSlot, clothingID)&lt;br /&gt;
	if not isElement(thePed) or type(clothingSlot) ~= &amp;quot;number&amp;quot; then&lt;br /&gt;
		error(&amp;quot;Invalid arguments to setPedClothes()!&amp;quot;, 2)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not clothingID then&lt;br /&gt;
		return removePedClothes(thePed, clothingSlot)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local hasClothes = getPedClothes(thePed, clothingSlot) &lt;br /&gt;
	if hasClothes then&lt;br /&gt;
		removePedClothes(thePed, clothingSlot)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local texture, model = getClothesByTypeIndex(clothingSlot, clothingID)&lt;br /&gt;
	return addPedClothes(thePed, texture, model, clothingSlot)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a '/setClothes [slot] [id]' command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function clothesCommand(player, cmd, slot, id)&lt;br /&gt;
	if not tonumber(slot) then&lt;br /&gt;
	   outputChatBox(&amp;quot;SYNTAX: /setClothes [slot] [id]&amp;quot;, player, 255, 0, 0)&lt;br /&gt;
	   return&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	setPedClothes(player, tonumber(slot), id)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;setClothes&amp;quot;, clothesCommand)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: John&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Shaneprod</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedClothes&amp;diff=76024</id>
		<title>SetPedClothes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedClothes&amp;diff=76024"/>
		<updated>2023-01-13T18:46:47Z</updated>

		<summary type="html">&lt;p&gt;Shaneprod: an argument was omitted in the command function due to which slot was a string and not a number&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you set a ped's clothes with just the slot and clothing index, allowing you to forget about texture and model names.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setPedClothes(ped thePed, int clothingSlot, int/bool clothingID)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePed''': The ped to dress up.&lt;br /&gt;
* '''clothingSlot''': The clothing slot to change. See the [[CJ Clothes|clothes catalog]] for more info.&lt;br /&gt;
* '''clothingID''': The clothing ID to set the slot to, or false to remove clothing from this slot (only applicable to slot IDs &amp;gt; 3). See the [[CJ Clothes|clothes catalog]] for more info.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns ''true'' if the clothes were set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setPedClothes(thePed, clothingSlot, clothingID)&lt;br /&gt;
	if not isElement(thePed) or type(clothingSlot) ~= &amp;quot;number&amp;quot; then&lt;br /&gt;
		error(&amp;quot;Invalid arguments to setPedClothes()!&amp;quot;, 2)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not clothingID then&lt;br /&gt;
		return removePedClothes(thePed, clothingSlot)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local hasClothes = getPedClothes(thePed, clothingSlot) &lt;br /&gt;
	if hasClothes then&lt;br /&gt;
		removePedClothes(thePed, clothingSlot)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local texture, model = getClothesByTypeIndex(clothingSlot, clothingID)&lt;br /&gt;
	return addPedClothes(thePed, texture, model, clothingSlot)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a '/setClothes [slot] [id]' command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function clothesCommand(player, cmd, slot, id)&lt;br /&gt;
	if not tonumber(slot) then&lt;br /&gt;
		outputChatBox(&amp;quot;SYNTAX: /setClothes [slot] [id]&amp;quot;, player, 255, 0, 0)&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	setPedClothes(player, tonumber(slot), id)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;setClothes&amp;quot;, clothesCommand)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: John&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Shaneprod</name></author>
	</entry>
</feed>