Okay, Well im making a small script because on my server when it crashes, my Auto Admin list is cleared and i dont know their ID's to re-auto them. I have nothing to call it so i call it the friend list- And, No, it does not tell what server the persons on, Thats impossible, And, No, it does not tell if the person is playing. That is also impossible, Now for the script.
function ServerCmdClearFriends(%Client)
{
%file = new FileObject();
%File.openForWrite("Add-Ons/Frendlist.Friends");
%File.close();
%File.Delete();
}
function ServerCmdAddFriend(%Client,%Name,%ID)
{
Echo("Stage -1 Complete");
Echo("Stage -2 Complete");
%file = new FileObject();
Echo("Stage -3 Complete");
%file.openForAppend("Add-Ons/Friendlist.Friends");
Echo("Stage -4 Complete");
%file.Writeline(%Name SPC %ID);
Echo("Stage -5 Complete");
%file.close();
Echo("Stage -6 Complete");
%File.Delete();
Echo("Stage 1 Complete");
}
function ServerCmdViewFrends(%Client)
{
%file = new FileObject();
%file.openForRead("add-ons/Friendslist.friends");
while(!%file.isEOF())
{
%line = %file.readline();
%Lines++;
echo("Line" SPC %lines @ ":" SPC %Line);
}
%file.close();
%file.delete();
}
Oh, and the make the file part (clearfriends) works, its the rest that doesnt, And the echo's are for de-bugging, ill remove them later.