Skip to content

Known problems with PySAMP

Cheaterman edited this page Jan 29, 2022 · 6 revisions

1. Toggling spectate mode off causes "Server closed connection":

Related issue: https://github.com/habecker/PySAMP/issues/42

If you use TogglePlayerSpectating(playerid, True) under OnPlayerRequestClass in your gamemode, you may experience that the gamemode will close the connection to the client when you exit spectate mode. We are not sure why this is happening, but it is documented here: If the player is not loaded in before setting the spectate status to false, the connection can be closed unexpectedly.

The current workaround is to call SpawnPlayer(playerid) just before starting spectating mode. This will properly load the player, before the spectate starts, and avoid you getting "closed connection" when you toggle spectate off.