Help with save DATA dini
#1

Hi,


Help me to make save when player crashes...
Like when player play i make server restart and when he connects after restart there is first money and xp which you get when register...


Thanks in advance
Reply
#2

Read up tutorials on dini, there are lots of them.
Reply
#3

but there is no tut about how to save data when server crashes...
OnPlayerDisconnect with cases it doesn't work... When i kill server over Putty everything gone for players..
Reply
#4

The player is still disconnected when the server restarts, so OnPlayerDisconnect will be called.
There is probably something wrong elsewhere in your script.
Reply
#5

where it could be the error ?
Reply
#6

Show us your code, and we might be able to help.
Reply
#7

My code is very big.. :S
Reply
#8

on player disconnect there are 3 cases lost connection disconnect or kick

when i make my save code on playerdisconnect it works when people press esc and press disconnect or exit anyway when i kill my server process on linux everything gone for people if people stand on save pickup and then i kill process for them save's all money and xp until the time they stand on save pickup after save pickup money wich they get after save gone...
Reply
#9

Try adding this to "OnGameModeExit()"

pawn Код:
foreach(Player, i) //use a for loop if you don't have foreach
{
    if( IsPlayerConnected( i ))
    {
        //save stats for each player
    }
}
Reply
#10

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Try adding this to "OnGameModeExit()"

pawn Код:
foreach(Player, i) //use a for loop if you don't have foreach
{
    if( IsPlayerConnected( i ))
    {
        //save stats for each player
    }
}
I think foreach already checks if the player is connected so you don't have to put another check
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)