Skip to content

Commit

Permalink
Fixed clothes conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
PickleModifications committed May 26, 2023
1 parent 34c7ae9 commit 4a1a8a8
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions bridge/qb/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4a1a8a8

Please sign in to comment.