For the complete documentation index, see llms.txt. This page is also available as Markdown.

okok_multichar

Integration guide for okok_multichar.


Step 0 - ESX only (optional)

In es_extended/config.lua, set:

Config.Multichar = true

Instead of Config.Multichar = GetResourceState("esx_multicharacter") ~= "missing".


Step 1 - Replace cl_utils.lua

Replace the entire contents of cl_utils.lua with:

ESX = exports.es_extended:getSharedObject()

RegisterNetEvent(Config.EventPrefix..":notification")
AddEventHandler(Config.EventPrefix..":notification", function(title, text, type, time)
    if Config.UseOkokNotify then
        exports['okokNotify']:Alert(title, text, time, type)
    else
        ESX.ShowNotification(text)
    end
end)

RegisterNetEvent(Config.EventPrefix..":onCharacterSpawn")
AddEventHandler(Config.EventPrefix..":onCharacterSpawn", function()
end)

RegisterNetEvent(Config.EventPrefix..":characterFirstSpawn")
AddEventHandler(Config.EventPrefix..":characterFirstSpawn", function()
    TriggerServerEvent(Config.EventPrefix..":setWorld", 0)

    if Config.ClothingSystem == 'fivem-appearance' then
        exports['fivem-appearance']:startPlayerCustomization(function (appearance)
            if (appearance) then
                TriggerServerEvent('saveCharacterCustomization', JSON.encode(appearance))
            end
        end)
    elseif Config.ClothingSystem == 'illenium-appearance' then
        TriggerEvent('esx_skin:openSaveableMenu')
    elseif Config.ClothingSystem == 'rcore_clothing' then
        TriggerEvent('esx_skin:openSaveableMenu')
    end
end)

RegisterNetEvent(Config.EventPrefix..":loadCharacterClothing")
AddEventHandler(Config.EventPrefix..":loadCharacterClothing", function(skin, ped)
    if Config.ClothingSystem == 'illenium-appearance' then
        exports.rcore_clothing:setPedSkin(ped, skin)
    elseif Config.ClothingSystem == 'fivem-appearance' then
        exports['fivem-appearance']:setPedAppearance(ped, skin)
    elseif Config.ClothingSystem == 'rcore_clothing' then
        exports.rcore_clothing:setPedSkin(ped, skin)
    end
end)

RegisterNetEvent(Config.EventPrefix..":openSpawnSelection")
AddEventHandler(Config.EventPrefix..":openSpawnSelection", function(newChar, charinfo)
    TriggerServerEvent(Config.EventPrefix..":setWorld", 0)

    if Config.UseOkokSpawnSelector then
        TriggerEvent('okokSpawnSelector:spawnMenu', newChar, charinfo)
    end
end)

Step 2 - Replace sv_utils.lua

Replace the entire contents of sv_utils.lua with:

Last updated