Installation

1. Download resource

Download the purchased resource from keymaster - the official site of fivem with purchased resources.

2. Adjusting the script to the default core resources

esx_multicharacter

If you using esx_multicharacter you need change only this, do not change esx_identity

  1. Open @esx_multicharacter/client/main.lua

  2. Search for esx:playerLoaded

  3. Replace the trigger with this one below

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(playerData, isNew, skin)
	local spawn = playerData.coords or Config.Spawn
	if isNew or not skin or #skin == 1 then
		skin = Config.Default[playerData.sex]
		skin.sex = playerData.sex == "m" and 0 or 1
		local model = skin.sex == 0 and mp_m_freemode_01 or mp_f_freemode_01
		RequestModel(model)
		while not HasModelLoaded(model) do
			RequestModel(model)
			Wait(0)
		end
		SetPlayerModel(PlayerId(), model)
		ResetEntityAlpha(PlayerPedId())
		SetModelAsNoLongerNeeded(model)
		TriggerEvent('skinchanger:loadSkin', skin, function()
        		ResetEntityAlpha(PlayerPedId())
        		SetPedAoBlobRendering(PlayerPedId(), true)
                	TriggerEvent('vms_charcreator:openCreator')
    		end)
    	end
	if not isNew then
		DoScreenFadeOut(100)
	end
	SetCamActive(cam, false)
	RenderScriptCams(false, false, 0, true, true)
	cam = nil
	SetEntityCoordsNoOffset(PlayerPedId(), spawn.x, spawn.y, spawn.z, false, false, false, true)
	SetEntityHeading(PlayerPedId(), spawn.heading)
	if not isNew then 
		TriggerEvent('skinchanger:loadSkin', skin or Characters[spawned].skin) 
		Wait(400)
		DoScreenFadeIn(400)
		repeat Wait(200) until not IsScreenFadedOut()
	end
	TriggerServerEvent('esx:onPlayerSpawn')
	TriggerEvent('esx:onPlayerSpawn')
	TriggerEvent('playerSpawned')
	TriggerEvent('esx:restoreLoadout')
	Characters, hidePlayers = {}, false
end)

esx_identity

If you not using multicharacter system you need change only this

  1. Open @esx_identity/client/main.lua

  2. Search for RegisterNUICallback('register'

  3. Replace the nui callback with this one below

RegisterNUICallback('register', function(data, cb)
    if not guiEnabled then
        return
    end
    ESX.TriggerServerCallback('esx_identity:registerIdentity', function(callback)
        if not callback then
            return
        end
        ESX.ShowNotification(TranslateCap('thank_you_for_registering'))
        setGuiState(false)
        if not ESX.GetConfig().Multichar then
            TriggerEvent('vms_charcreator:openCreator', data.sex)
        end
    end, data)
end)

Last updated