> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_clothing/rcore_clothes/cui_character.md).

# cui\_character

{% hint style="danger" %}
Adding new fonts is recommended ONLY for experienced developers!
{% endhint %}

### cui\_character

cui\_character have troubles with skinchanger bridge, which is why you may need to do following changes.

**server/main.lua**

```lua
    RegisterServerEvent('esx_skin:save')
    AddEventHandler('esx_skin:save', function(data)
        charSave(data, source)
    end)

    RegisterServerEvent('cui_character:save')
    AddEventHandler('cui_character:save', function(data)
        charSave(data, source)
    end)

    function charSave(data, Source)
        local xPlayer = ESX.GetPlayerFromId(Source)

        if ESX.GetConfig and ESX.GetConfig().Multichar and xPlayer == nil then
            charSkins[Source] = data
            return
        else
            charSkins[Source] = nil
        end

        MySQL.ready(function()
            MySQL.Async.execute('UPDATE users SET skin = @data WHERE identifier = @identifier', {
                ['@data'] = json.encode(data),
                ['@identifier'] = xPlayer.identifier
            })
        end)
    end
```

**client/main.lua**

```lua
RegisterNetEvent('skinchanger:loadSkin')
AddEventHandler('skinchanger:loadSkin', function(skin, cb)
    local newSkin = GetDefaultCharacter(skin.sex == 0)

    for key, value in pairs(currentChar) do
        if newSkin[key] then
            newSkin[key] = value
        end
    end

    for key, value in pairs(skin) do
        if newSkin[key] then
            newSkin[key] = value
        end
    end

    UpdateClothes(newSkin)
    LoadCharacter(newSkin, cb)
end)
```

```lua
function LoadModel(hash)
    isModelLoaded = false
    local playerPed = PlayerPedId()

    if GetEntityModel(playerPed) == hash then
        isModelLoaded = true
        return
    end

    SetEntityInvincible(playerPed, true)

    if IsModelInCdimage(hash) and IsModelValid(hash) then
        RequestModel(hash)
        while not HasModelLoaded(hash) do
            Citizen.Wait(0)
        end
        SetPlayerModel(PlayerId(), hash)
        FreezePedCameraRotation(playerPed, true)
    end
    SetEntityInvincible(playerPed, false)

    isModelLoaded = true
    if not Config.StandAlone then
        TriggerEvent('skinchanger:modelLoaded')
    end
end
```

**There are another ways around it, you can get a pre-done version :)**

{% embed url="<https://github.com/Xogy/cui_character>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.rcore.cz/paid-resources/rcore_clothing/rcore_clothes/cui_character.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
