Skip to content

Commit

Permalink
fix: Shoes not appearing in outfit
Browse files Browse the repository at this point in the history
  • Loading branch information
LikeManTV committed May 14, 2024
1 parent 3def08b commit d5de346
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 57 deletions.
29 changes: 15 additions & 14 deletions client/cl_class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ clothing = {
local isNaked = utils.isNaked()

if not isNaked then clothing.handleUndress('outfit', true) end
for k, v in pairs(data) do
if v.type == 'comp' then
SetPedComponentVariation(cache.ped, v.index, v.drawable, v.texture, v.palette)
elseif v.type == 'prop' then
SetPedPropIndex(cache.ped, v.index, v.drawable, v.texture)
end
for _, v in pairs(data.comps) do
SetPedComponentVariation(cache.ped, v.index, v.drawable, v.texture, v.palette)
end
for _, v in pairs(data.props) do
SetPedPropIndex(cache.ped, v.index, v.drawable, v.texture)
end
SetPedComponentVariation(cache.ped, 2, hair, hairTexture, 0)
appearance.saveSkin()
Expand All @@ -88,7 +87,7 @@ clothing = {
SetPedComponentVariation(cache.ped, 3, lastArms.d, lastArms.t, 2)
end

for k,v in pairs(data) do
for _,v in pairs(data) do
SetPedComponentVariation(cache.ped, v.index, v.drawable, v.texture, v.palette)
appearance.saveSkin()
TriggerServerEvent("clothing:sv:removeItem", data, slot)
Expand Down Expand Up @@ -123,14 +122,16 @@ clothing = {
}
}

for i = 1, 11 do
for i = 0, 11 do
if i ~= 2 then
outfitData.outfit.comps[i] = {
index = i,
drawable = GetPedDrawableVariation(cache.ped, i),
texture = GetPedTextureVariation(cache.ped, i),
pallete = GetPedPaletteVariation(cache.ped, drawable)
}
if i == 5 and Config.AutomaticBackpack == false then
outfitData.outfit.comps[i] = {
index = i,
drawable = GetPedDrawableVariation(cache.ped, i),
texture = GetPedTextureVariation(cache.ped, i),
pallete = GetPedPaletteVariation(cache.ped, drawable)
}
end
end
end

Expand Down
43 changes: 19 additions & 24 deletions client/cl_clothing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,26 @@ local clothesData = Config.Menu.clothes.options
for i = 1, 10 do
local data = clothesData[i]
if data and i ~= 2 then
if i == 5 and Config.AutomaticBackpack then
goto continue
end

if Config.UseRadial then
cOptions[#cOptions+1] = {
label = _L(data.title),
icon = data.icon,
onSelect = function()
TriggerEvent('clothing:cl:handleClothes', {index = i})
end
}
else
cOptions[#cOptions+1] = {
title = _L(data.title),
icon = data.icon,
onSelect = function()
TriggerEvent('clothing:cl:handleClothes', {index = i})
end
}
if i == 5 and Config.AutomaticBackpack == false then
if Config.UseRadial then
cOptions[#cOptions+1] = {
label = _L(data.title),
icon = data.icon,
onSelect = function()
TriggerEvent('clothing:cl:handleClothes', {index = i})
end
}
else
cOptions[#cOptions+1] = {
title = _L(data.title),
icon = data.icon,
onSelect = function()
TriggerEvent('clothing:cl:handleClothes', {index = i})
end
}
end
end
end
::continue::
end

local pOptions = {}
Expand Down Expand Up @@ -495,9 +492,7 @@ AddEventHandler('playerDropped', function()
end)

AddEventHandler('onResourceStop', function(resourceName)
if (GetCurrentResourceName() ~= resourceName) then
return
end
if (GetCurrentResourceName() ~= resourceName) then return end

if hasMask then
Config.MaskFix = false
Expand Down
38 changes: 19 additions & 19 deletions server/sv_clothing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ RegisterServerEvent('clothing:sv:giveOutfit', function(data, outfit)
metadata['type'] = Config.MarkText
end

for k,v in pairs(data.outfit.comps) do
metadata[tostring(k)] = {}
metadata[tostring(k)]['type'] = 'comp'
metadata[tostring(k)]['index'] = v.index
metadata[tostring(k)]['drawable'] = v.drawable
metadata[tostring(k)]['texture'] = v.texture
metadata[tostring(k)]['palette'] = v.palette
metadata.comps = {}
metadata.props = {}
for _,v in pairs(data.outfit.comps) do
metadata.comps[v.index] = {}
metadata.comps[v.index]['index'] = v.index
metadata.comps[v.index]['drawable'] = v.drawable
metadata.comps[v.index]['texture'] = v.texture
metadata.comps[v.index]['palette'] = v.palette
end
for k,v in pairs(data.outfit.props) do
metadata[tostring(k)] = {}
metadata[tostring(k)]['type'] = 'prop'
metadata[tostring(k)]['index'] = v.index
metadata[tostring(k)]['drawable'] = v.drawable
metadata[tostring(k)]['texture'] = v.texture
for _,v in pairs(data.outfit.props) do
metadata.props[v.index] = {}
metadata.props[v.index]['index'] = v.index
metadata.props[v.index]['drawable'] = v.drawable
metadata.props[v.index]['texture'] = v.texture
end
Wait(100)

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

for k,v in pairs(data.torso) do
metadata[tostring(k)] = {}
metadata[tostring(k)]['index'] = v.index
metadata[tostring(k)]['drawable'] = v.drawable
metadata[tostring(k)]['texture'] = v.texture
metadata[tostring(k)]['palette'] = v.palette
for _,v in pairs(data.torso) do
metadata[v.index] = {}
metadata[v.index]['index'] = v.index
metadata[v.index]['drawable'] = v.drawable
metadata[v.index]['texture'] = v.texture
metadata[v.index]['palette'] = v.palette
end
Wait(100)

Expand Down

0 comments on commit d5de346

Please sign in to comment.