Thank you very much. It was a previous attempt to add a timeout to the script that I decided not to add, but I seem to type too fast and forget to remove things, thank you for spotting it out though. I have added a command to update the log now by saying /updatelog while the log is open instead of firing the weapon allowing you to make the system a hidden weapon.
PHP Code:
function onActionServerSide(cmd) {
if (cmd == "getLogtext") {
temp.l.loadLines("logs/systemmass.txt");
triggerclient("gui", name, "returnLogtext", temp.l);
}
}
//#CLIENTSIDE
function onCreated() {
triggerserver("gui", name, "getLogtext");
}
function showMessage(news) {
new GuiWindowCtrl("LogReader_Window") {
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "589,516";
isexternal = false;
canclose = true;
canmaximize = false;
canmove = true;
canresize = false;
closequery = false;
destroyonhide = false;
text = "Log Reader";
x = 370;
y = 72;
new GuiScrollCtrl("LogReader_MultiLine_Scroll") {
profile = GuiBlueScrollProfile;
height = 504;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 576;
x = 6;
y = 7;
new GuiMLTextCtrl("LogReader_MultiLine") {
profile = GuiBlueMLTextProfile;
height = 17;
horizsizing = "width";
plaintext = "";
text = news;
width = 551;
}
}
}
}
function onPlayerChats() {
if (player.chat == "/showlog") {
if (!(LogReader_Window.visible)) {
LogReader_Window.visible = true;
player.chat = "";
}
}
if (player.chat == "/hidelog") {
if (LogReader_Window.visible) {
LogReader_Window.visible = false;
player.chat = "";
}
}
if (player.chat == "/updatelog") {
if (LogReader_Window.visible) {
triggerserver("gui", name, "getLogtext");
player.chat = "";
}
}
}
function onActionClientSide(cmd, l) {
if (cmd == "returnLogtext") {
for (temp.a: l) {
temp.ne @= temp.a @ "\n";
}
showMessage(temp.ne);
}
}
I ran the styled script by RC and I get errors. I sometimes get this when using java script beautifier.
error: unexpected token: = at line 76: temp.ne@ = temp.a@"\n";
error: unexpected token: at line 79: }