FaustinResources

Appearance menu

illenium-appearance works out of the box. Other menus are hooked up in the config.

illenium-appearance

illenium-appearance is free and needs no setup. Install it if you have no menu. If the appearance resource isn't running, new characters skip that step and the console tells you.

Your own menu

Fill in Config.appearance in config_advanced.lua. You write these functions yourself, because every menu saves its looks differently. my_clothing is an example name.

lua
Config.appearance = {
    resource = 'my_clothing',  -- the step only runs while this resource is started

    -- client: open your menu for a new character. The player stays in this step until you call AppearanceDone.
    open = function()
        TriggerEvent('my_clothing:openCreator', function()
            exports.faustin_multichar:AppearanceDone()
        end)
    end,

    -- client: put a saved look on a ped (the lineup, and the player when a character is picked)
    apply = function(ped, skin)
        exports.my_clothing:applyLook(ped, skin)
    end,

    -- server: the saved look of each character. cids is a list of citizenids (ESX: identifiers).
    -- skin is passed on to apply as it is, a table or a JSON string that decodes to one.
    getLooks = function(source, cids)
        local looks = {}
        local marks = ('?,'):rep(#cids):sub(1, -2)
        local rows = MySQL.query.await(('SELECT citizenid, model, look FROM my_clothing WHERE citizenid IN (%s)'):format(marks), cids) or {}
        for _, r in ipairs(rows) do looks[r.citizenid] = { model = r.model, skin = r.look } end
        return looks
    end,
}
FunctionWhereWhat it does
openclientOpens your menu for a new character. Call AppearanceDone when it has saved.
applyclientPuts a saved look on a ped.
getLooksserverReturns the saved look of each character. If you leave it out, characters stand in the lineup with default clothes.

Matching skin for illenium-appearance

Optional. extras/illenium-appearance-skin makes the editor match the script with the same type, dark panels and pink accent. It was tested with illenium-appearance v5.7.0, and the script has to be started since the fonts load from it.

In illenium-appearance/shared/theme.lua, set currentTheme = "faustin" and add this to themes:

lua
{
    id = "faustin",
    borderRadius = "2px",
    fontColor = "241, 235, 250",
    fontColorHover = "255, 255, 255",
    fontColorSelected = "21, 19, 39",
    fontFamily = "FR Sans",
    primaryBackground = "255, 133, 188",
    primaryBackgroundSelected = "255, 255, 255",
    secondaryBackground = "36, 31, 44",
    scaleOnHover = false,
    sectionFontWeight = "bold",
    smoothBackgroundTransition = true
},

Copy faustin.css to illenium-appearance/web/dist/, and add these lines inside <head> in web/dist/index.html, before the <script> line:

html
<link rel="stylesheet" href="https://cfx-nui-faustin_multichar/web/ui/css/tokens.css" />
<link rel="stylesheet" href="./faustin.css" />

Add 'web/dist/faustin.css', to the files list in illenium-appearance/fxmanifest.lua and restart illenium-appearance.