Wrong section. Moved to scripting help.
Code:
new filename[64]; // this is the name of your file to read from
copy(filename, 63, "motd.txt"); // lets use motd.txt for the example
if( file_exists(filename) )
{
new file = fopen(filename, "rt");
new data[64]; // information taken from the file, 1 line at a time
while( !feof(file) ) // keep looping until we find the end of the file
{
fgets(file, data, 63); // retrieve information
// Note: it will automatically go to the next line
// data contains the information from the line read
}
// close file
fclose(file);
}
Use the
funcwiki for information about the natives.
__________________