Adjusting spawnmanager for skinchanger

Last night I installed the [Release][ESX][Clothing Shops] and everything required with it (esx_skin & skinchanger) and ran into an issue. On my first spawn everything worked fine, it gave me the menu to change my face and everything but after respawning upon death it went straight back to the regular model that you start with being one from fivem-map-skater.

I took a look at the article here because I thought it’d possibly help me with my solution but there is no server.lua in my fivem-map-skater map so there isn’t much I can go off from there. I am just trying to make sure that when a player changes his skin he is respawns with the same skin. I tried to throw TriggerEvent('skinchanger:loadSkin', skin) places in spawnmanager where it looked like it spawned the player but when putting that line of code in for some reason my player wouldn’t even spawn but rather lay their dead until I reconnected. Any help would be greatly appreciated, thanks!

3 Likes

the model and respawn are manage in the file

/resources/[system]/spawnmanager/spawnmanager.lua

and depending the map you have :

resources\fivem-map-hipster
resources\fivem-map-skater

after if you have a custom player , then you have to make a script who will handle the proper model to respawn when he die.

So I know this is a really late response but i had the same problem and FINALLY fixed it.

Remove line 255 of your spawnmanager.lua

SetPlayerModel(PlayerId(), spawn.model)

and that will load your saved skin when you spawn or re-spawn after death.

6 Likes

You get this working?

1 Like

is there a solution for this? I also need it.

Commenting or removing that line will resolve the issue of saved skin not loading on death if that’s the issue you’re running into.

1 Like

i have try, it make my char not spawn when die, just show my dead body, nothing happen.

1 Like

I know VERY late reply but picked this back up and still having the same issue :frowning: I tried to comment out line 255 (SetPlayerModel(PlayerId(), spawn.model)) but it is spawning me with the default model still (a_m_y_skater_01).

1 Like

This has not worked for me, I commented out that line but it still spawning me with the default model (a_m_y_skater_01). :frowning:

Same problem here did you guys find a way to get it to work?

bump, please help

Go to your map resource (for example fivem-skater-map) and open map.lua file. Then just do this:

spawnpoint 'mp_m_freemode_01' { x = 111.23, y = 111.23, z = 111.23 }

Coords defines the first spawn of the player when he is creating new character, but you need to remove other spawnpoints and leave only one with this ped name. Works okay for female char too. Tell if this helps. I didn’t changed anything in other resources so I recommend to uncomment those SetPlayerModel in spawnmanager or something.

1 Like

still doesnt work…

can some one help me out i cant crate a second char when i do it my char turns in to a yellow shirt ped but i can still play on my other char ? but it dosent come up with a new one i saw in the read me file this and wounder where i shuld place this one

Usage

local isMale = true

local skin = {
	sex          = 1,
	face         = 0,
	skin         = 0,
	beard_1      = 0,
	beard_2      = 0,
	beard_3      = 0,
	beard_4      = 0,
	hair_1       = 0,
	hair_2       = 0,
	hair_color_1 = 0,
	hair_color_2 = 0,
	tshirt_1     = 0,
	tshirt_2     = 0,
	torso_1      = 0,
	torso_2      = 0,
	decals_1     = 0,
	decals_2     = 0,
	arms         = 0,
	pants_1      = 0,
	pants_2      = 0,
	shoes_1      = 0,
	shoes_2      = 0,
	mask_1       = 0,
	mask_2       = 0,
	bproof_1     = 0,
	bproof_2     = 0,
	chain_1      = 0,
	chain_2      = 0,
	helmet_1     = 0,
	helmet_2     = 0,
	glasses_1    = 0,
	glasses_2    = 0,
}

-- Load freemode model
TriggerEvent('skinchanger:loadDefaultModel', isMale)

-- Load skin
TriggerEvent('skinchanger:loadSkin', skin)

-- you can also load only some components :
TriggerEvent('skinchanger:loadSkin', {
	sex          = 0,
	beard_1      = 0,
	beard_2      = 0,
})

-- Get list of components and maxVals
TriggerEvent('skinchanger:getData', function(components, maxVals)
	print('Components => ' .. json.encode(components))
	print('MaxVals => ' .. json.encode(maxVals))
end)

-- Get current skin
TriggerEvent('skinchanger:getSkin', function(skin)
	print(json.encode(skin))
end)

Ok great, this fixed the skin problem thank you! but I do not have my guns. It shows the guns in my inventory but not when I click tab. if I go into the skin menu and change something and accept it gives me my guns.

Please assist.

Hey guys please help :frowning: :frowning: when i try to put job’s clothes i have THIS error :frowning: