- Documentation
- Clothes
Category
Clothes
All Lua functions and events in the Clothes category, on the server and the client.
Server functions 20
addPuts a piece of CJ clothing on a ped (a player or an NPC): a texture and a model in one of 18 parts (0-17 or a name likePed Clothes "shirt","hat","trousers"). Every player sees it. The fifth argument (Trilogy Hub only) recolours the clothing:"RRGGBB"or a zone list"RRGGBB,,RRGGBB"(an empty spot = the zone stays as is, e.g. a print is kept).addGives a ped a San Andreas tattoo in one of nine body spots (slots 1-9: upper arms, forearms, back, chest, stomach, lower back). Every player sees it.Ped Tattoo addMakes a tattoo from your own PNG image in slot 1-9. The file must be listed inPed Tattoo Image meta.xmlas<file>(at most 1 MB and 1024x1024), and":resource/file.png"takes the file from another resource. Dark pixels are ink, light and transparent ones are skin. Every player sees it.clearRemoves all of a ped's tattoos and keeps the clothes.Ped Tattoos getReturns the texture and model of clothing numberClothes By Type Index indexof a type, from the table loaded withsetClothesData.getReturns what a ped wears on a body part: the texture, the model and the colour (Ped Clothes "RRGGBB", a zone list ornil).getReturns the offset and scale of the tattoo in slot 1-9 (Ped Tattoo Offset 0, 0, 0, 1when it is not moved).getReturns the offset and scale of a part of the look (Player Clothes Offset 0, 0, 0, 1when it is not moved).getReturns the player's outfit from the launcher wardrobe (skin -1), read only: a part ->Player Wardrobe { texture, model, color, name }table. An empty table = the player joined without an outfit. Scripts do not change this outfit; they dress a separate CJ copy (skin 0).getReturns the type and number of a clothing item by its texture and model, from the table loaded withType Index From Clothes setClothesData.removeRemoves a piece of a ped's clothing. With a texture and a model it removes it only when the ped wears exactly that item.Ped Clothes removeRemoves the tattoo from slot 1-9.Ped Tattoo removeRemoves a piece of a player's clothing. Accessories (hat, glasses, tattoo) disappear, while the shirt, trousers and shoes go back to the default look, because the game cannot draw a ped without them.Player Clothes resetPuts the tattoo in slot 1-9 back to its default place and size.Ped Tattoo Offset resetRemoves everything scripts put on the player (clothes and tattoos).Player Clothes setLoads your own clothing table forClothes Data getClothesByTypeIndexandgetTypeIndexFromClothes: a type (as a string"0"-"17") -> a list of{ texture, model }. Without it both functions returnfalse.setAnother name forPed Clothes setPlayerClothes: puts on a piece of clothing, with the same arguments.setMoves and scales the tattoo in slot 1-9 (offset in game centimetres). Every player sees it.Ped Tattoo Offset setPuts a piece of clothing on a player; the same asPlayer Clothes addPedClothes, with the argument order: texture, model, part. The fifth argument is a"RRGGBB"colour or a zone list. The player must use the CJ skin (0); the launcher wardrobe outfit (skin -1) is changed on a CJ copy that comes back after a skin change.setMoves and scales a part of the look (e.g. a hat or a tattoo) in game centimetres. Every player sees it.Player Clothes Offset
Client functions 3
getReturns the model names the game has for a clothing part.Clothes Models getReturns the list of clothes and tattoos the game knows: a part ->Clothes Table { nazwa, tatuaz, modele }table and their count. Useful for a clothes shop.getReturns what the game actually put on the local ped: a part ->Worn Clothes "texture|model"table. Useful to check whether clothing from the server arrived.
Shared functions 9
getReturns the clothing part number by name. It accepts English and Polish names, e.g.Clothes Type Id "hat","czapka","trousers","tattoo3".getReturns the name of a clothing part by its number 0-17:Clothes Type Name shirt,head,trousers,shoes,tattoo1-tattoo9,necklace,watch,glasses,hat,extra.getReturns descriptive clothing part names (e.g.Clothes Type Names [0] = "Shirt",[4] = "Tattoos Left upper arm",[16] = "Hats").getReturns every clothing part as a number -> name table (e.g.Clothes Types [16] = "hat").getReturns a ped's tattoos: a slot ->Ped Tattoos { name, texture, place }table (on the server alsoimagefor tattoos fromaddPedTattooImage).getReturns what a player wears on a body part: the texture, the model and the colour. Works on the server and on the client.Player Clothes getReturns the player's whole outfit set by scripts: a part ->Player Clothes All { texture, model, color, name }table.getReturns where on the body tattoo slot 1-9 is (e.g.Tattoo Place Name "lewe ramie"- left upper arm,"plecy"- back,"brzuch"- stomach; the names are in Polish).isChecks whether a clothing part is a tattoo slot (numbers 4-12).Clothes Type Tattoo