Open Richards0nd opened 3 years ago
You cannot have skinchanger enabled in your server.cfg or it will corrupt the data that cui_character uses, also you should not use skinchanger:loadClothes or skinchanger:change. I only implemented them so the job scripts don't completely break.
Instead use cui_character:updateClothes
event. Look up the definition in client/main.lua
.
You need to remember that the data passed requires full character data not just the parts you changed (bproof) since they are all stored in one SQL column, so entire character needs to be updated whenever any clothing part changes.
What happens is that when you only pass the bproof, the rest of the table is filled with nil values and your character is overwritten with corrupted data.
You cannot have skinchanger enabled in your server.cfg or it will corrupt the data that cui_character uses, also you should not use skinchanger:loadClothes or skinchanger:change. I only implemented them so the job scripts don't completely break.
Instead use
cui_character:updateClothes
event. Look up the definition inclient/main.lua
.You need to remember that the data passed requires full character data not just the parts you changed (bproof) since they are all stored in one SQL column, so entire character needs to be updated whenever any clothing part changes.
What happens is that when you only pass the bproof, the rest of the table is filled with nil values and your character is overwritten with corrupted data.
I understood... Thank you for your help!
But I had only one doubt left ... In the case of the police job, when the player is going to add only the vest, what should I do? Because for example:
Example in the video (I completely removed the skinchanger to have no problem): https://youtu.be/YvHfBNYIZMo
When I recorded it, I ended up encountering another problem ... If I activate one of the clothes in the menu, and then use another one without removing the current one, it bugs everything ... In the video is showing the problem ...
If I just take the vest from the clothing menu, it will set all my standard clothes back ... Instead of just putting on the vest, which is correct ... Because if I have a work outfit on, and add the vest, it will replace all the work clothes, and put the player’s original clothes with the vest.
Then snapshot the work clothes somewhere and pass them to cui_character:updateClothes
instead of the standard.
If I activate one of the clothes in the menu, and then use another one without removing the current one, it bugs everything ... In the video is showing the problem ...
It's probably the same thing, something in that script still uses old skinchanger methods, find them and replace them.
Você conseguiu arrumar o erro, tenho mesmo problema com uniformes e com esx_np_skinshop_v2 mesmo erro eles usam skinchanger eu consegui uma hora desabilitar o skinchanger em jogo e tudo funcionou uniformes etc.. mas da erro de novo não entendo porque esse script substitui o skinchanger e o esx_skin
So change all skinchanger:loadClothes to cui_character:updateClothes?
If I just take the vest from the clothing menu, it will set all my standard clothes back ... Instead of just putting on the vest, which is correct ... Because if I have a work outfit on, and add the vest, it will replace all the work clothes, and put the player’s original clothes with the vest.
Then snapshot the work clothes somewhere and pass them to
cui_character:updateClothes
instead of the standard.If I activate one of the clothes in the menu, and then use another one without removing the current one, it bugs everything ... In the video is showing the problem ...
It's probably the same thing, something in that script still uses old skinchanger methods, find them and replace them.
I tried to change the correct events, as you had informed, but it doesn't even work ...
I changed what I had: skinchanger:loadClothes for: cui_character:updateClothes https://youtu.be/T1Ri2QHPzP4
Except as you can see in the video, it doesn't work. What should I do for sure? Because I'm 2 days trying to understand how the system works, to use it correctly, but I couldn't.
Você conseguiu arrumar o erro, tenho mesmo problema com uniformes e com esx_np_skinshop_v2 mesmo erro eles usam skinchanger eu consegui uma hora desabilitar o skinchanger em jogo e tudo funcionou uniformes etc.. mas da erro de novo não entendo porque esse script substitui o skinchanger e o esx_skin
Até o momento não consegui corrigir... Você tem que remover por completo o script skinchanger, deixar apenas o cui_character e o esx_skin. Para que funcione grande parte dos recursos...
I have a problem, and I can't solve it ....
I have a code on my server, which, if any player wears a vest, it automatically adds to the player, the vest (clothing), so that it is visually more realistic ...
However, after I added your script, it kind of stopped working properly. Whenever I wear the vest item, it changes all my clothes, it also changes my gender ... I've tried several options, but I can't fix it. I tried other ways to change the player's outfit, but also without success.
My original code (Before adding this script):
-- First attempt to try to make the code work
-- Second attempt
-- Third attempt
-- Fourth attempt
And another thing ... When I try to put / remove the vest, directly in the police menu (esx_police), it also gets the bug ...
I recorded a video, showing all the problems I encountered. https://youtu.be/saPma1s_4Pw
So, I did another test, only this time, I removed it, deleted the name of the skinchanger folder, and left another name. The bugs were minor ... Only when I put the clothes on to remove / add the vest that it totally changed to, otherwise ... it was working perfectly. https://youtu.be/Br7bqRc5cU8