Quote:
Originally Posted by Gunderak
bugger.
Is there any way to read from the rclog.txt file and load the last five lines excluding the date/time?
|
Something like this could work. This lists the
"chat" of the other players, and adds something you will
"chat".
PHP Code:
function onActionServerSide() {
if (params[0] == "AddText") {
temp.filename = "logs/rclog.txt";
temp.lines = {params[1] SPC "(" SPC params[2] SPC "):" SPC params[3]};
temp.lines.savelines(temp.filename, 1);
temp.file.loadlines(filename);
for (temp.a: allplayers) temp.a.triggerclient(name, "ShowText", temp.file);
}
}
//#CLIENTSIDE
//GUI stuff
function RC2_textedit01.onAction() {
triggerserver("gui", name, "AddText", player.nick, player.communityname, RC2_textedit01.text);
RC2_textedit01.text = "";
}
function onActionClientSide() {
if (params[0] == "ShowText") RC2_chatlist_text.addrow(0, temp.c[temp.cd]);
}