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. |
new File:file = fopen("archivo.txt", io_read);
if (file)
{
// tu cуdigo, fread, fwrite, ect
}
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;
}
// 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;
}
Por alguna razуn, se me habнa borrado el archivo, muchas gracias por su ayuda, ya lo solucione.
|