19.01.2012, 15:46
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?
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 );