Jump to content

Help ElementData


Recommended Posts

Hi guys, im doing a job and is almost done, just need one more thing. When some player starts the job, The skin of the job is set to him with this code. 

setElementData(player, "astronaut:Skin", setPedSkin (player, 264));

Until now, everything works. My problem is when the player leaves the job and the skin is not set to skin that the player was before, continues with the skin of the job. Even with this code.

removeElementData(player,"astronaut:Skin");

Thanks in advance for any help. :)

So far, everthing works. My problem is when the player leaves the job the skin is not set to what the player was before but rather continues with the skin of the jobSo far, everything works. My problem is when the player leaves the job the skin is not set to what the player was before but rather continues with the skin of the job.
  • Like 1
Link to comment
  • Moderators

You save a bool value to elementdata and not the old skin id.

 

-- enter to job
setElementData(player, "astronaut:Skin", getElementModel(player)) -- save old
setElementModel(player, 264)

-- leave job
setElementModel(player, getElementData(player, "astronaut:Skin")) -- load back
removeElementData(player, "astronaut:Skin")

 

  • Like 1
Link to comment
1 hour ago, stPatrick said:

You save a bool value to elementdata and not the old skin id.

 


-- enter to job
setElementData(player, "astronaut:Skin", getElementModel(player)) -- save old
setElementModel(player, 264)

-- leave job
setElementModel(player, getElementData(player, "astronaut:Skin")) -- load back
removeElementData(player, "astronaut:Skin")

 

Thanks a lot bro. ❤️ 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...