├── IMAGES ├── bag.png ├── hat.png ├── armor.png ├── badges.png ├── chain.png ├── ears.png ├── gloves.png ├── mask.png ├── outfit.png ├── pants.png ├── shoes.png ├── watch.png ├── bracelet.png └── glasses.png ├── bridge ├── inventory │ ├── qb-inventory │ │ ├── client.lua │ │ └── server.lua │ └── ox_inventory │ │ ├── client.lua │ │ └── server.lua ├── framework │ ├── esx │ │ └── server.lua │ ├── ox │ │ └── server.lua │ └── qb │ │ └── server.lua └── appearance │ ├── ox_appearance │ └── client.lua │ ├── fivem-appearance │ └── client.lua │ ├── esx_skin │ └── client.lua │ ├── illenium-appearance │ └── client.lua │ └── qb_clothing │ └── client.lua ├── locale.lua ├── shared └── locale.lua ├── fxmanifest.lua ├── .github └── FUNDING.yml ├── data ├── arms.json └── gloves.json ├── locales ├── fr.lua ├── cs.lua └── en.lua ├── README.md ├── client ├── cl_gear.lua ├── cl_class.lua └── cl_clothing.lua ├── server └── sv_clothing.lua ├── config.lua └── LICENSE /IMAGES/bag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/bag.png -------------------------------------------------------------------------------- /IMAGES/hat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/hat.png -------------------------------------------------------------------------------- /IMAGES/armor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/armor.png -------------------------------------------------------------------------------- /IMAGES/badges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/badges.png -------------------------------------------------------------------------------- /IMAGES/chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/chain.png -------------------------------------------------------------------------------- /IMAGES/ears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/ears.png -------------------------------------------------------------------------------- /IMAGES/gloves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/gloves.png -------------------------------------------------------------------------------- /IMAGES/mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/mask.png -------------------------------------------------------------------------------- /IMAGES/outfit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/outfit.png -------------------------------------------------------------------------------- /IMAGES/pants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/pants.png -------------------------------------------------------------------------------- /IMAGES/shoes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/shoes.png -------------------------------------------------------------------------------- /IMAGES/watch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/watch.png -------------------------------------------------------------------------------- /IMAGES/bracelet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/bracelet.png -------------------------------------------------------------------------------- /IMAGES/glasses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LikeManTV/clothing/HEAD/IMAGES/glasses.png -------------------------------------------------------------------------------- /bridge/inventory/qb-inventory/client.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('qb-inventory') ~= 'started' then return end 2 | local qbinventory = exports['qb-inventory'] 3 | 4 | inventory = {} 5 | 6 | inventory.Search = function(item) 7 | return qbinventory:HasItem(item, 1) 8 | end -------------------------------------------------------------------------------- /bridge/inventory/ox_inventory/client.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('ox_inventory') ~= 'started' then return end 2 | local ox_inventory = exports.ox_inventory 3 | 4 | inventory = {} 5 | 6 | inventory.Search = function(item) 7 | local count = ox_inventory:Search('count', item) 8 | if count > 0 then 9 | return true 10 | end 11 | 12 | return false 13 | end -------------------------------------------------------------------------------- /bridge/framework/esx/server.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('es_extended') ~= 'started' then return end 2 | ESX = exports.es_extended:getSharedObject() 3 | 4 | local framework = {} 5 | 6 | framework.getPlayerName = function(playerId) 7 | local player = ESX.GetPlayerFromId(playerId) 8 | 9 | if player then 10 | return player.getName() 11 | end 12 | 13 | return GetPlayerName(playerId) 14 | end 15 | -------------------------------------------------------------------------------- /locale.lua: -------------------------------------------------------------------------------- 1 | Language = {} 2 | 3 | function _L(name, args) 4 | if name then 5 | local str = Language[Config.Language][name] 6 | if str then 7 | return string.format(str, (args ~= nil and table.unpack(args) or nil)) 8 | else 9 | return "ERR_TRANSLATE_"..(name).."_404" 10 | end 11 | else 12 | return "ERR_TRANSLATE_404" 13 | end 14 | end -------------------------------------------------------------------------------- /bridge/appearance/ox_appearance/client.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('ox_appearance') ~= 'started' then return end 2 | 3 | appearance = {} 4 | 5 | appearance.saveSkin = function() 6 | local appearance = exports['fivem-appearance']:getPedAppearance(cache.ped) 7 | if appearance then 8 | TriggerServerEvent('ox_appearance:save', appearance) 9 | return true 10 | end 11 | 12 | return false 13 | end -------------------------------------------------------------------------------- /shared/locale.lua: -------------------------------------------------------------------------------- 1 | Language = {} 2 | 3 | function _L(name, args) 4 | if name then 5 | local str = Language[Config.Language][name] 6 | if str then 7 | return string.format(str, (args ~= nil and table.unpack(args) or nil)) 8 | else 9 | return "ERR_TRANSLATE_"..(name).."_404" 10 | end 11 | else 12 | return "ERR_TRANSLATE_404" 13 | end 14 | end -------------------------------------------------------------------------------- /bridge/appearance/fivem-appearance/client.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('fivem-appearance') ~= 'started' then return end 2 | 3 | appearance = {} 4 | 5 | appearance.saveSkin = function() 6 | local appearance = exports['fivem-appearance']:getPedAppearance(cache.ped) 7 | if appearance then 8 | TriggerServerEvent('fivem-appearance:save', appearance) 9 | return true 10 | end 11 | 12 | return false 13 | end -------------------------------------------------------------------------------- /bridge/framework/ox/server.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('ox_core') ~= 'started' then return end 2 | CreateThread(function() lib.load('@ox_core.imports.server') end) 3 | 4 | local framework = {} 5 | 6 | framework.getPlayerName = function(playerId) 7 | local player = Ox.GetPlayer(playerId) 8 | 9 | if player and player.charId then 10 | return player.firstName .. ' ' .. player.lastName 11 | end 12 | 13 | return GetPlayerName(playerId) 14 | end -------------------------------------------------------------------------------- /bridge/appearance/esx_skin/client.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('skinchanger') ~= 'started' or GetResourceState('esx_skin') ~= 'started' and GetResourceState('fivem-appearance') ~= 'started' then return end 2 | 3 | appearance = {} 4 | 5 | appearance.saveSkin = function() 6 | TriggerEvent('skinchanger:getSkin', function(getSkin) 7 | TriggerServerEvent('esx_skin:save', getSkin) 8 | return true 9 | end) 10 | 11 | return false 12 | end -------------------------------------------------------------------------------- /bridge/appearance/illenium-appearance/client.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('illenium-appearance') ~= 'started' then return end 2 | 3 | appearance = {} 4 | 5 | appearance.saveSkin = function() 6 | local appearance = exports['illenium-appearance']:getPedAppearance(cache.ped) 7 | if appearance then 8 | TriggerServerEvent('illenium-appearance:server:saveAppearance', appearance) 9 | return true 10 | end 11 | 12 | return false 13 | end -------------------------------------------------------------------------------- /bridge/framework/qb/server.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('qb-core') ~= 'started' then return end 2 | QBCore = exports['qb-core']:GetCoreObject() 3 | 4 | local framework = {} 5 | 6 | framework.getPlayerName = function(playerId) 7 | local player = QBCore.Functions.GetPlayer(playerId) 8 | 9 | if player then 10 | return player.PlayerData.charinfo.firstname .. ' ' .. player.PlayerData.charinfo.lastname 11 | end 12 | 13 | return GetPlayerName(playerId) 14 | end -------------------------------------------------------------------------------- /bridge/appearance/qb_clothing/client.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('qb-clothing') ~= 'started' then return end 2 | error('qb_clothing is not supported!') 3 | 4 | appearance = {} 5 | 6 | appearance.saveSkin = function() 7 | local appearance = exports['fivem-appearance']:getPedAppearance(cache.ped) 8 | local model = IsPedMale(cache.ped) and 'mp_m_freemode_01' or 'mp_f_freemode_01' 9 | if appearance and model then 10 | TriggerServerEvent('qb-clothing:saveSkin', model , appearance) 11 | return true 12 | end 13 | 14 | return false 15 | end -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | game 'gta5' 3 | lua54 'yes' 4 | 5 | author 'LikeManTV' 6 | description 'Metadata-based clothing system.' 7 | version '1.0.1' 8 | 9 | shared_scripts { 10 | '@ox_lib/init.lua', 11 | 'config.lua', 12 | 'shared/locale.lua', 13 | 'locales/*.lua' 14 | } 15 | 16 | client_scripts { 17 | "bridge/**/**/**/client.lua", 18 | 'client/cl_class.lua', 19 | 'client/cl_clothing.lua', 20 | 'client/cl_gear.lua' 21 | } 22 | 23 | server_scripts { 24 | "bridge/**/**/**/server.lua", 25 | 'server/sv_clothing.lua' 26 | } 27 | 28 | files { 29 | 'data/arms.json', 30 | 'data/gloves.json', 31 | 'data/torso_male.json', 32 | 'data/torso_female.json' 33 | } -------------------------------------------------------------------------------- /bridge/inventory/ox_inventory/server.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('ox_inventory') ~= 'started' then return end 2 | local ox_inventory = exports.ox_inventory 3 | 4 | inventory = {} 5 | 6 | inventory.AddItem = function(source, item, amount, metadata) 7 | if metadata then 8 | ox_inventory:AddItem(source, item, amount, metadata) 9 | else 10 | ox_inventory:AddItem(source, item, amount) 11 | end 12 | end 13 | 14 | inventory.RemoveItem = function(source, item, amount, metadata, slot) 15 | ox_inventory:RemoveItem(source, item, amount, metadata, slot) 16 | end 17 | 18 | inventory.GetSlot = function(source, slot) 19 | return ox_inventory:GetSlot(source, slot) 20 | end 21 | 22 | inventory.SetMetadata = function(source, slot, metadata) 23 | ox_inventory:SetMetadata(source, slot, metadata) 24 | end 25 | 26 | inventory.GetActiveInventory = function() 27 | return 'ox_inventory' 28 | end -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: likemantv 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | thanks_dev: # Replace with a single thanks.dev username 15 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 16 | -------------------------------------------------------------------------------- /bridge/inventory/qb-inventory/server.lua: -------------------------------------------------------------------------------- 1 | if GetResourceState('qb-inventory') ~= 'started' then return end 2 | local qbinventory = exports['qb-inventory'] 3 | 4 | inventory = {} 5 | 6 | inventory.AddItem = function(source, item, amount, metadata) 7 | local player = QBCore.Functions.GetPlayer(source) 8 | if metadata then 9 | player.Functions.AddItem(source, item, amount, metadata) 10 | else 11 | player.Functions.AddItem(source, item, amount) 12 | end 13 | TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items[item], "add") 14 | end 15 | 16 | inventory.RemoveItem = function(source, item, amount, metadata, slot) 17 | local player = QBCore.Functions.GetPlayer(source) 18 | player.Functions.RemoveItem(source, item, amount, metadata, slot) 19 | TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items[item], "remove") 20 | end 21 | 22 | inventory.GetSlot = function(source, slot) 23 | return qbinventory:GetItemBySlot(source, slot) 24 | end 25 | 26 | inventory.SetMetadata = function(source, slot, metadata) 27 | qbinventory:SetItemData(source, slot, 'label', metadata) 28 | end 29 | 30 | inventory.GetActiveInventory = function() 31 | return 'qb-inventory' 32 | end -------------------------------------------------------------------------------- /data/arms.json: -------------------------------------------------------------------------------- 1 | { 2 | "Male": { 3 | "0": 15, 4 | "1": 15, 5 | "2": 15, 6 | "3": 15, 7 | "4": 15, 8 | "5": 15, 9 | "6": 15, 10 | "7": 15, 11 | "8": 15, 12 | "9": 15, 13 | "10": 15, 14 | "11": 15, 15 | "12": 15, 16 | "13": 15, 17 | "14": 15, 18 | "19": 29, 19 | "20": 29, 20 | "21": 29, 21 | "22": 29, 22 | "23": 29, 23 | "24": 29, 24 | "25": 29, 25 | "26": 29, 26 | "27": 29, 27 | "28": 29, 28 | "30": 40, 29 | "31": 40, 30 | "32": 40, 31 | "33": 40, 32 | "34": 40, 33 | "35": 40, 34 | "36": 40, 35 | "37": 40, 36 | "38": 40, 37 | "39": 40, 38 | "41": 51, 39 | "42": 51, 40 | "43": 51, 41 | "44": 51, 42 | "45": 51, 43 | "46": 51, 44 | "47": 51, 45 | "48": 51, 46 | "49": 51, 47 | "50": 51, 48 | "52": 62, 49 | "53": 62, 50 | "54": 62, 51 | "55": 62, 52 | "56": 62, 53 | "57": 62, 54 | "58": 62, 55 | "59": 62, 56 | "60": 62, 57 | "61": 62, 58 | "63": 73, 59 | "64": 73, 60 | "65": 73, 61 | "66": 73, 62 | "67": 73, 63 | "68": 73, 64 | "69": 73, 65 | "70": 73, 66 | "71": 73, 67 | "72": 73, 68 | "74": 84, 69 | "75": 84, 70 | "76": 84, 71 | "77": 84, 72 | "78": 84, 73 | "79": 84, 74 | "80": 84, 75 | "81": 84, 76 | "82": 84, 77 | "83": 84, 78 | "85": 95, 79 | "86": 95, 80 | "87": 95, 81 | "88": 95, 82 | "89": 95, 83 | "90": 95, 84 | "91": 95, 85 | "92": 95, 86 | "93": 95, 87 | "94": 95 88 | }, 89 | "Female": { 90 | 91 | } 92 | } -------------------------------------------------------------------------------- /locales/fr.lua: -------------------------------------------------------------------------------- 1 | Language["fr"] = { 2 | 3 | menu_title = 'MENU VÊTEMENTS', 4 | menu_clothing_title = 'VÊTEMENTS', 5 | menu_props_title = 'ACCESSOIRES', 6 | 7 | take_off_outfit = 'Retirer la tenue', 8 | take_off_outfit_other = 'Retirer la tenue d’un joueur', 9 | take_off_clothes = 'Retirer les vêtements', 10 | take_off_props = 'Retirer un accessoire', 11 | 12 | default_outfit_label = 'Tenue', 13 | top_label = 'Haut', 14 | mask_label = 'Masque', 15 | gloves_label = 'Gants', 16 | pants_label = 'Pantalon', 17 | backpack_label = 'Sac à dos', 18 | shoes_label = 'Chaussures', 19 | chain_label = 'Collier', 20 | vest_label = 'Gilet', 21 | badges_label = 'Décalcomanies', 22 | hat_label = 'Chapeau', 23 | glasses_label = 'Lunettes', 24 | earrings_label = 'Accessoire d’oreille', 25 | watch_label = 'Montre', 26 | bracelet_label = 'Bracelet', 27 | 28 | male_outfit = 'Tenue masculine', 29 | female_outfit = 'Tenue féminine', 30 | 31 | male_clothes = 'Vêtements masculins', 32 | female_clothes = 'Vêtements féminins', 33 | 34 | male_prop = 'Accessoire masculin', 35 | female_prop = 'Accessoire féminin', 36 | 37 | created_by = 'Créé par :', 38 | tearing_clothes = 'Déchirure des vêtements..', 39 | toggle_nvg = 'Activer/Désactiver la vision nocturne', 40 | 41 | new_request_title = 'Nouvelle demande', 42 | new_request_desc = 'Un joueur souhaite retirer vos vêtements.', 43 | request_sent = 'Demande envoyée avec succès.', 44 | 45 | rename_title = 'RENOMMER LA TENUE', 46 | rename_text = 'Entrez un nouveau nom..', 47 | rename_successful = 'Renommage effectué avec succès !', 48 | 49 | error_fitcheck = 'Ces vêtements ne vous vont pas !', 50 | error_no_clothes = 'Vous n’avez rien à retirer !', 51 | error_outfit_name = 'Vous devez spécifier le nom de la tenue !', 52 | error_no_permission = 'Vous n’avez pas la permission de faire cela !', 53 | error_tearing_disabled = 'La déchirure des vêtements est désactivée !', 54 | error_nobody_around = 'Aucun joueur à proximité !', 55 | } 56 | -------------------------------------------------------------------------------- /locales/cs.lua: -------------------------------------------------------------------------------- 1 | Language["cs"] = { 2 | -- MENU TITLES 3 | menu_title = 'MENU S OBLEČENÍM', 4 | menu_clothing_title = 'OBLEČENÍ', 5 | menu_props_title = 'DOPLŇKY', 6 | 7 | -- MENU CATEGORIES 8 | take_off_outfit = 'Sundat outfit', 9 | take_off_outfit_other = 'Sundat outfit hráči', 10 | take_off_clothes = 'Sundat část oblečení', 11 | take_off_props = 'Sundat doplněk', 12 | 13 | -- MENU & ITEMS 14 | default_outfit_label = 'Outfit', 15 | top_label = 'Vršek', 16 | mask_label = 'Maska', 17 | gloves_label = 'Rukavice', 18 | pants_label = 'Kalhoty', 19 | backpack_label = 'Batoh', 20 | shoes_label = 'Boty', 21 | chain_label = 'Náhrdelník', 22 | vest_label = 'Vesta', 23 | badges_label = 'Nášivky', 24 | hat_label = 'Čepice', 25 | glasses_label = 'Brýle', 26 | earrings_label = 'Ušní doplněk', 27 | watch_label = 'Hodinky', 28 | bracelet_label = 'Náramek', 29 | 30 | male_outfit = 'Mužský outfit', 31 | female_outfit = 'Ženský outfit', 32 | 33 | male_clothes = 'Mužské oblečení', 34 | female_clothes = 'Ženské oblečení', 35 | 36 | male_prop = 'Mužský doplněk', 37 | female_prop = 'Ženský doplněk', 38 | 39 | -- MISC 40 | created_by = 'Vytvořil(a):', 41 | tearing_clothes = 'Trháš oblečení..', 42 | toggle_nvg = 'Zapnout/Vypnout NVG', 43 | 44 | -- REQUEST 45 | new_request_title = 'Nová žádost', 46 | new_request_desc = 'Hráč vám chce sundat oblečení.', 47 | request_sent = 'Žádost byla úspěšně odeslána.', 48 | 49 | -- RENAMING 50 | rename_title = 'PŘEJMENOVAT OUTFIT', 51 | rename_text = 'Zadejte nový název..', 52 | rename_successful = 'Úspěšně přejmenováno!', 53 | 54 | -- ERRORS 55 | error_fitcheck = 'Toto oblečení na vás nesedí!', 56 | error_no_clothes = 'Nemáte co sundat!', 57 | error_outfit_name = 'Musíte specifikovat název outfitu!', 58 | error_no_permission = 'Na toto nemáte povolení!', 59 | error_tearing_disabled = 'Trhání oblečení je vypnuto!', 60 | error_nobody_around = 'V okolí není žádný hráč!', 61 | } -------------------------------------------------------------------------------- /locales/en.lua: -------------------------------------------------------------------------------- 1 | Language["en"] = { 2 | -- MENU TITLES 3 | menu_title = 'CLOTHING MENU', 4 | menu_clothing_title = 'CLOTHES', 5 | menu_props_title = 'ACCESSORIES', 6 | 7 | -- MENU CATEGORIES 8 | take_off_outfit = 'Take off outfit', 9 | take_off_outfit_other = 'Take off player outfit', 10 | take_off_clothes = 'Take off clothes', 11 | take_off_props = 'Take off accessory', 12 | 13 | -- MENU & ITEMS 14 | default_outfit_label = 'Outfit', 15 | top_label = 'Top', 16 | mask_label = 'Mask', 17 | gloves_label = 'Gloves', 18 | pants_label = 'Pants', 19 | backpack_label = 'Backpack', 20 | shoes_label = 'Shoes', 21 | chain_label = 'Necklace', 22 | vest_label = 'Vest', 23 | badges_label = 'Decals', 24 | hat_label = 'Hat', 25 | glasses_label = 'Glasses', 26 | earrings_label = 'Ear accessory', 27 | watch_label = 'Watch', 28 | bracelet_label = 'Bracelet', 29 | 30 | male_outfit = 'Male outfit', 31 | female_outfit = 'Female outfit', 32 | 33 | male_clothes = 'Male clothes', 34 | female_clothes = 'Female clothes', 35 | 36 | male_prop = 'Male accessory', 37 | female_prop = 'Female accessory', 38 | 39 | -- MISC 40 | created_by = 'Created by:', 41 | tearing_clothes = 'Tearing clothes..', 42 | toggle_nvg = 'Toggle NVG', 43 | 44 | -- REQUEST 45 | new_request_title = 'New Request', 46 | new_request_desc = 'A player wants to take off your clothes.', 47 | request_sent = 'Request was successfully sent.', 48 | 49 | -- RENAMING 50 | rename_title = 'RENAME OUTFIT', 51 | rename_text = 'Enter a new name..', 52 | rename_successful = 'Successfuly renamed!', 53 | 54 | -- ERRORS 55 | error_fitcheck = 'These clothes don\'t fit you!', 56 | error_no_clothes = 'You have nothing to take off!', 57 | error_outfit_name = 'You must specify the name of the outfit!', 58 | error_no_permission = 'You don\'t have permission to do this!', 59 | error_tearing_disabled = 'Tearing clothes is disabled!', 60 | error_nobody_around = 'There are no players around!', 61 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ⚠️ Upcoming Rework 2 | We are currently working on a comprehensive rework of the system to address several known issues and improve overall performance, reliability, and usability. 3 | Stay tuned for more updates soon! 4 | 5 | # CLOTHING 6 | [![GitHub release](https://img.shields.io/github/v/release/LikeManTV/clothing.svg)](https://github.com/LikeManTV/clothing/releases/latest) 7 | [![GitHub license](https://img.shields.io/github/license/LikeManTV/clothing.svg)](LICENSE) 8 | Discord Status 9 | 10 | The system allows for easy management of clothing using items, enabling players to store and organize their acquired pieces of clothing for quick access and outfit changes. It ensures that players have a convenient way of changing and combining their clothes within the game. 11 | 12 | Please report any problems by creating a new issue or join the Discord server.
13 | Also feel free to make a PR. 14 | 15 | ## 🔥 Features 16 | - Supports ESX, QB & OX 17 | - Clothes as items (using metadata) 18 | - Menu for taking off clothes 19 | - Context menu 20 | - Radial menu 21 | - Option to fix mask and hat clipping issues 22 | - Whitelist / blacklist for certain IDs 23 | - Functional gear (Night vision, etc..) 24 | - Special clothing/outfits 25 | - Give certain clothing proofs such as fire-proof 26 | - Outfit renaming 27 | - Tearing clothes 28 | - Commands for faster usage 29 | - Localization 30 | - Customizable notifications 31 | 32 | ## ⏰ Planned Features 33 | - Bridge system for custom menu integrations. 34 | - RedM support. 35 | 36 | ## 🛠️ Dependencies 37 | - [ox_lib](https://github.com/overextended/ox_lib) 38 | - [ox_inventory](https://github.com/overextended/ox_inventory) / [qb-inventory](https://github.com/qbcore-framework/qb-inventory) 39 | - [esx_skin](https://github.com/esx-framework/esx_core/tree/main/%5Bcore%5D/esx_skin) & [skinchanger](https://github.com/esx-framework/esx_core/tree/main/%5Bcore%5D/skinchanger) / [fivem-appearance](https://github.com/pedr0fontoura/fivem-appearance) / [illenium-appearance](https://github.com/iLLeniumStudios/illenium-appearance) / [qb-clothing](https://github.com/qbcore-framework/qb-clothing) 40 | 41 | ## 📲 Installation 42 | 1. Download latest release or source code 43 | 2. Extract the .zip file 44 | 3. Copy the folder to your server resources folder 45 | 4. Add `ensure clothing` to your server.cfg 46 | 5. Restart the server 47 | 48 | ## 📌 Required Items 49 | ``` 50 | ['clothes'] = { 51 | label = 'Clothes', 52 | weight = 100, 53 | stack = false, 54 | allowArmed = false, 55 | client = { 56 | export = 'clothing.clothes' 57 | }, 58 | buttons = { 59 | { 60 | label = 'Tear', 61 | action = function(slot) 62 | TriggerServerEvent('clothing:sv:tearClothes', slot) 63 | end 64 | } 65 | } 66 | }, 67 | 68 | ['outfit'] = { 69 | label = 'Outfit', 70 | stack = false, 71 | client = { 72 | export = 'clothing.clothes' 73 | }, 74 | buttons = { 75 | { 76 | label = 'Rename', 77 | action = function(slot) 78 | TriggerServerEvent('clothing:sv:renameOutfit', slot) 79 | end 80 | }, 81 | { 82 | label = 'Tear', 83 | action = function(slot) 84 | TriggerServerEvent('clothing:sv:tearClothes', slot) 85 | end 86 | } 87 | } 88 | }, 89 | ``` 90 | 91 | ## 📝 Exports (client) 92 | - `isWearingOutfit(name)` - returns outfit name and outfit label or false 93 | - `isWearing(index)` - returns component and texture or false 94 | - `isWearingProp(index)` - returns prop and texture or false 95 | - `isNaked()` - returns true if player doesn't have any clothes based on the config 96 | - `getPedSex(ped)` - returns 'Male' or 'Female' regarding the ped gender 97 | 98 | ## 📝 Exports (server) 99 | -------------------------------------------------------------------------------- /client/cl_gear.lua: -------------------------------------------------------------------------------- 1 | -- Special outfits 2 | CreateThread(function() 3 | local set = false 4 | while Config.EnableSpecialOutfits do 5 | local outfitName, outfitLabel = clothing.isWearingOutfit() 6 | if DoesEntityExist(cache.ped) and not IsEntityDead(cache.ped) then 7 | for _, data in pairs(Config.SpecialOutfits) do 8 | if outfitName or outfitLabel then 9 | if data.label == outfitLabel then 10 | if data.proofs then 11 | if not set then 12 | SetEntityProofs(cache.ped, table.unpack(data.proofs)) 13 | set = true 14 | end 15 | if outfitName == 'scuba' then 16 | SetEnableScuba(cache.ped, true) 17 | else 18 | SetEnableScuba(cache.ped, false) 19 | end 20 | else 21 | if set then 22 | SetEntityProofs(cache.ped, false, false, false, false, false, false, false, false) 23 | set = false 24 | end 25 | end 26 | end 27 | else 28 | if set then 29 | SetEntityProofs(cache.ped, false, false, false, false, false, false, false, false) 30 | set = false 31 | end 32 | end 33 | end 34 | end 35 | Wait(1000) 36 | end 37 | end) 38 | 39 | -- Functional gear 40 | if Config.FunctionalGear.enabled then 41 | local nightvision = true 42 | lib.addKeybind({ 43 | name = 'clothing_nvg', 44 | description = _L('toggle_nvg'), 45 | defaultKey = Config.FunctionalGear.useKey, 46 | onPressed = function(self) 47 | local nvg, texture = clothing.isWearingProp(0) 48 | if nvg then 49 | nightvision = not nightvision 50 | local isMale = IsPedModel(cache.ped, "mp_m_freemode_01") 51 | 52 | if nightvision and nvg == 116 or nvg == 115 then 53 | if lib.progressCircle({ 54 | duration = Config.Animations.take_off[1].duration, 55 | position = 'bottom', 56 | useWhileDead = false, 57 | canCancel = true, 58 | disable = { 59 | combat = true 60 | }, 61 | anim = { 62 | dict = Config.Animations.take_off[1].dict, 63 | clip = Config.Animations.take_off[1].clip, 64 | flag = Config.Animations.take_off[1].flag 65 | } 66 | }) then 67 | if isMale then 68 | SetPedPropIndex(cache.ped, 0, 117, texture, true) 69 | else 70 | SetPedPropIndex(cache.ped, 0, 116, texture, true) 71 | end 72 | SetNightvision(false) 73 | end 74 | elseif not nightvision and nvg == 117 or nvg == 116 then 75 | if lib.progressCircle({ 76 | duration = Config.Animations.put_on[1].duration, 77 | position = 'bottom', 78 | useWhileDead = false, 79 | canCancel = true, 80 | disable = { 81 | combat = true 82 | }, 83 | anim = { 84 | dict = Config.Animations.put_on[1].dict, 85 | clip = Config.Animations.put_on[1].clip, 86 | flag = Config.Animations.put_on[1].flag 87 | } 88 | }) then 89 | if isMale then 90 | SetPedPropIndex(cache.ped, 0, 116, texture, true) 91 | else 92 | SetPedPropIndex(cache.ped, 0, 115, texture, true) 93 | end 94 | SetNightvision(true) 95 | end 96 | end 97 | end 98 | end 99 | }) 100 | end -------------------------------------------------------------------------------- /server/sv_clothing.lua: -------------------------------------------------------------------------------- 1 | -- █▀▀ █░█ █▀▀ █▄░█ ▀█▀ █▀ 2 | -- ██▄ ▀▄▀ ██▄ █░▀█ ░█░ ▄█ 3 | 4 | RegisterServerEvent('clothing:sv:giveOutfit', function(data, outfit) 5 | local source = source 6 | local gender = data.sex == 'Male' and _L('male_outfit') or _L('female_outfit') 7 | local metadata = {label = _L('default_outfit_label'), part = 'outfit', image = 'outfit', sex = data.sex, description = string.format('%s', gender)} 8 | 9 | if outfit then 10 | metadata = {label = outfit, part = 'outfit', image = 'outfit', sex = data.sex} 11 | end 12 | 13 | if Config.CreatedByDesc then 14 | local name = framework.getPlayerName(source) 15 | metadata['description'] = string.format('%s \n%s', gender, _L('created_by')..' '..name) 16 | end 17 | 18 | if Config.MarkUnnamedOutfits then 19 | metadata['type'] = Config.MarkText 20 | end 21 | 22 | metadata.comps = {} 23 | metadata.props = {} 24 | for _,v in pairs(data.outfit.comps) do 25 | metadata.comps[v.index] = {} 26 | metadata.comps[v.index]['index'] = v.index 27 | metadata.comps[v.index]['drawable'] = v.drawable 28 | metadata.comps[v.index]['texture'] = v.texture 29 | metadata.comps[v.index]['palette'] = v.palette 30 | end 31 | for _,v in pairs(data.outfit.props) do 32 | metadata.props[v.index] = {} 33 | metadata.props[v.index]['index'] = v.index 34 | metadata.props[v.index]['drawable'] = v.drawable 35 | metadata.props[v.index]['texture'] = v.texture 36 | end 37 | Wait(100) 38 | 39 | inventory.AddItem(source, 'outfit', 1, metadata) 40 | end) 41 | 42 | RegisterServerEvent('clothing:sv:giveTorso', function(data) 43 | local source = source 44 | local gender = data.sex == 'Male' and _L('male_clothes') or _L('female_clothes') 45 | local metadata = {label = _L('top_label'), part = 'torso', image = 'shirt', sex = data.sex, description = string.format('%s', gender)} 46 | 47 | if Config.CreatedByDesc then 48 | local name = framework.getPlayerName(source) 49 | metadata['description'] = string.format('%s \n%s', gender, _L('created_by')..' '..name) 50 | end 51 | 52 | for _,v in pairs(data.torso) do 53 | metadata[v.index] = {} 54 | metadata[v.index]['index'] = v.index 55 | metadata[v.index]['drawable'] = v.drawable 56 | metadata[v.index]['texture'] = v.texture 57 | metadata[v.index]['palette'] = v.palette 58 | end 59 | Wait(100) 60 | 61 | inventory.AddItem(source, 'clothes', 1, metadata) 62 | end) 63 | 64 | RegisterServerEvent('clothing:sv:giveClothes', function(data) 65 | local source = source 66 | local gender = data.sex == 'Male' and _L('male_clothes') or _L('female_clothes') 67 | local metadata = {part = 'clothes', sex = data.sex, description = string.format('%s', gender), index = data.index, drawable = data.drawable, texture = data.texture} 68 | 69 | if Config.CreatedByDesc then 70 | local name = framework.getPlayerName(source) 71 | metadata['description'] = string.format('%s \n%s', gender, _L('created_by')..' '..name) 72 | end 73 | 74 | if Config.ClothingIdDesc then 75 | metadata['type'] = string.format('%s | %s', data.drawable, data.texture) 76 | end 77 | 78 | local items = { 79 | [1] = { label = _L('mask_label'), image = 'mask' }, 80 | [3] = { label = _L('gloves_label'), image = 'gloves' }, 81 | [4] = { label = _L('pants_label'), image = 'pants' }, 82 | [5] = { label = _L('backpack_label'), image = 'bag' }, 83 | [6] = { label = _L('shoes_label'), image = 'shoes' }, 84 | [7] = { label = _L('chain_label'), image = 'chain' }, 85 | [9] = { label = _L('vest_label'), image = 'armour' }, 86 | [10] = { label = _L('badges_label'), image = 'badges' } 87 | } 88 | local mapping = items[data.index] 89 | 90 | if mapping then 91 | metadata['label'] = mapping.label 92 | metadata['image'] = mapping.image 93 | inventory.AddItem(source, 'clothes', 1, metadata) 94 | end 95 | end) 96 | 97 | RegisterServerEvent('clothing:sv:giveProp', function(data) 98 | local source = source 99 | local gender = data.sex == 'Male' and _L('male_prop') or _L('female_prop') 100 | local metadata = {part = 'prop', sex = data.sex, description = string.format('%s', gender), index = data.index, drawable = data.drawable, texture = data.texture} 101 | 102 | if Config.CreatedByDesc then 103 | local name = framework.getPlayerName(source) 104 | metadata['description'] = string.format('%s \n%s', gender, _L('created_by')..' '..name) 105 | end 106 | 107 | if Config.ClothingIdDesc then 108 | metadata['type'] = string.format('%s | %s', data.drawable, data.texture) 109 | end 110 | 111 | local items = { 112 | [0] = { label = _L('hat_label'), image = 'hat' }, 113 | [1] = { label = _L('glasses_label'), image = 'glasses' }, 114 | [2] = { label = _L('earrings_label'), image = 'ears' }, 115 | [6] = { label = _L('watch_label'), image = 'watch' }, 116 | [7] = { label = _L('bracelet_label'), image = 'bracelet' } 117 | } 118 | local mapping = items[data.index] 119 | 120 | if mapping then 121 | metadata['label'] = mapping.label 122 | metadata['image'] = mapping.image 123 | inventory.AddItem(source, 'clothes', 1, metadata) 124 | end 125 | end) 126 | 127 | RegisterServerEvent('clothing:sv:removeItem', function(metadata, slot) 128 | local source = source 129 | inventory.RemoveItem(source, 'clothes', 1, metadata, slot) 130 | end) 131 | 132 | RegisterServerEvent('clothing:sv:requestOutfit', function(target) 133 | TriggerClientEvent('clothing:cl:requestOutfit', target) 134 | end) 135 | 136 | RegisterServerEvent('clothing:sv:tearClothes', function(slot) 137 | local source = source 138 | 139 | if Config.TearClothes then 140 | local progress = lib.callback.await('clothing:cl:tearingProgress', source, _L('tearing_clothes'), data.duration, 'amb@prop_human_parking_meter@male@base', 'base') 141 | if progress then 142 | local slotData = inventory.GetSlot(source, slot) 143 | 144 | if inventory.GetActiveInventory() == 'ox_inventory' then 145 | for _type, data in pairs(Config.Tearing) do 146 | if slotData.metadata.part and slotData.metadata.part == _type then 147 | inventory.RemoveItem(source, slotData.name, 1, slotData.metadata, slot) 148 | inventory.AddItem(source, data.give, data.amount) 149 | end 150 | end 151 | else 152 | for _type, data in pairs(Config.Tearing) do 153 | if slotData.info.part and slotData.info.part == _type then 154 | inventory.RemoveItem(source, slotData.name, 1, slotData.info, slot) 155 | inventory.AddItem(source, data.give, data.amount) 156 | end 157 | end 158 | end 159 | end 160 | end 161 | end) 162 | 163 | RegisterServerEvent('clothing:sv:renameOutfit', function(slot) 164 | if Config.OutfitRenaming then 165 | local source = source 166 | local slotData = inventory.GetSlot(source, slot) 167 | 168 | if inventory.GetActiveInventory() == 'ox_inventory' then 169 | local newName = lib.callback.await('clothing:cl:renameOutfit', source, slotData.metadata.label) 170 | TriggerClientEvent('ox_inventory:closeInventory', source) 171 | slotData.metadata.label = newName 172 | inventory.SetMetadata(source, slot, slotData.metadata) 173 | else 174 | local newName = lib.callback.await('clothing:cl:renameOutfit', source, slotData.label) 175 | inventory.SetMetadata(source, slot, newName) 176 | end 177 | end 178 | end) 179 | -------------------------------------------------------------------------------- /data/gloves.json: -------------------------------------------------------------------------------- 1 | { 2 | "Male": { 3 | "16": 4, 4 | "17": 4, 5 | "18": 4, 6 | "19": 0, 7 | "20": 1, 8 | "21": 2, 9 | "22": 4, 10 | "23": 5, 11 | "24": 6, 12 | "25": 8, 13 | "26": 11, 14 | "27": 12, 15 | "28": 14, 16 | "29": 15, 17 | "30": 0, 18 | "31": 1, 19 | "32": 2, 20 | "33": 4, 21 | "34": 5, 22 | "35": 6, 23 | "36": 8, 24 | "37": 11, 25 | "38": 12, 26 | "39": 14, 27 | "40": 15, 28 | "41": 0, 29 | "42": 1, 30 | "43": 2, 31 | "44": 4, 32 | "45": 5, 33 | "46": 6, 34 | "47": 8, 35 | "48": 11, 36 | "49": 12, 37 | "50": 14, 38 | "51": 15, 39 | "52": 0, 40 | "53": 1, 41 | "54": 2, 42 | "55": 4, 43 | "56": 5, 44 | "57": 6, 45 | "58": 8, 46 | "59": 11, 47 | "60": 12, 48 | "61": 14, 49 | "62": 15, 50 | "63": 0, 51 | "64": 1, 52 | "65": 2, 53 | "66": 4, 54 | "67": 5, 55 | "68": 6, 56 | "69": 8, 57 | "70": 11, 58 | "71": 12, 59 | "72": 14, 60 | "73": 15, 61 | "74": 0, 62 | "75": 1, 63 | "76": 2, 64 | "77": 4, 65 | "78": 5, 66 | "79": 6, 67 | "80": 8, 68 | "81": 11, 69 | "82": 12, 70 | "83": 14, 71 | "84": 15, 72 | "85": 0, 73 | "86": 1, 74 | "87": 2, 75 | "88": 4, 76 | "89": 5, 77 | "90": 6, 78 | "91": 8, 79 | "92": 11, 80 | "93": 12, 81 | "94": 14, 82 | "95": 15, 83 | "96": 4, 84 | "97": 4, 85 | "98": 4, 86 | "99": 0, 87 | "100": 1, 88 | "101": 2, 89 | "102": 4, 90 | "103": 5, 91 | "104": 6, 92 | "105": 8, 93 | "106": 11, 94 | "107": 12, 95 | "108": 14, 96 | "109": 15, 97 | "110": 4, 98 | "111": 4, 99 | "115": 112, 100 | "116": 112, 101 | "117": 112, 102 | "118": 112, 103 | "119": 112, 104 | "120": 112, 105 | "121": 112, 106 | "122": 113, 107 | "123": 113, 108 | "124": 113, 109 | "125": 113, 110 | "126": 113, 111 | "127": 113, 112 | "128": 113, 113 | "129": 114, 114 | "130": 114, 115 | "131": 114, 116 | "132": 114, 117 | "133": 114, 118 | "134": 114, 119 | "135": 114, 120 | "136": 15, 121 | "137": 15, 122 | "138": 0, 123 | "139": 1, 124 | "140": 2, 125 | "141": 4, 126 | "142": 5, 127 | "143": 6, 128 | "144": 8, 129 | "145": 11, 130 | "146": 12, 131 | "147": 14, 132 | "148": 112, 133 | "149": 113, 134 | "150": 114, 135 | "151": 0, 136 | "152": 1, 137 | "153": 2, 138 | "154": 4, 139 | "155": 5, 140 | "156": 6, 141 | "157": 8, 142 | "158": 11, 143 | "159": 12, 144 | "160": 14, 145 | "161": 112, 146 | "162": 113, 147 | "163": 114, 148 | "165": 4, 149 | "166": 4, 150 | "167": 4 151 | }, 152 | "Female": { 153 | "16": 11, 154 | "17": 3, 155 | "18": 3, 156 | "19": 3, 157 | "20": 0, 158 | "21": 1, 159 | "22": 2, 160 | "23": 3, 161 | "24": 4, 162 | "25": 5, 163 | "26": 6, 164 | "27": 7, 165 | "28": 9, 166 | "29": 11, 167 | "30": 12, 168 | "31": 14, 169 | "32": 15, 170 | "33": 0, 171 | "34": 1, 172 | "35": 2, 173 | "36": 3, 174 | "37": 4, 175 | "38": 5, 176 | "39": 6, 177 | "40": 7, 178 | "41": 9, 179 | "42": 11, 180 | "43": 12, 181 | "44": 14, 182 | "45": 15, 183 | "46": 0, 184 | "47": 1, 185 | "48": 2, 186 | "49": 3, 187 | "50": 4, 188 | "51": 5, 189 | "52": 6, 190 | "53": 7, 191 | "54": 9, 192 | "55": 11, 193 | "56": 12, 194 | "57": 14, 195 | "58": 15, 196 | "59": 0, 197 | "60": 1, 198 | "61": 2, 199 | "62": 3, 200 | "63": 4, 201 | "64": 5, 202 | "65": 6, 203 | "66": 7, 204 | "67": 9, 205 | "68": 11, 206 | "69": 12, 207 | "70": 14, 208 | "71": 15, 209 | "72": 0, 210 | "73": 1, 211 | "74": 2, 212 | "75": 3, 213 | "76": 4, 214 | "77": 5, 215 | "78": 6, 216 | "79": 7, 217 | "80": 9, 218 | "81": 11, 219 | "82": 12, 220 | "83": 14, 221 | "84": 15, 222 | "85": 0, 223 | "86": 1, 224 | "87": 2, 225 | "88": 3, 226 | "89": 4, 227 | "90": 5, 228 | "91": 6, 229 | "92": 7, 230 | "93": 9, 231 | "94": 11, 232 | "95": 12, 233 | "96": 14, 234 | "97": 15, 235 | "98": 0, 236 | "99": 1, 237 | "100": 2, 238 | "101": 3, 239 | "102": 4, 240 | "103": 5, 241 | "104": 6, 242 | "105": 7, 243 | "106": 9, 244 | "107": 11, 245 | "108": 12, 246 | "109": 14, 247 | "110": 15, 248 | "111": 3, 249 | "112": 3, 250 | "113": 3, 251 | "114": 0, 252 | "115": 1, 253 | "116": 2, 254 | "117": 3, 255 | "118": 4, 256 | "119": 5, 257 | "120": 6, 258 | "121": 7, 259 | "122": 9, 260 | "123": 11, 261 | "124": 12, 262 | "125": 14, 263 | "126": 15, 264 | "127": 3, 265 | "128": 3, 266 | "132": 129, 267 | "133": 129, 268 | "134": 129, 269 | "135": 129, 270 | "136": 129, 271 | "137": 129, 272 | "138": 129, 273 | "139": 130, 274 | "140": 130, 275 | "141": 130, 276 | "142": 130, 277 | "143": 130, 278 | "144": 130, 279 | "145": 130, 280 | "146": 131, 281 | "147": 131, 282 | "148": 131, 283 | "149": 131, 284 | "150": 131, 285 | "151": 131, 286 | "152": 131, 287 | "154": 153, 288 | "155": 153, 289 | "156": 153, 290 | "157": 153, 291 | "158": 153, 292 | "159": 153, 293 | "160": 153, 294 | "162": 161, 295 | "163": 161, 296 | "164": 161, 297 | "165": 161, 298 | "166": 161, 299 | "167": 161, 300 | "168": 161, 301 | "169": 15, 302 | "170": 15, 303 | "171": 0, 304 | "172": 1, 305 | "173": 2, 306 | "174": 3, 307 | "175": 4, 308 | "176": 5, 309 | "177": 6, 310 | "178": 7, 311 | "179": 9, 312 | "180": 11, 313 | "181": 12, 314 | "182": 14, 315 | "183": 129, 316 | "184": 130, 317 | "185": 131, 318 | "186": 153, 319 | "187": 0, 320 | "188": 1, 321 | "189": 2, 322 | "190": 3, 323 | "191": 4, 324 | "192": 5, 325 | "193": 6, 326 | "194": 7, 327 | "195": 9, 328 | "196": 11, 329 | "197": 12, 330 | "198": 14, 331 | "199": 129, 332 | "200": 130, 333 | "201": 131, 334 | "202": 153, 335 | "203": 161, 336 | "204": 161, 337 | "206": 3, 338 | "207": 3, 339 | "208": 3 340 | } 341 | } -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | Config.Language = 'en' -- Select your language here. [en / cs] 4 | Config.MenuKey = false -- Configure the default key to open clothing menu (false to disable). 5 | Config.UseRadial = false -- If true the radial menu will be used otherwise the context menu. 6 | Config.AddGlobalRadialOption = true -- If true the global radial menu will have an option to open clothing menu. 7 | 8 | Config.PlayerWontLoseProps = true -- Should player lose props (hat, glasses) on damage or not? 9 | Config.OutfitRenaming = true -- Should the option to rename outfits be enabled? 10 | Config.ClothingIdDesc = true -- Show ID of the clothing item in item description? (Doesn't work on QB) 11 | Config.CreatedByDesc = false -- Show name of person that created the item in the description? Requires a framework. 12 | 13 | -- █▀▀ █░░ █ █▀█ █▀█ █ █▄░█ █▀▀   █ █▀ █▀ █░█ █▀▀   █▀▀ █ ▀▄▀ 14 | -- █▄▄ █▄▄ █ █▀▀ █▀▀ █ █░▀█ █▄█   █ ▄█ ▄█ █▄█ ██▄   █▀░ █ █░█ 15 | 16 | Config.MaskFix = true -- Fix face clipping through certain masks? 17 | Config.MaskFilter = { 18 | enabled = false, -- Enable mask filter? Only specified masks will be whitelisted / blacklisted. 19 | blacklist = true, -- If false it will act as a whitelist. 20 | list = { -- Specify mask IDs for the filter here. 21 | -- 1, -- example 22 | } 23 | } 24 | 25 | Config.HatFix = true -- Fix hair clipping through certain hats? 26 | Config.HatFilter = { 27 | enabled = true, -- Enable hat filter? Only specified hats will be whitelisted / blacklisted. 28 | blacklist = true, -- If false it will act as a whitelist. 29 | list = { -- Specify hat IDs for the filter here. 30 | -- 1, -- example 31 | } 32 | } 33 | 34 | -- █▀▀ █░█ █▄░█ █▀▀ ▀█▀ █ █▀█ █▄░█ ▄▀█ █░░   █▀▀ █▀▀ ▄▀█ █▀█ 35 | -- █▀░ █▄█ █░▀█ █▄▄ ░█░ █ █▄█ █░▀█ █▀█ █▄▄   █▄█ ██▄ █▀█ █▀▄ 36 | 37 | Config.FunctionalGear = { 38 | enabled = true, -- Enable working NV goggles and other GTA stuff? 39 | useKey = 'H', -- Configure the default key to use gear. 40 | } 41 | 42 | -- ▀█▀ █▀▀ ▄▀█ █▀█ █ █▄░█ █▀▀ 43 | -- ░█░ ██▄ █▀█ █▀▄ █ █░▀█ █▄█ 44 | 45 | Config.TearClothes = false -- Enable tearing clothes? Will give an item if successful. 46 | Config.TearMinigameSettings = { enabled = false, keys = {'E'}, difficulty = {'easy'} } -- Enable minigame when tearing clothes? You can add multiple keys and difficulties. 47 | Config.Tearing = { 48 | ['outfit'] = {give = 'cloth', amount = 3, duration = 5000}, -- "give" = item to give when successful / "amount" = specifies the quantity player receives / "duration" = indicates the duration of the process 49 | ['torso'] = {give = 'cloth', amount = 2, duration = 5000}, 50 | ['clothes'] = {give = 'cloth', amount = 1, duration = 5000}, 51 | } 52 | 53 | -- █▀▀ █▀█ █▀▄▀█ █▀▄▀█ ▄▀█ █▄░█ █▀▄ █▀ 54 | -- █▄▄ █▄█ █░▀░█ █░▀░█ █▀█ █░▀█ █▄▀ ▄█ 55 | 56 | Config.Commands = { 57 | enabled = true, -- Enable or disable commands for taking off clothes faster. 58 | list = { -- You can rename your commands here. 59 | outfit = 'outfit', 60 | mask = 'mask', 61 | gloves = 'gloves', 62 | pants = 'pants', 63 | backpack = 'backpack', 64 | shoes = 'shoes', 65 | chain = 'chain', 66 | shirt = 'shirt', 67 | vest = 'vest', 68 | decals = 'decals', 69 | jacket = 'jacket', 70 | 71 | hat = 'hat', 72 | glasses = 'glasses', 73 | earrings = 'earrings', 74 | watch = 'watch', 75 | bracelet = 'bracelet' 76 | } 77 | } 78 | 79 | -- █▀▄▀█ █▀▀ █▄░█ █░█ 80 | -- █░▀░█ ██▄ █░▀█ █▄█ 81 | 82 | Config.Menu = { 83 | outfit = true, -- "Take off outfit" button. 84 | outfitOther = true, -- "Take off player outfit" button. 85 | 86 | clothes = { -- Clothing category 87 | enabled = true, -- Enable or disable category. 88 | options = { -- You can toggle individual buttons here. 89 | [1] = { -- mask 90 | title = 'mask_label', 91 | icon = 'masks-theater' 92 | }, 93 | [3] = { -- gloves 94 | title = 'gloves_label', 95 | icon = 'mitten' 96 | }, 97 | [4] = { -- pants 98 | title = 'pants_label', 99 | icon = 'socks' 100 | }, 101 | [5] = { -- Will not work if Config.AutomaticBackpack is enabled. 102 | title = 'backpack_label', 103 | icon = 'briefcase' 104 | }, 105 | [6] = { -- shoes 106 | title = 'shoes_label', 107 | icon = 'shoe-prints' 108 | }, 109 | [7] = { -- accessory 110 | title = 'chain_label', 111 | icon = 'gem' 112 | }, 113 | [8] = { -- top 114 | title = 'top_label', 115 | icon = 'shirt' 116 | }, 117 | [9] = { -- vest 118 | title = 'vest_label', 119 | icon = 'vest' 120 | }, 121 | [10] = { -- decals 122 | title = 'badges_label', 123 | icon = 'id-badge' 124 | }, 125 | } 126 | }, 127 | 128 | props = { -- Prop category (accessories) 129 | enabled = true, -- Enable or disable category. 130 | options = { -- You can toggle individual buttons here. 131 | [0] = { -- hat 132 | title = 'hat_label', 133 | icon = 'hat-cowboy' 134 | }, 135 | [1] = { -- glasses 136 | title = 'glasses_label', 137 | icon = 'glasses' 138 | }, 139 | [2] = { -- ear accessory 140 | title = 'earrings_label', 141 | icon = 'ear-deaf' 142 | }, 143 | [6] = { -- watch 144 | title = 'watch_label', 145 | icon = 'clock' 146 | }, 147 | [7] = { -- bracelet 148 | title = 'bracelet_label', 149 | icon = 'ring' 150 | }, 151 | } 152 | } 153 | } 154 | 155 | -- ▄▀█ █▄░█ █ █▀▄▀█ ▄▀█ ▀█▀ █ █▀█ █▄░█ █▀ 156 | -- █▀█ █░▀█ █ █░▀░█ █▀█ ░█░ █ █▄█ █░▀█ ▄█ 157 | 158 | Config.Animations = { -- You can configure your animations for taking off clothes. 159 | take_off = { 160 | [1] = { dict = "missfbi4", clip = "takeoff_mask", flag = 51, duration = 1200 }, -- Mask 161 | [3] = { dict = "nmt_3_rcm-10", clip = "cs_nigel_dual-10", flag = 51, duration = 1200 }, -- Gloves 162 | [4] = { dict = "re@construction", clip = "out_of_breath", flag = 51, duration = 1300 }, -- Pants 163 | [5] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 }, -- Bag 164 | [6] = { dict = "random@domestic", clip = "pickup_low", flag = 51, duration = 1200 }, -- Shoes 165 | [7] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 }, -- Accessory 166 | [8] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 }, -- Shirt 167 | [9] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 }, -- Vest 168 | [10] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 } -- Decals 169 | }, 170 | put_on = { 171 | [1] = { dict = "mp_masks@on_foot", clip = "put_on_mask", flag = 51, duration = 600 }, -- Mask 172 | [3] = { dict = "nmt_3_rcm-10", clip = "cs_nigel_dual-10", flag = 51, duration = 1200 }, -- Gloves 173 | [4] = { dict = "re@construction", clip = "out_of_breath", flag = 51, duration = 1300 }, -- Pants 174 | [5] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 }, -- Bag 175 | [6] = { dict = "random@domestic", clip = "pickup_low", flag = 51, duration = 1200 }, -- Shoes 176 | [7] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 15, duration = 1200 }, -- Accessory 177 | [8] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 }, -- Shirt 178 | [9] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 }, -- Vest 179 | [10] = { dict = "clothingshirt", clip = "try_shirt_positive_d", flag = 51, duration = 1200 } -- Decals 180 | } 181 | } 182 | 183 | Config.PropAnimations = { -- You can configure your animations for taking off props. 184 | take_off = { 185 | [0] = { dict = "missheist_agency2ahelmet", clip = "take_off_helmet_stand", flag = 51, duration = 600 }, -- Hat 186 | [1] = { dict = "clothingspecs", clip = "take_off", flag = 51, duration = 1400 }, -- Glasses 187 | [2] = { dict = "mp_cp_stolen_tut", clip = "b_think", flag = 51, duration = 900 }, -- Ear accessories 188 | [6] = { dict = "mp_arresting", clip = "a_uncuff", flag = 51, duration = 900 }, -- Watch 189 | [7] = { dict = "mp_arresting", clip = "a_uncuff", flag = 51, duration = 900 } -- Bracelet 190 | }, 191 | put_on = { 192 | [0] = { dict = "veh@common@fp_helmet@", clip = "put_on_helmet", flag = 51, duration = 2000 }, -- Hat 193 | [1] = { dict = "clothingspecs", clip = "take_off", flag = 51, duration = 1400 }, -- Glasses 194 | [2] = { dict = "mp_cp_stolen_tut", clip = "b_think", flag = 51, duration = 900 }, -- Ear accessories 195 | [6] = { dict = "mp_arresting", clip = "a_uncuff", flag = 51, duration = 900 }, -- Watch 196 | [7] = { dict = "mp_arresting", clip = "a_uncuff", flag = 51, duration = 900 } -- Bracelet 197 | } 198 | } 199 | 200 | -- █▀▄ █▀▀ █▀▀ ▄▀█ █░█ █░░ ▀█▀   █▀▀ █░░ █▀█ ▀█▀ █░█ █▀▀ █▀ 201 | -- █▄▀ ██▄ █▀░ █▀█ █▄█ █▄▄ ░█░   █▄▄ █▄▄ █▄█ ░█░ █▀█ ██▄ ▄█ 202 | 203 | -- Configure your default player clothes for both genders (with these clothes player will be considered as naked). 204 | Config.DefaultPlayerClothes = { 205 | Male = { 206 | Components = { 207 | [1] = { index = 1, drawable = 0, texture = 0 }, -- Mask 208 | [3] = { index = 3, drawable = 15, texture = 0 }, -- Gloves 209 | [4] = { index = 4, drawable = 26, texture = 0 }, -- Pants 210 | [5] = { index = 5, drawable = 0, texture = 0 }, -- Bag 211 | [6] = { index = 6, drawable = 78, texture = 0 }, -- Shoes 212 | [7] = { index = 7, drawable = 0, texture = 0 }, -- Accessory 213 | [8] = { index = 8, drawable = 15, texture = 0 }, -- Shirt 214 | [9] = { index = 9, drawable = 0, texture = 0 }, -- Vest 215 | [10] = { index = 10, drawable = 0, texture = 0 }, -- Decals 216 | [11] = { index = 11, drawable = 15, texture = 0 } -- Jacket 217 | }, 218 | Props = { 219 | [0] = { index = 0, drawable = -1, texture = -1 }, -- Hat 220 | [1] = { index = 1, drawable = -1, texture = -1 }, -- Glasses 221 | [2] = { index = 2, drawable = -1, texture = -1 }, -- Ear accessory 222 | [6] = { index = 6, drawable = -1, texture = -1 }, -- Watch 223 | [7] = { index = 7, drawable = -1, texture = -1 } -- Bracelet 224 | } 225 | }, 226 | Female = { 227 | Components = { 228 | [1] = { index = 1, drawable = 0, texture = 0 }, -- Mask 229 | [3] = { index = 3, drawable = 15, texture = 0 }, -- Gloves 230 | [4] = { index = 4, drawable = 15, texture = 0 }, -- Pants 231 | [5] = { index = 5, drawable = 0, texture = 0 }, -- Bag 232 | [6] = { index = 6, drawable = 91, texture = 0 }, -- Shoes 233 | [7] = { index = 7, drawable = 0, texture = 0 }, -- Accessory 234 | [8] = { index = 8, drawable = 14, texture = 0 }, -- Shirt 235 | [9] = { index = 9, drawable = 0, texture = 0 }, -- Vest 236 | [10] = { index = 10, drawable = 0, texture = 0 }, -- Decals 237 | [11] = { index = 11, drawable = 17, texture = 0 } -- Jacket 238 | }, 239 | Props = { 240 | [0] = { index = 0, drawable = -1, texture = -1 }, -- Hat 241 | [1] = { index = 1, drawable = -1, texture = -1 }, -- Glasses 242 | [2] = { index = 2, drawable = -1, texture = -1 }, -- Ear accessory 243 | [6] = { index = 6, drawable = -1, texture = -1 }, -- Watch 244 | [7] = { index = 7, drawable = -1, texture = -1 } -- Bracelet 245 | } 246 | } 247 | } 248 | 249 | -- █▄▄ ▄▀█ █▀▀ █▄▀ █▀█ ▄▀█ █▀▀ █▄▀ █▀ 250 | -- █▄█ █▀█ █▄▄ █░█ █▀▀ █▀█ █▄▄ █░█ ▄█ 251 | 252 | -- If enabled, if player has the items configured below they will be visually shown as a piece of clothing on the character (button for taking off bags will be disabled). 253 | -- If disabled, backpacks will work like any other clothing item (button for taking off bags will be enabled). 254 | 255 | Config.AutomaticBackpack = false 256 | Config.Backpacks = { 257 | [1] = { -- The number is the backpack priority (if player has item 1 and item 2 then item 1 will be always shown). 258 | item = 'large_backpack', -- Item name of your backpack. 259 | drawable = 66, -- Drawable ID of the backpack. 260 | texture = 0 -- Texture ID of the backpack. 261 | }, 262 | [2] = { 263 | item = 'medium_backpack', 264 | drawable = 65, 265 | texture = 0 266 | }, 267 | [3] = { 268 | item = 'small_backpack', 269 | drawable = 67, 270 | texture = 0 271 | }, 272 | } 273 | 274 | -- █▄░█ █▀█ ▀█▀ █ █▀▀ █▄█ 275 | -- █░▀█ █▄█ ░█░ █ █▀░ ░█░ 276 | 277 | -- You can edit the notifications here. 278 | function notify(text, type) 279 | lib.notify({ 280 | title = 'CLOTHING', 281 | description = text, 282 | type = type 283 | }) 284 | end 285 | 286 | -- █▀ █▀█ █▀▀ █▀▀ █ ▄▀█ █░░   █▀█ █░█ ▀█▀ █▀▀ █ ▀█▀ █▀ 287 | -- ▄█ █▀▀ ██▄ █▄▄ █ █▀█ █▄▄   █▄█ █▄█ ░█░ █▀░ █ ░█░ ▄█ 288 | 289 | -- This section allows you to configure specific outfits to have "special effects". 290 | -- For example: You can make fireman uniform fire proof. 291 | -- If you have the effect script it will be automatically available to be used with these outfits to show them visually. 292 | 293 | Config.EnableSpecialOutfits = false -- Should special outfits be enabled or disabled? 294 | Config.MarkUnnamedOutfits = false -- Should these outfits be marked by default? Can prevent players from faking outfits by renaming them. 295 | Config.MarkText = '⭐' 296 | 297 | -- WORK IN PROGRESS -------------------------------------------------------- 298 | Config.UseOutfitEffects = false -- Requires the effects script. 299 | -- You can find it here: https://github.com/LikeManTV/effects 300 | -- WORK IN PROGRESS -------------------------------------------------------- 301 | 302 | Config.SpecialOutfits = { 303 | -- { 304 | -- label = 'Example Outfit', 305 | -- outfitEffect = 'outfit', 306 | -- proofs = { 307 | -- false, -- BULLET 308 | -- false, -- FIRE 309 | -- false, -- EXPLOSION 310 | -- false, -- COLLISION 311 | -- false, -- MELEE 312 | -- false, -- STEAM 313 | -- false, 314 | -- false -- DROWNING 315 | -- }, 316 | -- Male = { 317 | -- comps = { 318 | -- [1] = {d = 0, t = 0}, -- Mask 319 | -- [3] = {d = 0, t = 0}, -- Gloves 320 | -- [4] = {d = 0, t = 0}, -- Pants 321 | -- [6] = {d = 0, t = 0}, -- Shoes 322 | -- [7] = {d = 0, t = 0}, -- Accessory 323 | -- [8] = {d = 0, t = 0}, -- Shirt 324 | -- [9] = {d = 0, t = 0}, -- Vest 325 | -- [10] = {d = 0, t = 0}, -- Decals 326 | -- [11] = {d = 0, t = 0}, -- Jacket 327 | -- }, 328 | -- props = { 329 | -- [0] = {d = 0, t = 0}, -- Hat 330 | -- [1] = {d = 0, t = 0}, -- Glassses 331 | -- [2] = {d = 0, t = 0}, -- Ear accessory 332 | -- [6] = {d = 0, t = 0}, -- Watch 333 | -- [7] = {d = 0, t = 0}, -- Bracelet 334 | -- } 335 | -- }, 336 | -- Female = { 337 | -- comps = { 338 | -- [1] = {d = 0, t = 0}, -- Mask 339 | -- [3] = {d = 0, t = 0}, -- Gloves 340 | -- [4] = {d = 0, t = 0}, -- Pants 341 | -- [6] = {d = 0, t = 0}, -- Shoes 342 | -- [7] = {d = 0, t = 0}, -- Accessory 343 | -- [8] = {d = 0, t = 0}, -- Shirt 344 | -- [9] = {d = 0, t = 0}, -- Vest 345 | -- [10] = {d = 0, t = 0}, -- Decals 346 | -- [11] = {d = 0, t = 0}, -- Jacket 347 | -- }, 348 | -- props = { 349 | -- [0] = {d = 0, t = 0}, -- Hat 350 | -- [1] = {d = 0, t = 0}, -- Glassses 351 | -- [2] = {d = 0, t = 0}, -- Ear accessory 352 | -- [6] = {d = 0, t = 0}, -- Watch 353 | -- [7] = {d = 0, t = 0}, -- Bracelet 354 | -- } 355 | -- } 356 | -- }, 357 | } 358 | -------------------------------------------------------------------------------- /client/cl_class.lua: -------------------------------------------------------------------------------- 1 | local lastArms = false 2 | local armsData = lib.loadJson('data/arms') 3 | local glovesData = lib.loadJson('data/gloves') 4 | local torsoData = { 5 | Male = lib.loadJson('data/torso_male'), 6 | Female = lib.loadJson('data/torso_female') 7 | } 8 | 9 | utils = { 10 | getPedSex = function() 11 | if IsPedModel(cache.ped, "mp_m_freemode_01") then 12 | return "Male" 13 | else 14 | return "Female" 15 | end 16 | end, 17 | 18 | isNaked = function() 19 | local gender = utils.getPedSex(cache.ped) 20 | local player = { 21 | comps = {}, 22 | props = {} 23 | } 24 | 25 | for i = 0, 11 do 26 | if i ~= 2 then 27 | player.comps[i] = { d = GetPedDrawableVariation(cache.ped, i), t = GetPedTextureVariation(cache.ped, i) } 28 | end 29 | end 30 | 31 | for i = 0, 2 do 32 | player.props[i] = { d = GetPedPropIndex(cache.ped, i), t = GetPedPropTextureIndex(cache.ped, i) } 33 | end 34 | 35 | for i = 6, 7 do 36 | player.props[i] = { d = GetPedPropIndex(cache.ped, i), t = GetPedPropTextureIndex(cache.ped, i) } 37 | end 38 | 39 | local defaultOutfit = Config.DefaultPlayerClothes[gender] 40 | for index, data in pairs(defaultOutfit.Components) do 41 | if player.comps[index].d ~= data.drawable or player.comps[index].t ~= data.texture then 42 | return false 43 | end 44 | end 45 | 46 | for index, data in pairs(defaultOutfit.Props) do 47 | if player.props[index].d ~= data.drawable or player.props[index].t ~= data.texture then 48 | return false 49 | end 50 | end 51 | 52 | return true 53 | end 54 | } 55 | 56 | clothing = { 57 | applyClothing = function(_type, slot) 58 | local data = slot.metadata 59 | local gender = utils.getPedSex(cache.ped) 60 | if data.sex ~= gender then 61 | return notify(_L('error_fitcheck', 'error')) 62 | end 63 | 64 | if _type == 'outfit' then 65 | local hair = GetPedDrawableVariation(cache.ped, 2) 66 | local hairTexture = GetPedTextureVariation(cache.ped, 2) 67 | local isNaked = utils.isNaked() 68 | 69 | if not isNaked then clothing.handleUndress('outfit', true) end 70 | for _, v in pairs(data.comps) do 71 | SetPedComponentVariation(cache.ped, v.index, v.drawable, v.texture, v.palette) 72 | end 73 | for _, v in pairs(data.props) do 74 | SetPedPropIndex(cache.ped, v.index, v.drawable, v.texture) 75 | end 76 | SetPedComponentVariation(cache.ped, 2, hair, hairTexture, 0) 77 | appearance.saveSkin() 78 | TriggerServerEvent('clothing:sv:removeItem', data, slot) 79 | elseif _type == 'torso' then 80 | -- local bestTorso = torsoData[gender][tostring(data.Jacket.drawable)][tostring(data.Jacket.texture)] 81 | -- if bestTorso and bestTorso.BestTorsoDrawable ~= -1 then 82 | -- SetPedComponentVariation(cache.ped, 3, bestTorso.BestTorsoDrawable, bestTorso.BestTorsoTexture, 2) 83 | -- end 84 | 85 | if clothing.checkCurrent('torso') then 86 | if lastArms then 87 | SetPedComponentVariation(cache.ped, 3, lastArms.d, lastArms.t, 2) 88 | end 89 | 90 | for _,v in pairs(data) do 91 | SetPedComponentVariation(cache.ped, v.index, v.drawable, v.texture, v.palette) 92 | appearance.saveSkin() 93 | TriggerServerEvent("clothing:sv:removeItem", data, slot) 94 | end 95 | end 96 | elseif _type == 'clothes' then 97 | if clothing.checkCurrent('clothes', data.index) then 98 | SetPedComponentVariation(cache.ped, data.index, data.drawable, data.texture, data.palette) 99 | appearance.saveSkin() 100 | TriggerServerEvent("clothing:sv:removeItem", data, slot) 101 | end 102 | elseif _type == 'prop' then 103 | if clothing.checkCurrent('prop', data.index) then 104 | SetPedPropIndex(cache.ped, data.index, data.drawable, data.texture, true) 105 | appearance.saveSkin() 106 | TriggerServerEvent("clothing:sv:removeItem", data, slot) 107 | end 108 | end 109 | end, 110 | 111 | handleUndress = function(_type, changing, index) 112 | local gender = utils.getPedSex(cache.ped) 113 | 114 | if _type == 'outfit' then 115 | local hair = GetPedDrawableVariation(cache.ped, 2) 116 | local hairTexture = GetPedTextureVariation(cache.ped, 2) 117 | local outfitData = { 118 | sex = gender, 119 | outfit = { 120 | comps = {}, 121 | props = {} 122 | } 123 | } 124 | 125 | for i = 0, 11 do 126 | if i ~= 2 then 127 | outfitData.outfit.comps[i] = { 128 | index = i, 129 | drawable = GetPedDrawableVariation(cache.ped, i), 130 | texture = GetPedTextureVariation(cache.ped, i), 131 | pallete = GetPedPaletteVariation(cache.ped, drawable) 132 | } 133 | end 134 | end 135 | 136 | for i = 0, 2 do 137 | outfitData.outfit.props[i] = { 138 | index = i, 139 | drawable = GetPedPropIndex(cache.ped, i), 140 | texture = GetPedPropTextureIndex(cache.ped, i) 141 | } 142 | end 143 | for i = 6, 7 do 144 | outfitData.outfit.props[i] = { 145 | index = i, 146 | drawable = GetPedPropIndex(cache.ped, i), 147 | texture = GetPedPropTextureIndex(cache.ped, i) 148 | } 149 | end 150 | 151 | local outfitName, outfitLabel = clothing.isWearingOutfit() 152 | if clothing.isAbleToUndress('Components', 8, GetPedDrawableVariation(cache.ped, 8)) or clothing.isAbleToUndress('Components', 4, GetPedDrawableVariation(cache.ped, 4)) or clothing.isAbleToUndress('Components', 6, GetPedDrawableVariation(cache.ped, 6)) then 153 | clothing.setDefaultVariation({ isAnimated = true, sex = gender, index = 8, isChangingClothes = changing }) 154 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 1 }) 155 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 3 }) 156 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 4 }) 157 | if not Config.AutomaticBackpack then 158 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 5 }) 159 | end 160 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 6 }) 161 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 7 }) 162 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 9 }) 163 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 10 }) 164 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 11 }) 165 | clothing.setDefaultPropVariation({ isAnimated = false, sex = gender, index = 0 }) 166 | clothing.setDefaultPropVariation({ isAnimated = false, sex = gender, index = 1 }) 167 | clothing.setDefaultPropVariation({ isAnimated = false, sex = gender, index = 2 }) 168 | clothing.setDefaultPropVariation({ isAnimated = false, sex = gender, index = 6 }) 169 | clothing.setDefaultPropVariation({ isAnimated = false, sex = gender, index = 7 }) 170 | SetPedComponentVariation(cache.ped, 2, hair, hairTexture, 0) 171 | TriggerServerEvent("clothing:sv:giveOutfit", outfitData, outfitLabel) 172 | else 173 | notify(_L('error_no_clothes'), "error") 174 | end 175 | elseif _type == 'torso' then 176 | local torsoData = { 177 | sex = gender, 178 | torso = { 179 | Tshirt = { 180 | index = 8, 181 | drawable = GetPedDrawableVariation(cache.ped, 8), 182 | texture = GetPedTextureVariation(cache.ped, 8), 183 | palette = GetPedPaletteVariation(cache.ped, 8) 184 | }, 185 | Jacket = { 186 | index = 11, 187 | drawable = GetPedDrawableVariation(cache.ped, 11), 188 | texture = GetPedTextureVariation(cache.ped, 11), 189 | palette = GetPedPaletteVariation(cache.ped, 11) 190 | }, 191 | } 192 | } 193 | 194 | if clothing.isAbleToUndress('Components', 8, GetPedDrawableVariation(cache.ped, 8)) or clothing.isAbleToUndress('Components', 11, GetPedDrawableVariation(cache.ped, 11)) then 195 | clothing.setDefaultVariation({ isAnimated = true, sex = gender, index = 8, isChangingClothes = changing }) 196 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 11 }) 197 | 198 | local currentDrawable = GetPedDrawableVariation(cache.ped, 3) 199 | local currentTexture = GetPedTextureVariation(cache.ped, 3) 200 | local arms = armsData[gender][tostring(currentDrawable)] 201 | lastArms = {d = currentDrawable, t = currentTexture} 202 | if arms then 203 | SetPedComponentVariation(cache.ped, 3, arms, currentTexture, 2) 204 | else 205 | clothing.setDefaultVariation({ isAnimated = false, sex = gender, index = 3 }) 206 | end 207 | TriggerServerEvent("clothing:sv:giveTorso", torsoData) 208 | else 209 | notify(_L('error_no_clothes'), "error") 210 | end 211 | elseif _type == 'clothes' then 212 | local currentDrawable = GetPedDrawableVariation(cache.ped, index) 213 | local currentTexture = GetPedTextureVariation(cache.ped, index) 214 | local clothingData = { 215 | sex = gender, 216 | index = index, 217 | drawable = currentDrawable, 218 | texture = currentTexture, 219 | } 220 | 221 | if clothing.isAbleToUndress('Components', index, currentDrawable) then 222 | clothing.setDefaultVariation({ isAnimated = true, sex = gender, index = index, isChangingClothes = changing }) 223 | if index == 3 then 224 | local gloves = glovesData[gender][tostring(currentDrawable)] 225 | if gloves then 226 | SetPedComponentVariation(cache.ped, 3, gloves, currentTexture, 2) 227 | end 228 | end 229 | TriggerServerEvent("clothing:sv:giveClothes", clothingData) 230 | else 231 | notify(_L('error_no_clothes'), "error") 232 | end 233 | elseif _type == 'prop' then 234 | local currentProp = GetPedPropIndex(cache.ped, index) 235 | local propData = { 236 | sex = gender, 237 | index = index, 238 | drawable = currentProp, 239 | texture = GetPedPropTextureIndex(cache.ped, index) 240 | } 241 | 242 | if clothing.isAbleToUndress('Props', index, currentProp) then 243 | clothing.setDefaultPropVariation({ isAnimated = true, sex = gender, index = index, isChangingClothes = changing }) 244 | TriggerServerEvent("clothing:sv:giveProp", propData) 245 | else 246 | notify(_L('error_no_clothes'), "error") 247 | end 248 | end 249 | end, 250 | 251 | handleOutfitPlayer = function() 252 | local player = lib.getClosestPlayer(GetEntityCoords(cache.ped), 3.0, false) 253 | if player and player ~= cache.playerId then 254 | local serverId = GetPlayerServerId(player) 255 | if serverId then 256 | TriggerServerEvent('clothing:sv:requestOutfit', serverId) 257 | notify(_L('request_sent'), "success") 258 | end 259 | else 260 | notify(_L('error_nobody_around'), "error") 261 | end 262 | end, 263 | 264 | requestOutfit = function(sender) 265 | SetTimeout(15000, function() 266 | lib.closeAlertDialog() 267 | end) 268 | 269 | local alert = lib.alertDialog({ 270 | header = _L('new_request_title'), 271 | content = _L('new_request_desc'), 272 | centered = true, 273 | cancel = true 274 | }) 275 | 276 | if alert == 'confirm' then 277 | clothing.handleUndress('outfit', false) 278 | appearance.saveSkin() 279 | end 280 | end, 281 | 282 | isAbleToUndress = function(_type, index, drawable) 283 | local gender = utils.getPedSex(cache.ped) 284 | 285 | if drawable == Config.DefaultPlayerClothes[gender][_type][index].drawable then 286 | return false 287 | end 288 | 289 | return true 290 | end, 291 | 292 | checkCurrent = function(_type, index) 293 | if _type == 'torso' then 294 | local gender = utils.getPedSex(cache.ped) 295 | local shirt = GetPedDrawableVariation(cache.ped, 8) 296 | local jacket = GetPedDrawableVariation(cache.ped, 11) 297 | 298 | if shirt ~= Config.DefaultPlayerClothes[gender].Components[8].drawable or jacket ~= Config.DefaultPlayerClothes[gender].Components[11].drawable then 299 | clothing.handleUndress('torso', true, nil) 300 | end 301 | 302 | return true 303 | elseif _type == 'clothes' then 304 | local gender = utils.getPedSex(cache.ped) 305 | local clothes = GetPedDrawableVariation(cache.ped, index) 306 | 307 | if clothes ~= Config.DefaultPlayerClothes[gender].Components[index].drawable then 308 | clothing.handleUndress('clothes', true, index) 309 | end 310 | 311 | return true 312 | elseif _type == 'prop' then 313 | local prop = GetPedPropIndex(cache.ped, index) 314 | 315 | if prop ~= -1 then 316 | clothing.handleUndress('prop', true, index) 317 | end 318 | 319 | return true 320 | end 321 | end, 322 | 323 | setDefaultVariation = function(data) 324 | if data.isAnimated then 325 | if not data.isChangingClothes then 326 | if lib.progressCircle({ 327 | duration = Config.Animations.take_off[data.index].duration, 328 | position = 'bottom', 329 | useWhileDead = false, 330 | canCancel = true, 331 | disable = { 332 | combat = true 333 | }, 334 | anim = { 335 | dict = Config.Animations.take_off[data.index].dict, 336 | clip = Config.Animations.take_off[data.index].clip, 337 | flag = Config.Animations.take_off[data.index].flag 338 | } 339 | }) then 340 | SetPedComponentVariation(cache.ped, data.index, Config.DefaultPlayerClothes[data.sex].Components[data.index].drawable, Config.DefaultPlayerClothes[data.sex].Components[data.index].texture, 0) 341 | return 342 | end 343 | end 344 | end 345 | 346 | SetPedComponentVariation(cache.ped, data.index, Config.DefaultPlayerClothes[data.sex].Components[data.index].drawable, Config.DefaultPlayerClothes[data.sex].Components[data.index].texture, 0) 347 | end, 348 | 349 | setDefaultPropVariation = function(data) 350 | if data.isAnimated then 351 | if not data.isChangingClothes then 352 | if lib.progressCircle({ 353 | duration = Config.PropAnimations.take_off[data.index].duration, 354 | position = 'bottom', 355 | useWhileDead = false, 356 | canCancel = true, 357 | disable = { 358 | combat = true 359 | }, 360 | anim = { 361 | dict = Config.PropAnimations.take_off[data.index].dict, 362 | clip = Config.PropAnimations.take_off[data.index].clip, 363 | flag = Config.PropAnimations.take_off[data.index].flag 364 | } 365 | }) then 366 | ClearPedProp(cache.ped, data.index) 367 | SetPedPropIndex(cache.ped, data.index, -1, 0, 0) 368 | return 369 | end 370 | end 371 | end 372 | 373 | ClearPedProp(cache.ped, data.index) 374 | SetPedPropIndex(cache.ped, data.index, -1, 0, 0) 375 | end, 376 | 377 | isWearingOutfit = function(name) 378 | local gender = utils.getPedSex(cache.ped) 379 | local player = { 380 | comps = {}, 381 | props = {} 382 | } 383 | 384 | for i = 0, 11 do 385 | if i ~= 2 then 386 | player.comps[i] = { d = GetPedDrawableVariation(cache.ped, i), t = GetPedTextureVariation(cache.ped, i) } 387 | end 388 | end 389 | 390 | for i = 0, 2 do 391 | player.props[i] = { d = GetPedPropIndex(cache.ped, i), t = GetPedPropTextureIndex(cache.ped, i) } 392 | end 393 | for i = 6, 7 do 394 | player.props[i] = { d = GetPedPropIndex(cache.ped, i), t = GetPedPropTextureIndex(cache.ped, i) } 395 | end 396 | 397 | local outfits = {} 398 | for outfitName, outfitData in pairs(Config.SpecialOutfits) do 399 | for index, data in pairs(outfitData[gender].comps) do 400 | if player.comps[index].d ~= data.d and player.comps[index].t ~= data.t then 401 | outfits[outfitName] = true 402 | end 403 | end 404 | 405 | if not outfits[outfitName] then 406 | return outfitName, outfitData.label 407 | end 408 | end 409 | 410 | return false 411 | end, 412 | 413 | isWearing = function(index) 414 | local comp = GetPedDrawableVariation(cache.ped, index) 415 | local text = GetPedTextureVariation(cache.ped, index) 416 | if comp == 0 then 417 | return false 418 | else 419 | return prop, text 420 | end 421 | end, 422 | 423 | isWearingProp = function(index) 424 | local prop = GetPedPropIndex(cache.ped, index) 425 | local text = GetPedPropTextureIndex(cache.ped, index) 426 | if prop == 0 or prop == -1 then 427 | return false 428 | else 429 | return prop, text 430 | end 431 | end, 432 | } 433 | 434 | exports('isWearingOutfit', clothing.isWearingOutfit) 435 | exports('isWearingClothes', clothing.isWearing) 436 | exports('isWearingProp', clothing.isWearingProp) 437 | exports('isNaked', utils.isNaked) 438 | exports('getPedSex', utils.getPedSex) 439 | -- exports('giveClothes', ) 440 | -- exports('giveProp', ) 441 | -------------------------------------------------------------------------------- /client/cl_clothing.lua: -------------------------------------------------------------------------------- 1 | local faceFeatures = {} 2 | local currentHair = nil 3 | 4 | -- █▀▄▀█ █▀▀ █▄░█ █░█ 5 | -- █░▀░█ ██▄ █░▀█ █▄█ 6 | 7 | local categories = {} 8 | if Config.Menu.outfit then 9 | if Config.UseRadial then 10 | categories[#categories+1] = { 11 | label = _L('take_off_outfit'), 12 | icon = 'shirt', 13 | onSelect = function() 14 | TriggerEvent('clothing:cl:handleOutfit') 15 | end 16 | } 17 | else 18 | categories[#categories+1] = { 19 | title = _L('take_off_outfit'), 20 | icon = 'shirt', 21 | event = 'clothing:cl:handleOutfit' 22 | } 23 | end 24 | end 25 | if Config.Menu.outfitOther then 26 | if Config.UseRadial then 27 | categories[#categories+1] = { 28 | label = _L('take_off_outfit_other'), 29 | icon = 'shirt', 30 | onSelect = function() 31 | TriggerEvent('clothing:cl:handleOutfitPlayer') 32 | end 33 | } 34 | else 35 | categories[#categories+1] = { 36 | title = _L('take_off_outfit_other'), 37 | icon = 'shirt', 38 | event = 'clothing:cl:handleOutfitPlayer' 39 | } 40 | end 41 | end 42 | if Config.Menu.clothes.enabled then 43 | if Config.UseRadial then 44 | categories[#categories+1] = { 45 | label = _L('take_off_clothes'), 46 | icon = 'shirt', 47 | menu = 'clothing_menu-clothes', 48 | } 49 | else 50 | categories[#categories+1] = { 51 | title = _L('take_off_clothes'), 52 | icon = 'shirt', 53 | menu = 'clothing_menu-clothes', 54 | arrow = true 55 | } 56 | end 57 | end 58 | if Config.Menu.props.enabled then 59 | if Config.UseRadial then 60 | categories[#categories+1] = { 61 | label = _L('take_off_props'), 62 | icon = 'shirt', 63 | menu = 'clothing_menu-props', 64 | } 65 | else 66 | categories[#categories+1] = { 67 | title = _L('take_off_props'), 68 | icon = 'shirt', 69 | menu = 'clothing_menu-props', 70 | arrow = true 71 | } 72 | end 73 | end 74 | 75 | local cOptions = {} 76 | local clothesData = Config.Menu.clothes.options 77 | for i = 1, 10 do 78 | local data = clothesData[i] 79 | if data and i ~= 2 then 80 | if i == 5 and Config.AutomaticBackpack == false then 81 | if Config.UseRadial then 82 | cOptions[#cOptions+1] = { 83 | label = _L(data.title), 84 | icon = data.icon, 85 | onSelect = function() 86 | TriggerEvent('clothing:cl:handleClothes', {index = i}) 87 | end 88 | } 89 | else 90 | cOptions[#cOptions+1] = { 91 | title = _L(data.title), 92 | icon = data.icon, 93 | onSelect = function() 94 | TriggerEvent('clothing:cl:handleClothes', {index = i}) 95 | end 96 | } 97 | end 98 | end 99 | end 100 | end 101 | 102 | local pOptions = {} 103 | local propData = Config.Menu.props.options 104 | for i = 0, 2 do 105 | local data = propData[i] 106 | if data then 107 | if Config.UseRadial then 108 | pOptions[#pOptions+1] = { 109 | label = _L(data.title), 110 | icon = data.icon, 111 | onSelect = function() 112 | TriggerEvent('clothing:cl:handleProps', {index = i}) 113 | end 114 | } 115 | else 116 | pOptions[#pOptions+1] = { 117 | title = _L(data.title), 118 | icon = data.icon, 119 | onSelect = function() 120 | TriggerEvent('clothing:cl:handleProps', {index = i}) 121 | end 122 | } 123 | end 124 | end 125 | end 126 | for i = 6, 7 do 127 | local data = propData[i] 128 | if data then 129 | if Config.UseRadial then 130 | pOptions[#pOptions+1] = { 131 | label = _L(data.title), 132 | icon = data.icon, 133 | onSelect = function() 134 | TriggerEvent('clothing:cl:handleProps', {index = i}) 135 | end 136 | } 137 | else 138 | pOptions[#pOptions+1] = { 139 | title = _L(data.title), 140 | icon = data.icon, 141 | onSelect = function() 142 | TriggerEvent('clothing:cl:handleProps', {index = i}) 143 | end 144 | } 145 | end 146 | end 147 | end 148 | 149 | if Config.UseRadial then 150 | lib.registerRadial({ 151 | id = 'clothing_menu', 152 | items = categories 153 | }) 154 | lib.registerRadial({ 155 | id = 'clothing_menu-clothes', 156 | items = cOptions 157 | }) 158 | lib.registerRadial({ 159 | id = 'clothing_menu-props', 160 | items = pOptions 161 | }) 162 | 163 | if Config.AddGlobalRadialOption then 164 | lib.addRadialItem({ 165 | { 166 | id = 'clothing', 167 | label = _L('menu_title'), 168 | icon = 'shirt', 169 | menu = 'clothing_menu' 170 | } 171 | }) 172 | end 173 | else 174 | lib.registerContext({ 175 | id = 'clothing_menu', 176 | title = _L('menu_title'), 177 | onExit = function() 178 | appearance.saveSkin() 179 | end, 180 | options = categories, 181 | { 182 | id = 'clothing_menu-clothes', 183 | title = _L('menu_clothing_title'), 184 | menu = 'clothing_menu', 185 | options = cOptions 186 | }, 187 | { 188 | id = 'clothing_menu-props', 189 | title = _L('menu_props_title'), 190 | menu = 'clothing_menu', 191 | options = pOptions 192 | } 193 | }) 194 | end 195 | 196 | RegisterCommand('clothing', function() 197 | if Config.UseRadial then return end 198 | lib.showContext('clothing_menu') 199 | end) 200 | 201 | if Config.MenuKey then 202 | if Config.UseRadial then return end 203 | lib.addKeybind({ 204 | name = 'clothing', 205 | description = _L('menu_title'), 206 | defaultKey = Config.MenuKey, 207 | onPressed = function(self) 208 | lib.showContext('clothing_menu') 209 | end 210 | }) 211 | end 212 | 213 | -- Commands 214 | if Config.Commands.enabled then 215 | RegisterCommand(Config.Commands.list.outfit, function() TriggerEvent('clothing:cl:handleOutfit') end) 216 | RegisterCommand(Config.Commands.list.mask, function() TriggerEvent('clothing:cl:handleClothes', {index = 1}) end) 217 | RegisterCommand(Config.Commands.list.gloves, function() TriggerEvent('clothing:cl:handleClothes', {index = 3}) end) 218 | RegisterCommand(Config.Commands.list.pants, function() TriggerEvent('clothing:cl:handleClothes', {index = 4}) end) 219 | if not Config.AutomaticBackpack then 220 | RegisterCommand(Config.Commands.list.backpack, function() TriggerEvent('clothing:cl:handleClothes', {index = 5}) end) 221 | end 222 | RegisterCommand(Config.Commands.list.shoes, function() TriggerEvent('clothing:cl:handleClothes', {index = 6}) end) 223 | RegisterCommand(Config.Commands.list.chain, function() TriggerEvent('clothing:cl:handleClothes', {index = 7}) end) 224 | RegisterCommand(Config.Commands.list.shirt, function() TriggerEvent('clothing:cl:handleClothes', {index = 8}) end) 225 | RegisterCommand(Config.Commands.list.vest, function() TriggerEvent('clothing:cl:handleClothes', {index = 9}) end) 226 | RegisterCommand(Config.Commands.list.decals, function() TriggerEvent('clothing:cl:handleClothes', {index = 10}) end) 227 | RegisterCommand(Config.Commands.list.jacket, function() TriggerEvent('clothing:cl:handleClothes', {index = 11}) end) 228 | 229 | RegisterCommand(Config.Commands.list.hat, function() TriggerEvent('clothing:cl:handleProps', {index = 0}) end) 230 | RegisterCommand(Config.Commands.list.glasses, function() TriggerEvent('clothing:cl:handleProps', {index = 1}) end) 231 | RegisterCommand(Config.Commands.list.earrings, function() TriggerEvent('clothing:cl:handleProps', {index = 2}) end) 232 | RegisterCommand(Config.Commands.list.watch, function() TriggerEvent('clothing:cl:handleProps', {index = 6}) end) 233 | RegisterCommand(Config.Commands.list.bracelet, function() TriggerEvent('clothing:cl:handleProps', {index = 7}) end) 234 | end 235 | 236 | -- █▀▀ █░█ █▀▀ █▄░█ ▀█▀ █▀ 237 | -- ██▄ ▀▄▀ ██▄ █░▀█ ░█░ ▄█ 238 | 239 | -- Undress handling 240 | RegisterNetEvent('clothing:cl:handleOutfit', function() 241 | clothing.handleUndress('outfit', false) 242 | appearance.saveSkin() 243 | end) 244 | 245 | RegisterNetEvent('clothing:cl:handleClothes', function(data) 246 | if data.index == 8 or data.index == 11 then 247 | clothing.handleUndress('torso', false) 248 | else 249 | clothing.handleUndress('clothes', false, data.index) 250 | end 251 | appearance.saveSkin() 252 | end) 253 | 254 | RegisterNetEvent('clothing:cl:handleProps', function(data) 255 | clothing.handleUndress('prop', false, data.index) 256 | appearance.saveSkin() 257 | end) 258 | 259 | RegisterNetEvent('clothing:cl:handleOutfitPlayer', function() 260 | clothing.handleOutfitPlayer() 261 | end) 262 | 263 | RegisterNetEvent('clothing:cl:requestOutfit', function(sender) 264 | clothing.requestOutfit(sender) 265 | end) 266 | 267 | -- Item handling 268 | exports('clothes', function(data, slot) 269 | exports.ox_inventory:useItem(data, function(data) 270 | if data then 271 | local part = slot.metadata.part 272 | if part == 'outfit' then 273 | if lib.progressCircle({ 274 | duration = 1200, 275 | position = 'bottom', 276 | useWhileDead = false, 277 | canCancel = true, 278 | disable = { 279 | combat = true 280 | }, 281 | anim = { 282 | dict = 'clothingshirt', 283 | clip = 'try_shirt_positive_d', 284 | flag = 51 285 | } 286 | }) then 287 | clothing.applyClothing('outfit', slot) 288 | end 289 | elseif part == 'torso' then 290 | if lib.progressCircle({ 291 | duration = 1200, 292 | position = 'bottom', 293 | useWhileDead = false, 294 | canCancel = true, 295 | disable = { 296 | combat = true 297 | }, 298 | anim = { 299 | dict = 'clothingshirt', 300 | clip = 'try_shirt_positive_d', 301 | flag = 51 302 | } 303 | }) then 304 | clothing.applyClothing('torso', slot) 305 | end 306 | elseif part == 'clothes' then 307 | if lib.progressCircle({ 308 | duration = Config.Animations.put_on[slot.metadata.index].duration, 309 | position = 'bottom', 310 | useWhileDead = false, 311 | canCancel = true, 312 | disable = { 313 | combat = true 314 | }, 315 | anim = { 316 | dict = Config.Animations.put_on[slot.metadata.index].dict, 317 | clip = Config.Animations.put_on[slot.metadata.index].clip, 318 | flag = Config.Animations.put_on[slot.metadata.index].flag 319 | } 320 | }) then 321 | clothing.applyClothing('clothes', slot) 322 | end 323 | elseif part == 'prop' then 324 | if lib.progressCircle({ 325 | duration = Config.PropAnimations.put_on[slot.metadata.index].duration, 326 | position = 'bottom', 327 | useWhileDead = false, 328 | canCancel = true, 329 | disable = { 330 | combat = true 331 | }, 332 | anim = { 333 | dict = Config.PropAnimations.put_on[slot.metadata.index].dict, 334 | clip = Config.PropAnimations.put_on[slot.metadata.index].clip, 335 | flag = Config.PropAnimations.put_on[slot.metadata.index].flag 336 | } 337 | }) then 338 | clothing.applyClothing('prop', slot) 339 | end 340 | end 341 | end 342 | end) 343 | end) 344 | 345 | -- Item apply handling 346 | RegisterNetEvent('clothing:cl:applyOutfit', function(data, slot) 347 | clothing.applyClothing('outfit', data, slot) 348 | end) 349 | 350 | RegisterNetEvent('clothing:cl:applyTorso', function(data, slot) 351 | clothing.applyClothing('torso', data, slot) 352 | end) 353 | 354 | RegisterNetEvent('clothing:cl:applyClothes', function(data, slot) 355 | clothing.applyClothing('clothes', data, slot) 356 | end) 357 | 358 | RegisterNetEvent('clothing:cl:applyProps', function(data, slot) 359 | clothing.applyClothing('prop', data, slot) 360 | end) 361 | 362 | -- Backpacks & clipping issue fix 363 | local hasMask, hasHat = false, false 364 | CreateThread(function() 365 | if Config.PlayerWontLoseProps then 366 | SetPedCanLosePropsOnDamage(cache.ped, false, 0) 367 | end 368 | 369 | while true do 370 | if Config.AutomaticBackpack then 371 | local hasValidBackpack = false 372 | for k, v in ipairs(Config.Backpacks) do 373 | local bag = inventory.Search('count', v.item) 374 | if bag then 375 | SetPedComponentVariation(cache.ped, 5, v.drawable, v.texture, 0) 376 | hasValidBackpack = true 377 | break 378 | end 379 | end 380 | 381 | if not hasValidBackpack then 382 | SetPedComponentVariation(cache.ped, 5, 0, 0, 0) 383 | end 384 | end 385 | 386 | -- Fix wearing masks 387 | if Config.MaskFix then 388 | local currentMask = GetPedDrawableVariation(cache.ped, 1) 389 | local function getHeadBlendData() 390 | return Citizen.InvokeNative(0x2746BD9D88C5C5D0, cache.ped, Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueFloatInitialized(0), Citizen.PointerValueFloatInitialized(0), Citizen.PointerValueFloatInitialized(0)) 391 | end 392 | 393 | if currentMask == 0 and hasMask then 394 | hasMask = false 395 | SetPedHeadBlendData(cache.ped, faceFeatures[1], faceFeatures[2], faceFeatures[3], faceFeatures[4], faceFeatures[5], faceFeatures[6], faceFeatures[7], faceFeatures[8], faceFeatures[9], false) 396 | elseif currentMask > 0 and not hasMask then 397 | if Config.MaskFilter.enabled then 398 | if Config.MaskFilter.blacklist then 399 | for _, id in ipairs(Config.MaskFilter.list) do 400 | if currentMask == id then 401 | return 402 | end 403 | end 404 | else 405 | for _, id in ipairs(Config.MaskFilter.list) do 406 | if currentMask ~= id then 407 | return 408 | end 409 | end 410 | end 411 | end 412 | 413 | hasMask = true 414 | faceFeatures = {getHeadBlendData()} 415 | SetPedHeadBlendData(cache.ped, 0, 0, 0, faceFeatures[4], faceFeatures[5], faceFeatures[6], 0, faceFeatures[8], 0, false) 416 | end 417 | end 418 | 419 | -- Fix wearing hats 420 | if Config.HatFix then 421 | local currentHat = GetPedPropIndex(cache.ped, 0) 422 | 423 | if currentHat == -1 and hasHat then 424 | hasHat = false 425 | SetPedComponentVariation(cache.ped, 2, currentHair.drawable, currentHair.texture, currentHair.palette) 426 | elseif currentHat > -1 and not hasHat and not IsPedSittingInAnyVehicle(cache.ped) then 427 | if Config.HatFilter.enabled then 428 | if Config.HatFilter.blacklist then 429 | for _, id in ipairs(Config.HatFilter.list) do 430 | if currentHat == id then 431 | return 432 | end 433 | end 434 | else 435 | for _, id in ipairs(Config.HatFilter.list) do 436 | if currentHat ~= id then 437 | return 438 | end 439 | end 440 | end 441 | end 442 | 443 | hasHat = true 444 | currentHair = {drawable = GetPedDrawableVariation(cache.ped, 2), texture = GetPedTextureVariation(cache.ped, 2), palette = GetPedPaletteVariation(cache.ped, 2)} 445 | SetPedComponentVariation(cache.ped, 2, 0, 0, 0) 446 | end 447 | end 448 | 449 | Wait(500) 450 | end 451 | end) 452 | 453 | lib.callback.register('clothing:cl:renameOutfit', function(label) 454 | local input = lib.inputDialog(_L('rename_title'), {_L('rename_text')}) 455 | if not input or not input == ' ' then 456 | return label 457 | else 458 | notify(_L('rename_successful'), 'success') 459 | return input[1] 460 | end 461 | end) 462 | 463 | lib.callback.register('clothing:cl:tearingProgress', function(label, duration, dict, clip) 464 | if lib.progressCircle({ 465 | label = label, 466 | duration = duration, 467 | position = 'middle', 468 | useWhileDead = false, 469 | canCancel = true, 470 | disable = { 471 | car = true 472 | }, 473 | anim = { 474 | dict = dict, 475 | clip = clip 476 | } 477 | }) then 478 | if TearMinigameSettings.enabled then 479 | local success = lib.skillCheck(TearMinigameSettings.difficulty, TearMinigameSettings.keys) 480 | if success then 481 | return true 482 | end 483 | 484 | return false 485 | end 486 | 487 | return true 488 | end 489 | end) 490 | 491 | AddEventHandler('playerDropped', function() 492 | if hasMask then 493 | Config.MaskFix = false 494 | SetPedHeadBlendData(cache.ped, faceFeatures[1], faceFeatures[2], faceFeatures[3], faceFeatures[4], faceFeatures[5], faceFeatures[6], faceFeatures[7], faceFeatures[8], faceFeatures[9], false) 495 | hasMask = false 496 | end 497 | 498 | if hasHat then 499 | Config.HatFix = false 500 | SetPedComponentVariation(cache.ped, 2, currentHair.drawable, currentHair.texture, currentHair.palette) 501 | hasHat = false 502 | end 503 | end) 504 | 505 | AddEventHandler('onResourceStop', function(resourceName) 506 | if (GetCurrentResourceName() ~= resourceName) then return end 507 | 508 | if hasMask then 509 | Config.MaskFix = false 510 | SetPedHeadBlendData(cache.ped, faceFeatures[1], faceFeatures[2], faceFeatures[3], faceFeatures[4], faceFeatures[5], faceFeatures[6], faceFeatures[7], faceFeatures[8], faceFeatures[9], false) 511 | hasMask = false 512 | end 513 | 514 | if hasHat then 515 | Config.HatFix = false 516 | SetPedComponentVariation(cache.ped, 2, currentHair.drawable, currentHair.texture, currentHair.palette) 517 | hasHat = false 518 | end 519 | end) 520 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------