Skip to content

Commit d5de346

Browse files
committed
fix: Shoes not appearing in outfit
1 parent 3def08b commit d5de346

File tree

3 files changed

+53
-57
lines changed

3 files changed

+53
-57
lines changed

client/cl_class.lua

+15-14
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,11 @@ clothing = {
6767
local isNaked = utils.isNaked()
6868

6969
if not isNaked then clothing.handleUndress('outfit', true) end
70-
for k, v in pairs(data) do
71-
if v.type == 'comp' then
72-
SetPedComponentVariation(cache.ped, v.index, v.drawable, v.texture, v.palette)
73-
elseif v.type == 'prop' then
74-
SetPedPropIndex(cache.ped, v.index, v.drawable, v.texture)
75-
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)
7675
end
7776
SetPedComponentVariation(cache.ped, 2, hair, hairTexture, 0)
7877
appearance.saveSkin()
@@ -88,7 +87,7 @@ clothing = {
8887
SetPedComponentVariation(cache.ped, 3, lastArms.d, lastArms.t, 2)
8988
end
9089

91-
for k,v in pairs(data) do
90+
for _,v in pairs(data) do
9291
SetPedComponentVariation(cache.ped, v.index, v.drawable, v.texture, v.palette)
9392
appearance.saveSkin()
9493
TriggerServerEvent("clothing:sv:removeItem", data, slot)
@@ -123,14 +122,16 @@ clothing = {
123122
}
124123
}
125124

126-
for i = 1, 11 do
125+
for i = 0, 11 do
127126
if i ~= 2 then
128-
outfitData.outfit.comps[i] = {
129-
index = i,
130-
drawable = GetPedDrawableVariation(cache.ped, i),
131-
texture = GetPedTextureVariation(cache.ped, i),
132-
pallete = GetPedPaletteVariation(cache.ped, drawable)
133-
}
127+
if i == 5 and Config.AutomaticBackpack == false then
128+
outfitData.outfit.comps[i] = {
129+
index = i,
130+
drawable = GetPedDrawableVariation(cache.ped, i),
131+
texture = GetPedTextureVariation(cache.ped, i),
132+
pallete = GetPedPaletteVariation(cache.ped, drawable)
133+
}
134+
end
134135
end
135136
end
136137

client/cl_clothing.lua

+19-24
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,26 @@ local clothesData = Config.Menu.clothes.options
7777
for i = 1, 10 do
7878
local data = clothesData[i]
7979
if data and i ~= 2 then
80-
if i == 5 and Config.AutomaticBackpack then
81-
goto continue
82-
end
83-
84-
if Config.UseRadial then
85-
cOptions[#cOptions+1] = {
86-
label = _L(data.title),
87-
icon = data.icon,
88-
onSelect = function()
89-
TriggerEvent('clothing:cl:handleClothes', {index = i})
90-
end
91-
}
92-
else
93-
cOptions[#cOptions+1] = {
94-
title = _L(data.title),
95-
icon = data.icon,
96-
onSelect = function()
97-
TriggerEvent('clothing:cl:handleClothes', {index = i})
98-
end
99-
}
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
10098
end
10199
end
102-
::continue::
103100
end
104101

105102
local pOptions = {}
@@ -495,9 +492,7 @@ AddEventHandler('playerDropped', function()
495492
end)
496493

497494
AddEventHandler('onResourceStop', function(resourceName)
498-
if (GetCurrentResourceName() ~= resourceName) then
499-
return
500-
end
495+
if (GetCurrentResourceName() ~= resourceName) then return end
501496

502497
if hasMask then
503498
Config.MaskFix = false

server/sv_clothing.lua

+19-19
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ RegisterServerEvent('clothing:sv:giveOutfit', function(data, outfit)
1919
metadata['type'] = Config.MarkText
2020
end
2121

22-
for k,v in pairs(data.outfit.comps) do
23-
metadata[tostring(k)] = {}
24-
metadata[tostring(k)]['type'] = 'comp'
25-
metadata[tostring(k)]['index'] = v.index
26-
metadata[tostring(k)]['drawable'] = v.drawable
27-
metadata[tostring(k)]['texture'] = v.texture
28-
metadata[tostring(k)]['palette'] = v.palette
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
2930
end
30-
for k,v in pairs(data.outfit.props) do
31-
metadata[tostring(k)] = {}
32-
metadata[tostring(k)]['type'] = 'prop'
33-
metadata[tostring(k)]['index'] = v.index
34-
metadata[tostring(k)]['drawable'] = v.drawable
35-
metadata[tostring(k)]['texture'] = v.texture
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
3636
end
3737
Wait(100)
3838

@@ -49,12 +49,12 @@ RegisterServerEvent('clothing:sv:giveTorso', function(data)
4949
metadata['description'] = string.format('%s \n%s', gender, _L('created_by')..' '..name)
5050
end
5151

52-
for k,v in pairs(data.torso) do
53-
metadata[tostring(k)] = {}
54-
metadata[tostring(k)]['index'] = v.index
55-
metadata[tostring(k)]['drawable'] = v.drawable
56-
metadata[tostring(k)]['texture'] = v.texture
57-
metadata[tostring(k)]['palette'] = v.palette
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
5858
end
5959
Wait(100)
6060

0 commit comments

Comments
 (0)