openmultiplayer / openmultiplayer/open.mp
Other players can't see the correct player's skin if SetPlayerSkin is used right after SpawnPlayer
@AmyrAhmady is already working on this.
Since Oct 14, 2023.
- Dominant language
- C++
- Stars
- 641
- Forks
- 208
- PR merge metrics
- No merged PRs in 30d
Description
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)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.