26.09.2016, 13:15
Is the position saved when a player disconnects? If yes, if a player timeouts/crashes then GetPlayerPos will fail and the coordinates returned will be 0.0 for all x, y and z. A workaround is to check if the reason in OnPlayerDisconnect is 2 and not get the position (their last saved will be used instead).
When a player logins, store the coordinates to a global array and in OnPlayerSpawn you can set the position without executing a query to retrieve them every time. If the value in these coordinates is 0.0, spawn them somewhere else (default position).
When a player logins, store the coordinates to a global array and in OnPlayerSpawn you can set the position without executing a query to retrieve them every time. If the value in these coordinates is 0.0, spawn them somewhere else (default position).