Problem with saving position
#1

Well, when I log out and log in to the server it works. Position is saved and player spawns on the place where he logged out. But when I restart the server, player gets spawned somewhere in the air, the screen is all white and there's a message saying "Stay within the world boundaries". When I check saved position in the .ini file it says:

PosX=0.000000
PosY=0.000000
PosZ=-95.604408


I don't get it, what is the problem here. I uploaded my whole GM code in hope you guys would help. I know the GM is shit atm but I plan to improve it.

Also, the position is loaded on login and put in AddPlayerClass on playerspawn. OnPlayerDisconnect is the position saving code.

EDIT: Pastebin http://pastebin.com/AgcWz68k
Reply
#2

Ongamemodeinit, set every to login/register when that is called
Reply
#3

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
Ongamemodeinit, set every to login/register when that is called
They do. That's not the problem. The problem is that the position where the player logged off doesn't load after restarting the server.
Reply
#4

Create a function to save all players' information, and then gmx. Make sure to not save their info tagain in OnGameModeExit
Reply
#5

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
Create a function to save all players' information, and then gmx. Make sure to not save their info tagain in OnGameModeExit
After I restart the server but before I log into it for the second time, the co-ordinates are saved in the .ini. I read them . When you log in then you go to X,Y,Z 0,0,-90 for some reason. So, before logging in, info is saved, but after logging in it gets messed up and not read properly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)