Rollback
#1

Okay, I was wodering what's the best way to make rollback less effective?
Using a timer that each minute saves stats is the only answer that has came to my mind. Is there any better solution or advice?
Thanks in advance.
Reply
#2

I think OnPlayerSave will be good, it will save your stats when you /q from the game.

EDIT: if you need help with OnPlayerSave reply here.
Reply
#3

pawn Код:
//Top..
forward SaveStats();

//OnGamemodeInit..
SetTimer("SaveStats",1440000,true);//24 mins?..

//Anywhere in script..
public SaveStats()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        //saves stats code..
    }
    return 1;
}
Reply
#4

Sandman dont you think that SaveStats will lag his server a bit?
Reply
#5

I save stats when user dissconects and it's fine, but when server crashes or when you quit the smal black window (which appears you run "samp-server" ) Playerstats and server stats are lost.
Reply
#6

Quote:
Originally Posted by WoodPecker
Посмотреть сообщение
Sandman dont you think that SaveStats will lag his server a bit?
Lol why are you people so scared of timers..

EDIT:

"I think OnPlayerSave will be good"

wtf is OnPlayerSave..

Who helped him now?
Reply
#7

Quote:
Originally Posted by The.Sandman
Посмотреть сообщение
pawn Код:
//Top..
forward SaveStats();

//OnGamemodeInit..
SetTimer("SaveStats",1440000,true);//24 mins?..

//Anywhere in script..
public SaveStats()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        //saves stats code..
    }
    return 1;
}
Yes I have done that but I am asking if there is a better solution, It will cause lag :S (i have put timer on one min )
Reply
#8

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
Yes I have done that but I am asking if there is a better solution
Maybe a SetTimerEx other then that no..
Reply
#9

Quote:
Originally Posted by The.Sandman
Посмотреть сообщение
Maybe a SetTimerEx other then that no..
Okay. Thanks. SetTimer is better than SetTimerEx, that's for sure.
Reply
#10

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
Okay. Thanks. SetTimer is better than SetTimerEx, that's for sure.
No, SetTimerEx would spawn an timer for an specific player, saving only that specific player's file.

Calling SetTimer would need the server to loop through each player, do several check's then save each player's file.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)