open.mp
open.mp copied to clipboard
Other players can't see the correct player's skin if SetPlayerSkin is used right after SpawnPlayer
Describe the bug
I noticed that if you set the skin of a player (let's call it Player_A) with SetPlayerSkinright after using SpawnPlayer, Player_A sees its PG with the skin set by SetPlayerSkin while other players see Player_A with the skin set with SetSpawnInfo (or Skin ID 0 if you didn't use it anywhere in the script).
If another player joins the server, it will see Player_A with the skin set by SetSpawnInfo (or Skin ID 0).
To Reproduce At least two players needed.
- Use
SpawnPlayer. - Set a player's skin with
SetPlayerSkinimmediately after.
You can reproduce it with this code. It features a command used to "sync" the player by basically saving some data and respawning the player at the same position with the same weapons. The other player in front of you should type /skin ID and /sync afterwards and you'll notice the issue at once. If you pay attention, you can even see that for a moment the correct skin actually is set but it's immediately replaced by the CJ skin.
Expected behavior
Other players should instead see the skin set with SetPlayerSkin.
Screenshots and/or logs

Commit hash in master (https://github.com/openmultiplayer/open.mp/commit/441a63a74712003d8a3c05745cc30c93f07922ff)