[SQLITE] Spawns player at the center of the map.
#4

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).
Reply


Messages In This Thread
[SQLITE] Spawns player at the center of the map. - by ChristolisTV - 26.09.2016, 12:31
Re: [SQLITE] Spawns player at the center of the map. - by TheDarkBlade - 26.09.2016, 12:46
Re: [SQLITE] Spawns player at the center of the map. - by ChristolisTV - 26.09.2016, 12:50
Re: [SQLITE] Spawns player at the center of the map. - by Konstantinos - 26.09.2016, 13:15

Forum Jump:


Users browsing this thread: 1 Guest(s)