Posts: 39
Threads: 23
Joined: Jan 2009
Reputation:
0
Hey,
I have made up a script which saves the location of where you last crash and that works if you crash.
But I changed it to where you last disconnect from the server and it works when you /q and join again.
BUT!! When I do /gmx or /rcon gmx it doesn't save the positions of the character in their files and it ends up spawning out underground near some farm.
Does anyone know what I should do to fix this?
Posts: 196
Threads: 0
Joined: Nov 2008
Reputation:
0
I think you have your stuff stored at OnPlayerDisconnect which doesn`t get executed when you restart your server.
OnGameModeExit is the function being called in this case.
What you could do is simply throw the stuff you have in OnPlayerDisconnect to OnGameModeExit (with a few adjustments of course).
Posts: 39
Threads: 23
Joined: Jan 2009
Reputation:
0
That doesn't seem to work.
It just does the same, loads out in red country.
I could always have the server kick all players before it GMX's, that works.
But how would I get it to work without kicking everyone?
Does the OnPlayerUpdate Function do anything? If there were 100 players online would it update instantly? Or would it take time to update?
I know the OnPlayerUpdate has the X Y and Z Pos saving in it, but how would I get it to save at GMX?
Posts: 196
Threads: 0
Joined: Nov 2008
Reputation:
0
Wouldn`t call OnPlayerDisconnect but do as I said what is equal to parts of your code.
Posts: 273
Threads: 4
Joined: Nov 2007
Reputation:
0
Kicking every player just to do a restart may cause some of them to just leave, I don't recommend it at all...
Alright, I had thought maybe OnPlayerDisconnect isn't called during a gamemode reset, so I'd then throw in your save function because it worked for me. If OnPlayerDisconnect is too important & MUST be called before the reset, I have to suggest creating a command that just calls that call back alone which would then be followed by your GMX command manually.
I think in my GMX command, I tried to call OnPlayerDisconnect before the gamemodeexit function, but don't think it worked, but could always try that if you want before making a new command