How to avoid? Or is that a bug?
#1

When I do:
Код:
/rcon reloadfs adminx
The script reloadfs normally. But when a player disconects, a message doesn't shows up. Also their status don't save. But normally before the reloadfs, shows the msg of disconection and save status. All works normally after this command, except the callback OnPlayerDisconnect. Is that a bug or is there any other way to avoid?
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),SERVER_USER_FILE,n);
    if(dini_Exists(file)) {
    printf("spawn: %d | registrado: %d | logado: %d",dini_Int(file,"Spawnou"),dini_Int(file,"Registrado"),gPlayerLogged[playerid]);
    SavePlayerStats(playerid);
    SoundForAll(1084);
    plantada[playerid]=0;
    detonada[playerid]=1;
    jail[playerid]=0;
    block_pms[playerid]=0;
    mostrou[playerid]=0;
    fix[playerid]=0;
    gPlayerLogged[playerid] = 0;
    pausa[playerid]=0;
    ToggleVClock(0);
    banco[playerid]=0;
    IsInSafe[playerid]=0;
    new string[128];
    format(string,sizeof(string),"Logged: %d | Spawnou: %d | Jail: %d",gPlayerLogged[playerid],PlayerInfo[playerid][Spawnou],PlayerInfo[playerid][Jail]);
    printf(string);
    }
    new nome[30],string[128];
    GetPlayerName(playerid, nome, 30);
    switch(reason)
    {
      case 0: format(string,sizeof(string),"| {00FFA2}%s [ID: %d] {D60AFF}has disconnected {EBFF0A}[Timeout]", nome, playerid);
      case 1: format(string,sizeof(string),"| {00FFA2}%s [ID: %d] {D60AFF}has disconnected {0AFFFF}[Logged out]", nome, playerid);
      case 2: format(string,sizeof(string),"| {00FFA2}%s [ID: %d] {D60AFF}has disconnected {FF0A43}[Kick/Ban]", nome, playerid);
    }
    SendClientMessageToAll(color, string);
    return 1;
}
Reply
#2

It's cause you have closed the callback before the messages can come
Reply
#3

Probably the script crashes somewhere before saving and sending the message.
Add a print("<line number here>"); after every line, or every second, so you can see what is executed last (this causes the crash).
Reply
#4

Dude, I made an FS, doing the same functions on my admin FS, and worked perfectly. My problem is on the admin FS, so. The callbacks which are ran through the timer: Click here for see
Reply
#5

Bump. 12 Hours.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)