GetPlayerClothes

From Multi Theft Auto: Wiki
Revision as of 12:57, 25 July 2006 by MrJax (talk | contribs)
Jump to navigation Jump to search

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

Syntax

string string getPlayerClothes ( player thePlayer, int clothesType )

Required Arguments

  • thePlayer: The player whose clothes you want to retrieve.
  • clothesType: The type/slot of clothing you want to get.

Returns

This function returns 2 strings, the clothes texture and model, the first var will be filled with 'false' if this player's clothes type is empty.

Example

This example prints the model and texture of the current clothing on a player's torso.

addCommandHandler ( "clothes?", "getClothes" )
function getClothes ( source, key, clothesType )
  texture, model = getPlayerClothes ( source, clothesType )
  if ( texture and model ) then
    outputChatBox ( getClientName ( source ) .. " is wearing " .. texture .. model .. " on his " .. getClothesTypeName ( clothesType ) )
  end
end

See Also