GetClothesTypeName: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by 8 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
This function is used to get the name of a certain clothes type.
This function is used to get the name of a certain clothes type.


Line 8: Line 9:


===Required Arguments===
===Required Arguments===
*'''clothesType''': An interger determining the type of clothes you want to get the clothes of.
*'''clothesType''': An integer determining the type of clothes you want to get the clothes of.
{{Clothes Textures}}


==Returns==
==Returns==
This function returns a string (the name of the clothes type) if found, 'false' otherwise.
This function returns a string (the name of the clothes type) if found, ''false'' otherwise.


==Example==
==Example==
This example is used to output in the chatbox what clothes type the player who uses the 'clothes?' command is wearing.
This example is used to output in the chatbox what clothes type the player who uses the 'clothes' command is wearing.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function getClothes ( thePlayer, key, clothesType )
function getClothes ( thePlayer, key, clothesType )
   local texture, model = getPlayerClothes ( source, clothesType )
   local texture, model = getPedClothes ( source, clothesType )
   if ( texture and model ) then
   if ( texture and model ) then
     outputChatBox ( getClientName ( thePlayer ) .. " is wearing " .. texture .. " " .. model .. " on his " .. getClothesTypeName ( clothesType ) )
     outputChatBox ( getPlayerName ( thePlayer ) .. " is wearing " .. texture .. " " .. model .. " on his " .. getClothesTypeName ( clothesType ) )
   end
   end
end
end
addCommandHandler ( "clothes?", getClothes )
addCommandHandler ( "clothes", getClothes )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Clothes and body functions}}
{{Clothes and body functions}}
[[hu:getClothesTypeName]]
[[pl:GetClothesTypeName]]

Latest revision as of 02:51, 13 December 2019

This function is used to get the name of a certain clothes type.

Syntax

string getClothesTypeName ( int clothesType )

Required Arguments

  • clothesType: An integer determining the type of clothes you want to get the clothes of.
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

Returns

This function returns a string (the name of the clothes type) if found, false otherwise.

Example

This example is used to output in the chatbox what clothes type the player who uses the 'clothes' command is wearing.

function getClothes ( thePlayer, key, clothesType )
  local texture, model = getPedClothes ( source, clothesType )
  if ( texture and model ) then
    outputChatBox ( getPlayerName ( thePlayer ) .. " is wearing " .. texture .. " " .. model .. " on his " .. getClothesTypeName ( clothesType ) )
  end
end
addCommandHandler ( "clothes", getClothes )

See Also