Crash on disconnect
#1

Hello people, long I haven't asked something here. Well, I've started a new project and got some problems.

-The whole server crashes when a player leaves/disconnects from my server.

I've the following code under OnPlayerDisconnect().
pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
    new string[256];
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    switch(reason)
    {
        case 0: format(string, sizeof(string), "[Leave] %s has left the server... (Timeout)", pName);
        case 1: format(string, sizeof(string), "[Leave] %s has left server... (Leaving)", pName);
        case 2: format(string, sizeof(string), "[Leave] %s has left server... (Kicked/Banned)", pName);
    }

    SendClientMessageToAll(COLOR_YELLOW, string);
    if (!dini_Exists(FileStats(playerid)))
    {
        dini_Create(FileStats(playerid));
    }
    SaveStats(playerid);

    if (PVeh[playerid] > 0)
    {
        DestroyVehicle(PVeh[playerid]);
        PVeh[playerid] = 0;
  }
  return 1;
}
Any possible way to fix it ?

Thanks,
Rafay.
Reply
#2

Could be a prob with SaveStats. Can we see it please?
Reply
#3

This thread can die off.
Reply
#4

The guy asked you for the code, No code no solutions.
Reply
#5

The problem is solved, that's why I said so.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)