diff --git a/bridge/qb/client.lua b/bridge/qb/client.lua index 100e629..d2bcc7d 100644 --- a/bridge/qb/client.lua +++ b/bridge/qb/client.lua @@ -53,6 +53,50 @@ function ToggleOutfit(inPrison) end end +function GetConvertedClothes(oldClothes) + local clothes = {} + local components = { + ['arms'] = "arms", + ['tshirt_1'] = "t-shirt", + ['torso_1'] = "torso2", + ['bproof_1'] = "vest", + ['decals_1'] = "decals", + ['pants_1'] = "pants", + ['shoes_1'] = "shoes", + ['helmet_1'] = "hat", + ['chain_1'] = "accessory", + } + local textures = { + ['tshirt_1'] = 'tshirt_2', + ['torso_1'] = 'torso_2', + ['bproof_1'] = 'bproof_2', + ['decals_1'] = 'decals_2', + ['pants_1'] = 'pants_2', + ['shoes_1'] = 'shoes_2', + ['helmet_1'] = 'helmet_2', + ['chain_1'] = 'chain_2', + } + for k,v in pairs(oldClothes) do + local component = components[k] + if component then + local texture = textures[k] and (oldClothes[textures[k]] or 0) or 0 + clothes[component] = {item = v, texture = texture} + end + end + return clothes +end + +CreateThread(function() + for k,v in pairs(Config.Prisons) do + local prison = v + local outfits = prison.outfit or Config.Default.outfit + if not Config.Prisons[k].outfit then + Config.Prisons[k].outfit = {} + end + Config.Prisons[k].outfit.male = GetConvertedClothes(outfits.male) + Config.Prisons[k].outfit.female = GetConvertedClothes(outfits.female) + end +end) -- Inventory Fallback