[RELEASE] CleanUI (cui) character

you can add it by and on the jquery on the append. It’s not the best solution, but it works. the other way is to insert them on the Table of items

Okay understandable. To get the IDs of my current clothes I used

print(cui_character:getCurrentClothes)

This gives me a bunch of numbers which I guess are the IDs for the single component clothes. Can you tell me how they are formatted ? Which number represents which component. And where can I see if an ID goes over 2 or 3 digits ?

AddEventHandler('cui_character:getCurrentClothes', function(cb)
    local result = {}

    result.sex = currentChar.sex
    result.tshirt_1 = currentChar.tshirt_1
    result.tshirt_2 = currentChar.tshirt_2
    result.torso_1 = currentChar.torso_1
    result.torso_2 = currentChar.torso_2
    result.decals_1 = currentChar.decals_1
    result.decals_2 = currentChar.decals_2
    result.arms = currentChar.arms
    result.arms_2 = currentChar.arms_2
    result.pants_1 = currentChar.pants_1
    result.pants_2 = currentChar.pants_2
    result.shoes_1 = currentChar.shoes_1
    result.shoes_2 = currentChar.shoes_2
    result.mask_1 = currentChar.mask_1
    result.mask_2 = currentChar.mask_2
    result.bproof_1 = currentChar.bproof_1
    result.bproof_2 = currentChar.bproof_2
    result.neckarm_1 = currentChar.chain_1 or currentChar.neckarm_1
    result.neckarm_2 = currentChar.chain_2 or currentChar.neckarm_2
    result.helmet_1 = currentChar.helmet_1
    result.helmet_2 = currentChar.helmet_2
    result.glasses_1 = currentChar.glasses_1
    result.glasses_2 = currentChar.glasses_2
    result.lefthand_1 = currentChar.watches_1 or currentChar.lefthand_1
    result.lefthand_2 = currentChar.watches_2 or currentChar.lefthand_2
    result.righthand_1 = currentChar.bracelets_1 or currentChar.righthand_1
    result.righthand_2 = currentChar.bracelets_2 or currentChar.righthand_2
    result.bags_1 = currentChar.bags_1
    result.bags_2 = currentChar.bags_2
    result.ears_1 = currentChar.ears_1
    result.ears_2 = currentChar.ears_2

    cb(result)
end)

_1s are drawable IDs and _2s are texture IDs

This seems wrong.

image

Made a command for the current ID in policejob. How could that be negative?

Okay I tried the method to stream “addon clothes” as own DLC Packs and it worked perfectly. As you can see in this random script i found on Github I can put on the addon clothes. I guess esx_skin doesnt have a problem with it either.

Just cui_character does not want to recognize the new changes:

I streamed it through this XML:

<?xml version="1.0" encoding="UTF-8"?>
<ShopPedApparel>

<pedName>mp_m_freemode_01</pedName>

<dlcName>brandpack1</dlcName>

<fullDlcName>mp_m_freemode_01_brandpack1</fullDlcName>

<eCharacter>SCR_CHAR_MULTIPLAYER</eCharacter>

<creatureMetaData>MP_CreatureMetadata_brandpack1</creatureMetaData>

<pedOutfits>
</pedOutfits>
<pedComponents>
</pedComponents>
<pedProps>
</pedProps>
</ShopPedApparel>

Is there anything where cui_character gets his data from? Or do you have an idea what i exactly can tweak to make it flow :stuck_out_tongue_winking_eye:

You can see the natives used in GetComponentsData function in client/main.lua, it uses first GetNumberOfPedDrawableVariations, then GetNumberOfPedTextureVariations for every drawable.

To retrieve name, it uses a method shown here. Native used to obtain the struct with data is GetShopPedComponent, called with:

Citizen.InvokeNative(0x74C0E2A57EC66760, hash, blob)

Then the struct is unpacked and name is obtained with GetLabelText on gxt field:

function GetComponentDataFromHash(hash)
    local blob = string.rep('\0\0\0\0\0\0\0\0', 9 + 16)
    if not Citizen.InvokeNative(0x74C0E2A57EC66760, hash, blob) then
        return nil
    end

    local lockHash = string.unpack('<i4', blob, 1)
    local hash = string.unpack('<i4', blob, 9)
    local locate = string.unpack('<i4', blob, 17)
    local drawable = string.unpack('<i4', blob, 25)
    local texture = string.unpack('<i4', blob, 33)
    local field5 = string.unpack('<i4', blob, 41)
    local component = string.unpack('<i4', blob, 49)
    local field7 = string.unpack('<i4', blob, 57)
    local field8 = string.unpack('<i4', blob, 65)
    local gxt = string.unpack('c64', blob, 73)

    return component, drawable, texture, gxt, field5, field7, field8
