View Single Post
  #3  
Old 08-09-2011, 08:21 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
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";
    
370;
    
72;

    new 
GuiScrollCtrl("LogReader_MultiLine_Scroll") {
      
profile GuiBlueScrollProfile;
      
height 504;
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
width 576;
      
6;
      
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(cmdl) {
  if (
cmd == "returnLogtext") {
    for (
temp.al) {
      
temp.ne @= temp."\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: }
__________________

Last edited by Emera; 08-10-2011 at 11:34 AM..
Reply With Quote