28.03.2013, 03:07
https://sampwiki.blast.hk/wiki/TogglePlayerSpectating
^^ the only function you can use to prevent this from happening. Generally, servers that don't use the regular way to select a "class" will use TogglePlayerSpectating() under OnPlayerConnect and then use it again [to disable it] when the player registers/authenticates.
When a player dies, it might be a good idea to set a 1-2 second timer that enables TogglePlayerSpectating() so you can do what you need. And then obviously, when you're ready to spawn them again, just disable TogglePlayerSpectating and set their position.
^^ the only function you can use to prevent this from happening. Generally, servers that don't use the regular way to select a "class" will use TogglePlayerSpectating() under OnPlayerConnect and then use it again [to disable it] when the player registers/authenticates.
When a player dies, it might be a good idea to set a 1-2 second timer that enables TogglePlayerSpectating() so you can do what you need. And then obviously, when you're ready to spawn them again, just disable TogglePlayerSpectating and set their position.