OnGameModeExit();
#1

Hi !

I have a problem with saving stats when closing samp-server.exe window.

When i make a gmx the stats (level,kills,exp) are saving
Here is the code:
Код:
    if(strcmp(cmd, "/gmx", true) == 0) {
        if(IsPlayerConnected(playerid)) {
            if (PlayerInfo[playerid][pAdmin] >= 1338) {
                GameModeExit();
            }
            else {
                SendClientMessage(playerid, COLOR_GRAD1, "   Niste ovlasteni da koristite tu komandu !");
            }
        }
        return 1;
    }
So under OnGameModeExit(); i have putted GameModeExit();
Код:
public OnGameModeExit()
{
    GameModeExit();
    return 1;
}
I have created OnGameModeExit() just for this. Before this that function doesn't existed, maybe that is the problem ?
Reply
#2

sorry, what are your problem?
Reply
#3

the stats are not saving when i close the samp-server.exe app (black window)... They only saves when i make /gmx or when player disconnects, but they aren't save when i close the samp-server.exe while there are players on the server...
Reply
#4

Can you give me the code for saving stats?

OnGameModeExit not called when window closed if i Remember correctly
Reply
#5

You should save players stats inside a timer function in case the server crashed or you need to close the server. In which case OnGameModeExit isn't guaranteed to be called (or is guaranteed not to be called. I'm not %100 sure).
Reply
#6

It's normal... Make GMX command..
Reply
#7

ok i will make a timer (i will try )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)