OnGameModeExit saving player's stats
#1

It doesn't work, anyidea?

pawn Код:
public OnGameModeExit()
{
    foreach(Player, i)
    {
        OnPlayerDisconnect(i, 1);
    }
    mysql_close(dbHandle);
    return 1;
}
On playerdisconnect has a function which saves all player stats
Reply
#2

Calling OnPlayerDisconnect in OnGameModeExit will not really work.

How about putting the save stats function OnGameModeExit inside the loop.

That's it. Simple problem..
Reply
#3

I don't think you can use ongamemodeexit to save player stats
A timer for 5 or 10 minutes and onplayerdisonnect should be just what you need..
Reply
#4

if you want to restart server then do
pawn Код:
CMD:gmx(playerid,params[])
{
          #pragma unused params
          if(!IsPlayerAdmin(playerid))return 0;
          for(new i=0;i<MAX_PLAYERS;i++)
          {
                    Kick(i); // change it if want
          }
}
you can put replace Kick the saving function, like you have SavePlayer(playerid)
Reply
#5

I have a command which saves all player stats, thanks anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)