I want to convert this to the C file natives (fopen, fseek, fgets, etc)
And yes, I know this plugin doesnt handle any errors, it's just a rough draft.
Code:
#include <amxmodx>
#define PLUGIN "New Plugin"
#define VERSION "0.1"
#define AUTHOR "FatalisDK"
new const gFILE[] = "test.txt";
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
test();
}
test()
{
//Display last 10 lines of file - File is always greater than 10 lines
//How would I do this using the C file natives? (or whatever you call them)
new lines = file_size(gFILE, 1);
new szData[3], txtLen
for( new i = lines-10; i < lines; i++ )
{
read_file(gFILE, i, szData, 2, txtLen);
server_print("%i = %s", i, szData);
}
}
__________________