How to save in Y_INI ?
#1

Hey guys,

When I close server-samp.exe without exit the game it doesn't save the player stats but when I use /q it works perfectly.

Can you help me fix it guys ?
Reply
#2

it's normaly , since you are forcing the server to shutdown quickly the datebase of server , you cannot save it ...
either maybe there is another way , but im not sure
Reply
#3

for me I make a automatic hour save, just make a timer to save it every hour, it's impossible to make it save with closing the .exe, so saving every hour will decrease the loss.
Reply
#4

PHP код:
//In The OnGameModeInit:
SetTimer("SaveAccounts",600000,1);
//In the End of the GameMode
forward SaveAccounts();
public 
SaveAccounts()
{
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
SavePlayer(i);
        }  
    }

Reply
#5

Quote:
Originally Posted by MCZOFT
Посмотреть сообщение
PHP код:
//In The OnGameModeInit:
SetTimer("SaveAccounts",600000,1);
//In the End of the GameMode
forward SaveAccounts();
public 
SaveAccounts()
{
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
SavePlayer(i);
        }  
    }

Didn't helped bro,its the same .. :\
Reply
#6

You can not fix it, you can save player status per hour or half hour like me and if player exit the game.
Reply
#7

What do you mean I can't fix it :O
Reply
#8

uP.......
Reply
#9

I'm guessing it's because you're not writing "exit" in the console. When you press the "X" button to close the server, it doesn't call "OnGameModeExit".
Reply
#10

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
I'm guessing it's because you're not writing "exit" in the console. When you press the "X" button to close the server, it doesn't call "OnGameModeExit".
So if my linux server crash it wouldn't save any of the player stats..

How can I save player stats if the server crash ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)