[AYUDA]Crash en linux y no en windows
#1

Hola, bueno tengo un problema mi servidor crashea en mi host linux y en mi pc no. Crashea por este codigo

pawn Код:
public GuardarEn(filename[],text[])
{
    new File:Lfile;
    new filepath[256];
    new string[256];
    new year, month, day;
    new hour, minute, second;

    getdate(year, month, day);
    gettime(hour, minute, second);
    format(filepath,sizeof(filepath),"/Logs/%s.txt", filename);
    Lfile = fopen(filepath,io_append);
    format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second, text);
    fwrite(Lfile,string);
    fclose(Lfile);
    return 1;
}
y en mi pc tengo windows y los guarda y no crashea. Espero sus respuestas
Reply
#2

Chequea tener la carpeta "Logs" creada.
Reply
#3

Si claro que esta creada tmb los archivos estan creados. No porq crashea en linux y en windows no es rraro
Reply
#4

Utiliza el el plugin: crashdetect y decinos que te dice.
Reply
#5

Ya lo instale y me salio esto

Код:
[01:30:00] [debug] Server crashed while executing FreeRoam.amx
[01:30:00] [debug] Backtrace (most recent call first):
[01:30:00] [debug] #0  native fclose() from samp-agus
[01:30:00] [debug] #1  0x00001060()+0xa0 from FreeRoam.amx
[01:30:00] [debug] #2  public OnDialogResponse()+0x58470 from FreeRoam.amx
Reply
#6

pawn Код:
public GuardarEn(filename[],text[])
{
    new File:Lfile;
    new filepath[256];
    new string[256];
    new year, month, day;
    new hour, minute, second;

    getdate(year, month, day);
    gettime(hour, minute, second);
    format(filepath,sizeof(filepath),"/Logs/%s.txt", filename);
    Lfile = fopen(filepath,io_append);
    if(Lfile)
    {
    format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second, text);
    fwrite(Lfile,string);
    fclose(Lfile);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)