Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessories disappearance #307

Merged
merged 5 commits into from
May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions client/outfits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,32 @@ function LoadJobOutfit(oData)
SetPedComponentVariation(ped, 6, data["shoes"].item, data["shoes"].texture, 0)
end

-- Bag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this cause the outfits to not have a bag anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test it because my script takes control of the backpacks on the server. However, I will test it without it to see what happens. But, I believe that shouldn't remove bags.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but what I mean is that this will not work anymore with the change above: https://github.com/iLLeniumStudios/illenium-appearance/blob/main/shared/config.lua#L610

As the table for the outfits goes through this event, it would not set the bag for that outfit and will keep whatever the user is wearing already

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it on qbcore load/logout and restarting the script works fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swkeep can you try setting a different bag in the outfits and then see if putting on that outfit applies that bag? I think that is the case that I'm trying to make sure, is working

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swkeep Nevermind. It should work, I didn't check the full file and it was just a duplicate, my bad

if data["bag"] ~= nil then
SetPedComponentVariation(ped, 5, data["bag"].item, data["bag"].texture, 0)
end

-- Badge
if data["decals"] ~= nil then
SetPedComponentVariation(ped, 10, data["decals"].item, data["decals"].texture, 0)
end

-- Accessory
local tracker = Config.TrackerClothingOptions

if data["accessory"] ~= nil then
if Framework.HasTracker() then
SetPedComponentVariation(ped, 7, 13, 0, 0)
SetPedComponentVariation(ped, 7, tracker.drawable, tracker.texture, 0)
else
SetPedComponentVariation(ped, 7, data["accessory"].item, data["accessory"].texture, 0)
end
else
if Framework.HasTracker() then
SetPedComponentVariation(ped, 7, 13, 0, 0)
SetPedComponentVariation(ped, 7, tracker.drawable, tracker.texture, 0)
else
SetPedComponentVariation(ped, 7, -1, 0, 2)
local drawableId = GetPedDrawableVariation(ped, 7)

if drawableId ~= -1 then
local textureId = GetPedTextureVariation(ped, 7)
if drawableId == tracker.drawable and textureId == tracker.texture then
SetPedComponentVariation(ped, 7, -1, 0, 2)
end
end
end
end

Expand Down
4 changes: 4 additions & 0 deletions shared/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Config.NearestShopBlipUpdateDelay = 10000
Config.InvincibleDuringCustomization = true

Config.PreventTrackerRemoval = true -- Disables "Scarf and Chains" section if the player has tracker
Config.TrackerClothingOptions = {
drawable = 13,
texture = 0
}

Config.NewCharacterSections = {
Ped = true,
Expand Down