NEXT Scripts Docs
  • NEXT Scripts | FiveM Resource Studio
  • CHAR CREATOR
    • Info | CharCreator
    • Installation
    • Events
  • X MENU
    • Info | X Menu
    • Installation
      • Configuration
      • Job Lock & Multi Job
    • Utils
  • Binoculars
    • Info | Binoculars
Powered by GitBook
On this page
  • 1. Download Asset from Keymaster
  • 2. Add the SQL
  • 3. Modify esx_skin
  • 4. Restart Server
  1. CHAR CREATOR

Installation

How to install the char creator

Please follow each step carefully to avoid unnecessary mistakes

Dependencies

  • skinchanger

  • oxmysql

  • es_extended

1. Download Asset from Keymaster

  1. First you have to get you resource from CFX Keymaster. Go to https://keymaster.fivem.net/asset-grants and download the CharCreator | NEXT Scripts resource

2. Unpack the Zip File and Drag&Drop next-char-creator resource into the resources folder of your server

3. Go to you server.cfg and add the following on the bottom

start next-char-creator

2. Add the SQL

To make the char creator work you have to import the small sql file which comes with the download, called char_creator.sql into your database.

Or you just run these two lines in you database

ALTER TABLE `users` ADD `skin_created` INT(1) NOT NULL DEFAULT '0'; -- Create skin_created column
UPDATE `users` SET skin_created = 2 WHERE identifier IS NOT NULL -- Set every existing player to 1

3. Modify esx_skin

In order for the new players on your server to really be able to use the new char creator system, we need to make some modifications to esx_skin, which is usually responsible for skin creation.

  1. First you need to find esx_skin in your resources folder

2. Replace code in client.lua

Open esx_skin/client/main.lua and replace the following parts.

Replace this

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
    end)
end)

with this

AddEventHandler('esx_skin:playerRegistered', function()
    CreateThread(function()
        while not ESX.PlayerLoaded do
            Wait(100)
        end
        
        if firstSpawn then
        
           TriggerServerEvent('nextSkin:PlayerRegistered')
           
           firstSpawn = false
       end
           
   end)
end)

this

RegisterNetEvent('esx_skin:openMenu')
AddEventHandler('esx_skin:openMenu', function(submitCb, cancelCb)
    OpenMenu(submitCb, cancelCb, nil)
end)

with this

RegisterNetEvent('esx_skin:openMenu')
AddEventHandler('esx_skin:openMenu', function(submitCb, cancelCb)
    TriggerEvent('nextSkin:OpenSkinMenu')
end)

and this

RegisterNetEvent('esx_skin:openSaveableMenu')
AddEventHandler('esx_skin:openSaveableMenu', function(submitCb, cancelCb)
    OpenSaveableMenu(submitCb, cancelCb, nil)
end)

with this

RegisterNetEvent('esx_skin:openSaveableMenu')
AddEventHandler('esx_skin:openSaveableMenu', function(submitCb, cancelCb)
    TriggerEvent('nextSkin:OpenSkinMenu')
end)

4. Restart Server

Now everything is set correctly and all you have to do is restart your server

PreviousInfo | CharCreatorNextEvents

Last updated 10 months ago

esx_skin in the resources folder