search qb-clothes:client:CreateFirstCharacter and replace the event with this.
RegisterNetEvent('qb-clothes:client:CreateFirstCharacter')
AddEventHandler('qb-clothes:client:CreateFirstCharacter', function()
QBCore.Functions.GetPlayerData(function(pData)
local skin = "mp_m_freemode_01"
openMenu({
{menu = "character", label = "Character", selected = true},
{menu = "clothing", label = "Features", selected = false},
{menu = "accessoires", label = "Accessories", selected = false}
})
if pData.charinfo.gender == 1 then
skin = "mp_f_freemode_01"
end
ChangeToSkinNoUpdate(skin)
SendNUIMessage({
action = "ResetValues",
})
Citizen.CreateThread(function ()
while creatingCharacter do
Wait(100)
end
TriggerEvent("fnx-startselection:OpenPanel")
end)
end)
end)
How can I add it in ESX?
go to esx_skin client and search esx_skin:playerRegistered replace with this code
AddEventHandler('esx_skin:playerRegistered', function()
CreateThread(function()
while not ESX.PlayerLoaded do
Wait(100)
end
if firstSpawn then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin == nil then
TriggerEvent('skinchanger:loadSkin', {sex = 0}, OpenSaveableMenu)
Wait(100)
skinLoaded = true
else
TriggerEvent('skinchanger:loadSkin', skin)
Wait(100)
skinLoaded = true
end
end)
firstSpawn = false
end
Citizen.CreateThread(function ()
while firstSpawn do
Wait(100)
end
TriggerEvent("fnx-startselection:OpenPanel")
end)
end)
end)