OnPlayerDisconnect Callback
#1

It saves only when player disconnect with reason 1 Left normally (/q or ESC menu and quit)
If the player crashed or kicked/banned, the data aren't saved.
Is there any way to check the reason like the part of code below and in the two cases to save the Player's Data?
pawn Код:
public OnPlayerDisconnect( playerid, reason )
{
    OnPlayerLogout( playerid ); // Save Player Data

    return 1;
}
pawn Код:
// Instead of Message to save the data| OnPlayerLogout( playerid ); |
    new
        LeavingMsg[ 64 ];

    switch( reason ) {
        case 0: format( LeavingMsg, sizeof( LeavingMsg ), "%s left the server. (Timed out)", GetName( playerid ) );
        case 1: format( LeavingMsg, sizeof( LeavingMsg ), "%s left the server. (Leaving)", GetName( playerid ) );
        case 2: format( LeavingMsg, sizeof( LeavingMsg ), "%s left the server. (Kicked/Banned)", GetName( playerid ) );
    }
    SendClientMessageToAll( COLOR_YELLOW, LeavingMsg );
Reply
#2

Make it save every 2 minutes with a timer? So the rollback wont be bigger then 2 minuts if someone crashes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)