end

This is all repeated for props, since they use separate set of natives.

I guess that what you define in this xml, can be retrieved from that struct if it has a hash name (that GetShopPedComponent takes as argument).

I’ve noticed that you don’t define a hash name for your added clothes anywhere and I’m not sure if that’s even possible.

At one point cui_character uses GetHashNameForComponent on each component/drawable/texture group. If the hash is 0, that group is then skipped entirely. I think that this is what eliminates your custom clothes from the list.

Okay I understand. And is there a way to still add clothes even if they miss the missing meta data?
For example if there is a hash then the name is getting loaded. If not then the name is NULL but the Clothes are still getting loaded.

If there is a hash but no name, it will also be skipped (at a later step). You need to add both hash and name if you want it to be on the list, or rework how clothes are selected/displayed, but that would be time-consuming.

Is there no way to ignore these checks? I saw that you check the Hashes here:

if hash ~= 0 then

                local component, drawable, texture, gxt = GetComponentDataFromHash(hash)

                -- only named components

                if gxt ~= '' then

                    label = GetLabelText(gxt)

                    if label ~= 'NULL' then

                        local blacklisted = false

                        if componentBlacklist ~= nil then

                            if componentBlacklist[component] ~= nil then

                                if componentBlacklist[component][drawable] ~= nil then

                                    if componentBlacklist[component][drawable][texture] ~= nil then

                                        blacklisted = true

                                    end

                                end

                            end

                        end

    

                        if not blacklisted then

                            table.insert(result, {

                                name = label,

                                component = component,

                                drawable = drawable,

                                texture = texture

                            })

                        end

                    end

                end

            end

        end

    end

I tweaked some functions and I already got the clothes listed in the creator as “NULL” but they didnt load on my character.
I could go through the menu and had exactly the same number of options as Shirts out of my pack.
So basically I think it wouldnt be that difficult to get them loading. The names are not that important for me.

Hi, Thank you for this amazing script and making it available for free. It has almost everything I expected from a character creator. I also added the arms section to that thanks to @ilconfa above.

The only issue I am having is that original skin menu from ESX Legacy is popping up after I saved my character and if anything changed there it completely mess up the character created. Is there a way to disable skin menu pop up after character creation? Disabling esx_skin is not an option I think as
esx_multicharacter is depending on it.

when i load into my server im just frozen in place and invisible

Make sure you installed everything correctly. Look into the config.lua there you can see additional information. Check your ESX Version and make the changes that could have to be made.

Thank you again for this wonderful cui! I was wondering if there is something that is placing a default decal on the character? I notice that it has a weird tint it adds to the clothing but if I go into vMenu and change badges/logo it removes it. I wasn’t sure if I could find what is causing this somewhere in your script or if it might be from elsewhere.

Any way to change date format? its mm/dd/yyyy but in days i cant put more than 12, i’ve tried to change it in the config to dd/mm/yyyy but nothing happens, any help?

Is there any way to show all clothes, even if it appears as “Null” or “Unnamed”?

Another interesting option would be to show the ID next to the name like “Pendulus Sport Black Sports (3)” or something similar.

I love the character creation of this mod, it is simple and similar to the original online mode, it is easy to create a decent/beauty character!
But the section of clothes and accessories … I have no experience to modify that mod, and it skip a lot of clothes/accesories… And is not compatible with any other clothing store mod (even if they are ugly).

You definitely can, just need to pay for a developer to assist. Unfortunately, a majority of the things that are worthwhile or custom are going to cost you.

Yeah yeah, money fixes “everything” :wink:
I’m not going to open a server to the public, it’s not my intention.
I have compiled and modified many servers like L2, WoW, Aion, B&S and many others.
But I always modify them to play with friends/girlfriend, just for fun. I will not pay for a modification/customization. I can live without it.

And sorry for the off-topic! If my idea seems absurd will be ignored, and if it will be implemented, in my opinion it would be an improvement… If I learn how to do it, I would share it. But that is not going to happen. :joy:
Anyway, thanks!

We’re down. My character is gone. nothing came up

Processing: image.png…