okok_multichar
Step 0 (optional - only ESX)
Navigate to es_extended/config.lua and set Config.Multichar = true instead of Config.Multichar = GetResourceState("esx_multicharacter") ~= "missing"
Step 1 - Replace file cl_utils.lua
cl_utils.luaESX = 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()
-- You can add here your code
end)
RegisterNetEvent(Config.EventPrefix..":characterFirstSpawn")
AddEventHandler(Config.EventPrefix..":characterFirstSpawn", function()
TriggerServerEvent(Config.EventPrefix..":setWorld", 0) -- You can remove it here and add it on your clothing menu after creating the character
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) -- You can remove it here and add it on your clothing menu after creating the character
if Config.UseOkokSpawnSelector then
TriggerEvent('okokSpawnSelector:spawnMenu', newChar, charinfo)
else
-- You can add your own spawn selector here
end
end)Step 2 - Replace file sv_utils.lua
sv_utils.luaLast updated
Was this helpful?