[ESX] Restrict skin for new player when creating

Name of resource : esx_skin LIGHTLY modified
Version : 1.1
Github : https://github.com/ESX-Org/esx_skin

What does it do : Allows to prohibit to a new arrival the options of helmet, mask, bulletproof jacket, hat which are obtainable only via esx_accessories
Replace function ‘esx_skin:openSaveableMenu’ at line 333 of ‘esx_skin/client/main.lua’ by this :

RegisterNetEvent('esx_skin:openSaveableMenu')
AddEventHandler('esx_skin:openSaveableMenu', function(submitCb, cancelCb)
  --OpenSaveableMenu(submitCb, cancelCb, nil)
  local restrict = {}
  restrict = {
    'sex',
    'face',
    'skin',
    'age_1',
    'age_2',
    'beard_1',
    'beard_2',
    'beard_3',
    'beard_4',
    'hair_1',
    'hair_2',
    'hair_color_1',
    'hair_color_2',
    'eyebrows_1',
    'eyebrows_2',
    'eyebrows_3',
    'eyebrows_4',
    'makeup_1',
    'makeup_2',
    'makeup_3',
    'makeup_4',
    'lipstick_1',
    'lipstick_2',
    'lipstick_3',
    'lipstick_4',
    'tshirt_1',
    'tshirt_2',
    'torso_1',
    'torso_2',
    'decals_1',
    'decals_2',
    'arms',
    'pants_1',
    'pants_2',
    'shoes_1',
    'shoes_2',
     'chain_1',
      'chain_2',
    }
    OpenSaveableMenu(submitCb, cancelCb, restrict)
end)

You’re welcome

13 Likes

Love it. (Post must be 20 chars)

1 Like

Awesome to know, But if I wanted to restrict a certain vehicle with a certain permission level (IE: police to permission level 1 and up) how would I do that?

Totally not the right topic… But totally possible and pretty easy with PlayerData.job.grade … :wink:

Thank you, and I know but you had something that was the closest to what i was looking for

1 Like

When this loads up it seems like something odd is happening to the camera like it becomes unbound from the player. Any ideas what I should do?

if you have put the options suggested by @Cr4zZyBipBiip and in the first spawn still appearing the options put the following below the line – local heading = 90.0 – this – restrict = true –

I have a problem, when I make a character and rejoin the server I spawn as Franklin or some random NPC guy.

Hi, in case someone has any problem with ped not being visible, or it’s in a spawn error for that session it’s “invisible”, try change firstSpawn by the following:

        if firstSpawn then
            ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
                if skin == nil then
--
                        model = "mp_m_freemode_01"
                        while not HasModelLoaded(model) do
                              Wait(1)
                        end
                        SetPlayerModel(PlayerId(), model)
                        SetPedDefaultComponentVariation(PlayerPedId())
--

This will help prevent issues with ‘invisible’ players in that session.

and I recommend adding the following features to restrict variable, to make it more faithful to the look and feel creation,

 'hair_1', 'hair_2', 'hair_color_1', 'hair_color_2', 'beard_1', 'beard_2', 'glasses_1', 'glasses_2',

thanks