Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-09-2011, 08:10 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
The first thing you need to fix is the terribly inconsistent styling.

Also, you should just use PHP tags for code that's not too long to post.

PHP Code:
function onActionServerSidecmd )
{
  if ( 
cmd == "getLogtext" )
  {
   
temp.l.loadLines"logs/systemmass.txt" );
    
triggerclient"gui"name"returnLogtext"temp.);
    }
    }

//#CLIENTSIDE
function onCreated()
{
triggerserver"gui"name"getLogtext" );
}
function 
showMessagenews )
{
  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 "";
}
}
}


function 
onActionClientSidecmd)
{
  if ( 
cmd == "returnLogtext" )
  {
    for ( 
temp.)
    {
      
temp.ne @= temp."\n";
    }
    
showMessagetemp.ne );
      }
      
setimer(0.05);
}
function 
onWeaponFired()
{
triggerserver"gui"name"getLogtext" );

Cleaned up a bit:

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 "";
    }
  }
}


function 
onActionClientSide(cmdl) {
  if (
cmd == "returnLogtext") {
    for (
temp.al) {
      
temp.ne @= temp."\n";
    }
    
showMessage(temp.ne);
  }
  
setimer(0.05);
}

function 
onWeaponFired() {
  
triggerserver("gui"name"getLogtext");

What's with the (misspelled) setTimer command in onActionClientSide?
__________________

Last edited by cbk1994; 08-09-2011 at 08:25 PM..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.