View Single Post
  #6  
Old 07-06-2007, 07:51 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by cbkbud View Post
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:
code 
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!
PHP Code:
...
function 
onTimeOut()
{
  if ( 
client.messages.size() > )
  {
    for ( 
0client.messages.size(); ++ )
    {
      
client.messages[i];
      
this.textArray.add"<font color=\"" this.( "color_" a[1] ) @ "\">" a[0] @ "</font>" );
    }
    while ( 
this.textArray.size() > 15 )
    {
      
this.textArray.delete);
    }
    
// client.messages.clear();
    // ^ not needed because you clear it below.
 
...
  }
  
setTimer0.05 );

*Note: "..." means I took out some code but didn't change it.

I didn't test it, but I think that should take care of the problem.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote