Stat saving methods?
#1

Hello everyone, I have a question...

What are the best methods of saving player stats?(so stats aren't lost in server crash or GMX) Timers? OnPlayerUpdate? What is the best method that is servercrashfree?

Another question, I am dealing with a very badly indented script that is 22k+ lines. Is there some kinda way to indent the script correctly automatically?
Reply
#2

Quote:
Originally Posted by ReFuSeR
Hello everyone, I have a question...

What are the best methods of saving player stats?(so stats aren't lost in server crash or GMX) Timers? OnPlayerUpdate? What is the best method that is servercrashfree?

Another question, I am dealing with a very badly indented script that is 22k+ lines. Is there some kinda way to indent the script correctly automatically?
Dunno about the crashing, but you could make your own command for GMX which saves players accounts first, then starts a 2 second timer that restarts the server.

There is a program called Pawn Studio, which has auto indentation in it.
Reply
#3

Quote:
Originally Posted by dre$tA
Quote:
Originally Posted by ReFuSeR
Hello everyone, I have a question...

What are the best methods of saving player stats?(so stats aren't lost in server crash or GMX) Timers? OnPlayerUpdate? What is the best method that is servercrashfree?

Another question, I am dealing with a very badly indented script that is 22k+ lines. Is there some kinda way to indent the script correctly automatically?
Dunno about the crashing, but you could make your own command for GMX which saves players accounts first, then starts a 2 second timer that restarts the server.

There is a program called Pawn Studio, which has auto indentation in it.
Thank you so much for the information on Pawn Studio. This program rocks...


Any other suggestions for saving stats on GMX and servercrash?
Reply
#4

You could save the player's stats every three seconds.
Reply
#5

Quote:
Originally Posted by Giacomand
You could save the player's stats every three seconds.
LOL that would take a lot of resources on a large server. And all you gotta do is save the player files often. try like every 5 minutes. nobody is going to get upset if the server crashes and they lose 5 minutes worth of gameplay.
Reply
#6

Thanks for your input...


Anyone else have some good methods?


Is their a method where people absolutely don't lose anything when server crash? Is there a callback that I yet to hear of? "OnServerCrash?"



I will search the forums abit more to see if I can run across anything useful.

Reply
#7

Maybe just make it so whenever something happens to a player stats update it to the file automatically, Example:

In a command you earn $100, At the end of the command Write the line of which you save the players money with, Or make a little function that saves all the players stats liek this:

pawn Код:
forward SavePlayer(playerid);
pawn Код:
public SavePlayer(playerid)
{
//Put saving stuff here
}
and at the end of the command put:
pawn Код:
SavePlayer(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)