[Duda] El servidor se me cierra
#1

Buenas, he subido mi GM al hosting pero cuando lo ejecuto no abre, he visto el ScreenLog y me aparece esto:
Quote:

Started server on 94.23.85.133:10200, with maxplayers: 100 lanmode is ON.

samp03svr: amx/amxfile.c:101: fgets_cell: Assertion `fp!=((void *)0)' failed.

їAlguien sabe a que se debe?, muchas gracias.
Reply
#2

No estoy seguro, pero creo que estбs usando fread sin comprobar que el archivo exista.

pawn Код:
new File:file = fopen("archivo.txt", io_read);
if (file)
{
    // tu cуdigo, fread, fwrite, ect
}
Reply
#3

Esto es lo ъnico que tengo:
pawn Код:
stock Baneado(playerid)
{
    new Texto[64], File:ban = fopen("/baneados.txt", io_append );

    if(ban)
    {
        format(Texto, sizeof(Texto), "%s\r\n",NombreJugador(playerid));
        fwrite(ban, Texto);
        fclose(ban);
    }
    return 1;
}
їTiene algъn error?
Reply
#4

Fijate que el archivo exista en la carpeta scriptfiles y/o que tenga permisos para ser editado. Dar permisos en FTP: chmod 777 scriptfiles/baneados.cfg

Sino, probб aсadiendo esto al principмo del include fixes:


pawn Код:
// Prevents crashes when handle is 0
#define FIXES_INVALID_FILE_HANDLE  !"ERROR: Invalid handle (0) given to "

stock bool:FIXES_fclose(File: handle)
{
    if (handle)
        return fclose(handle);

    print(FIXES_INVALID_FILE_HANDLE "fclose.");

    return false;
}

stock FIXES_fwrite(File: handle, const string[])
{
    if (handle)
        return fwrite(handle, string);

    print(FIXES_INVALID_FILE_HANDLE "fwrite.");

    return 0;
}

stock FIXES_fread(File: handle, string[], size = sizeof string, bool: pack = false)
{
    if (handle)
        return fread(handle, string, size, pack);

    print(FIXES_INVALID_FILE_HANDLE "fread.");

    return 0;
}

stock bool:FIXES_fputchar(File: handle, value, bool: utf8 = true)
{
    if (handle)
        return fputchar(handle, value, utf8);

    print(FIXES_INVALID_FILE_HANDLE "fputchar.");

    return false;
}

stock FIXES_fgetchar(File: handle, value, bool: utf8 = true)
{
    if (handle)
        return fgetchar(handle, value, utf8);

    print(FIXES_INVALID_FILE_HANDLE "fgetchar.");

    return 0;
}

stock FIXES_fblockwrite(File: handle, const buffer[], size = sizeof buffer)
{
    if (handle)
        return fblockwrite(handle, buffer, size);

    print(FIXES_INVALID_FILE_HANDLE "fblockwrite.");

    return 0;
}

stock FIXES_fblockread(File: handle, buffer[], size = sizeof buffer)
{
    if (handle)
        return fblockread(handle, buffer, size);

    print(FIXES_INVALID_FILE_HANDLE "fblockread.");

    return 0;
}


stock FIXES_fseek(File: handle, position = 0, seek_whence: whence = seek_start)
{
    if (handle)
        return fseek(handle, position, whence);

    print(FIXES_INVALID_FILE_HANDLE "fseek.");

    return 0;
}

stock FIXES_flength(File: handle)
{
    if (handle)
        return flength(handle);

    print(FIXES_INVALID_FILE_HANDLE "flength.");

    return 0;
}
Reply
#5

Por alguna razуn, se me habнa borrado el archivo, muchas gracias por su ayuda, ya lo solucione.
Reply
#6

Quote:
Originally Posted by Alexander11
Посмотреть сообщение
Por alguna razуn, se me habнa borrado el archivo, muchas gracias por su ayuda, ya lo solucione.
Aunque hallas solucionado tu problema creando el archivo, te sugiero que le pongas permisos de escritura a la carpeta scriptfiles y a samp03svr ya que el archivo baneados.txt se debнa crear solo.

La funciуn io_append abre el archivo, pero si no existe lo crea.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)