Cronoss Posted February 2, 2022 Share Posted February 2, 2022 well, it's me again, I got a new problem with my skin-system, I wanted to make a save-system for the skin, the save-system itself works, it remember the name of the player, BUT not the skin, here it's the code: When I login the game sets me the CJ default skin (server-side) function recordarPersonaje() local cuentaJugador = getPlayerAccount(source) if (cuentaJugador) and not isGuestAccount(cuentaJugador) then local personajeDatos = getPlayerName(source) local skinPJ = getElementModel(source) setAccountData(cuentaJugador, "nombre", personajeDatos) setAccountData(cuentaJugador, "skin", skinPJ) end end function darDatos(_, cuentaJugador) if (cuentaJugador) then local skinJugadorDar = getAccountData(cuentaJugador, "skin") local nombreJugadorDar = getAccountData(cuentaJugador, "nombre") if (nombreJugadorDar) then setPlayerName(source, nombreJugadorDar) setElementModel(source, skinJugadorDar) end end end addEventHandler("onPlayerQuit", root, recordarPersonaje) addEventHandler("onPlayerLogin", root, darDatos) I just need to know if I'm doing something wrong or there is another method to remember the skin of the player that i'm missing (PD: the option to set the player skin is in server-side too, I tested with another player, and we both can see eachother skin when we choose it, so I really don't understand what's wrong) Link to comment
WorthlessCynomys Posted February 2, 2022 Share Posted February 2, 2022 Hi! Does debugscript say anything? Make yourself an ACL admin and type debugscript 3 into the F8 console. Link to comment
βurak Posted February 2, 2022 Share Posted February 2, 2022 (edited) this issue will not work if done before spawning player using spawnPlayer function so make sure the player spawn example: addEventHandler("onPlayerJoin", root, function() setElementModel(source, 10) --will not work because the player did not spawn spawnPlayer(source, 0, 0, 3) end ) addEventHandler("onPlayerJoin", root, function() spawnPlayer(source, 0, 0, 3) setElementModel(source, 10) --it will work end ) Edited February 2, 2022 by Burak5312 1 1 Link to comment
Cronoss Posted February 2, 2022 Author Share Posted February 2, 2022 I get it, thanks again, Burak Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now