Blockland Forums > Modification Help
[SOLVED] Reading a file
<< < (2/2)
Headcrab Zombie:
Oh, I was looking at the complete function you recently posted

That should work unless I overlooked something else
FFSO:
EDIT: Doesn't work console cant identify 'isEoF' and it re says the error over and over and crashes the game :|
FFSO:
added %file = new FileObject();

Current:

--- Code: ---function serverCmdReadLog(%client)
{
%file = new FileObject();
%file.openForRead("config/server/IPLogger/logs.log");
while(!%file.isEoF())
{
messageClient(%client,'',%file.readLine());
}
%file.close();
%file.delete();
}

--- End code ---
Ipquarx:

--- Code: ---function serverCmdReadLog(%client)
{
if(!isFile("config/server/IPLogger/logs.log"))
{
messageClient(%client, '', "\c6Log file does not exist or wrong file specified.");
return 0;
}
%file = new FileObject();
%file.openForRead("config/server/IPLogger/logs.log");
while(!%file.isEOF())
{
%line = %file.readLine();
messageClient(%client, '', %line);
}
%file.close();
%file.delete();
}
--- End code ---
Try that. I modified a working file reader that I made (that again, works 100% for me), if this doesnt work, then you have some sort of script or addon that is loving up your blockland.
FFSO:
EDIT: the code worked but apparently it is saying that the file doesn't exist even though it does... the paths are all correct...Console is saying autoAdminCheck isn't a valid command (I used it to write to the file on someone joining...)

EDIT 2: Fixed
Navigation
Message Index
Previous page

Go to full version