Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-05-2007, 07:49 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
Problems with message system

Hello 'o great scripting community.

I haven't scripted for a while, and I'm starting again. I am having trouble with this message system, and it is very odd--noone can seem to find any bug in it.

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
this.color_staff "#FF3333";
  
this.color_global "#FFFFFF";
  
this.color_battleground "#3300FF";
  
this.color_team "#00FF00";
  
this.color_pm "#FFFF00";
  
client.messages.clear();
  
client.messages.add( { "Welcome to" SPC servername "," SPC player.nick "!""global" } );
  
sleep.11 );
  
setTimer0.05 );
}
function 
onTimeOut()
{
  if ( 
this.textArray.size() > 15 )
  {
    
this.textArray.delete);
  }
  if ( 
client.messages.size() > )
  {
    for ( 
0client.messages.size(); ++ )
    {
      
client.messages[i];
      
this.textArray.add"<font color=\"" this.( "color_" a[1] ) @ "\">" a[0] @ "</font>" );
    }
    
client.messages.clear();
    for ( 
ithis.textArray )
    {
      if ( 
this.textArray.index) != )
      {
        
nText interfaceMessages.text "\n" i;
      }
      else
      {
        
nText i;
      }
    }
    
interfaceMessages.text nText;
    
interfaceScroll.scrollto010000 );
    
client.messages.clear();
  }
  
setTimer0.05 );

The bugs seem to happen once you hit 15 messages, it should delete the oldest--right? No, it deletes them all. Either that, or it doesn't delete any. Really weird ... please help!

Thanks for all the help,
Chris Zakuto
__________________
Reply With Quote
 


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 05:19 AM.


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