NicooPasPris / nicoo_charcreator

Fivem Character Creator
47 stars 24 forks source link

Hair Colours #7

Closed Twiitchter closed 4 years ago

Twiitchter commented 4 years ago

Sorry man, didn't have time to do a pull request as I've heavily modified a lot to suit my needs and framework, Again thank you for this release!

But here are my additions to save hair colours. I know you'll know where to find to add it and at what lines.

Please double check my spelling of Color... because I normally use 'colour'.... It has ruined me so many times within code....

skinchanger

    elseif type == 'haircolor' then
        Character[index..'_1'] = v[1]
        Character[index..'_2'] = v[2]

client.lua

Apperance = {
    {
        item = 'hair',
        List = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73},
        index = 1,
        cam = 'face',
        itemType = 'component',
        itemID = 2,
        PercentagePanel = false,
        ColourPanel = false,
    },
    {
        item = 'hair_color',
        List = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63},
        index = 1,
        indextwo = 1,
        cam = 'face',
        itemType = 'haircolor',
        PercentagePanel = false,
        ColourPanel = true,
    },  

menu.lua

New Global HairColor = {}

In accept appearance button of rageUI.

                        for k,v in pairs(HairColor) do
                            TriggerEvent('skin:features', k, 'haircolor', v)
                        end          

In function updateApperance(id, selected, color)

        if app.itemType == 'haircolor' then
        HairColor[app.item] = {app.index, app.indextwo}
            SetPedHairColor(playerPed, app.index, app.indextwo)

message.lua

    hair_color = 'Hair Colour',
    hair_color_desc = 'Change the Colour and Highlight of your hair!',
NicooPasPris commented 4 years ago

Hi ! I will make the changes. Thank you for improving the resource :)

Twiitchter commented 4 years ago

This was corrected