PVars in OnGameModeExit
#1

I think it's very bad, that player variables are already deleted in OnGameModeExit.

If you want to use the PVars e.g. for saving data to your database, you'll fail.
Moreover whether you give an gmx the PVars aren't available in OnPlayerDisconnect, too.
In my view it should be very easy to delete the PVars after calling OnGameModeExit and OnPlayerDisconnect, isn't it?

I would be pleased to see this little change in 0.3c.

Level147
Reply
#2

OnGameModeExit gets called right before closure! So you still can save the PVars. ...

And PVars should be saved in OnPlayerDisconnect not OnGameModeExit
Reply
#3

Yes, I always save the data in OnPlayerDisconnect, but with a gmx there aren't the PVars available, too.
I don't want to save all this values to public variables...
Reply
#4

use a gmx command that first saves player data and then resets the gamemode.
Reply
#5

But there is still no way to fix if server crashes...
Reply
#6

Yes, do automatic saves called by a Timer.
Reply
#7

Quote:
Originally Posted by Cypog
View Post
Yes, do automatic saves called by a Timer.
You probably dont know what happens with that timer if there is a little mistake in script.. Or something goes down - for example mysql/plugin.. it will not write file for you, it will clean up them or set all values to 0.. so its not so safe..
Reply
#8

Quote:
Originally Posted by GaGlets®
View Post
You probably dont know what happens with that timer if there is a little mistake in script.. Or something goes down - for example mysql/plugin.. it will not write file for you, it will clean up them or set all values to 0.. so its not so safe..
You just make a timer of 30 seconds, that saves all players stats..
Reply
#9

Quote:
Originally Posted by The_Moddler
View Post
You just make a timer of 30 seconds, that saves all players stats..
30 seconds timer...

Player joins server, logins ~ 3 secs.. someone gives him alot of money.. ~ 20 secs in the past.. last 10 secs..
player disonnects hahahaaa players virtual money now is gone... roflmao?
Reply
#10

That will not happend, becouse server will crash before the timer.. also you should make backups.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)