getPedClothes | Multi Theft Auto: Wiki Skip to content

getPedClothes

Client-side
Server-side
Shared

Pair: addPedClothes

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function is used to get the current clothes texture and model of a certain type on a ped.

OOP Syntax Help! I don't understand this!

  • Method: ped:getClothes(...)

Syntax

string,​ string getPedClothes ( ped thePed, int clothesType )
Required Arguments
  • thePed: The ped whose clothes you want to retrieve.
  • clothesType: The type/slot of clothing you want to get.

Returns

  • string: value1
  • string: value2

This function returns 2 strings , the clothes texture and model. The first return value will be false if this player's clothes type is empty or an invalid player was specified.

Code Examples

shared

This example prints the model and texture of the current clothing on the player who enters the "clothes" command. For example: "clothes 3" for the shoes.

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

See Also