View Single Post
  #1  
Old 03-03-2008, 12:16 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Message System [middle of screen]

Here's a message system, simply trigger the client to add a message.


Message Data = {"Message Type: [Guildmessage [green], normal [white]]", "Message Here", "Either Nickname or Account Name"}

PHP Code:
//#CLIENTSIDE
function onActionClientSide()
{
  
this.drawMessage( {params[2] @ ":" SPC params[1], "bc", (params[0] == "Guildmessage"? {0, 1, 0}: {1, 1, 1}) } );
}

function 
drawMessage(stuff)
{  
  
client.cMessages.insert(0, temp.stuff);
  if (
client.cMessages.size() >= 5)
  {
    
client.cMessages.delete(5);
  }

  
this.updateMessages();
}

function 
updateMessages()
{
  for (
temp.i: client.cMessages)
  {
    
temp.o++;
    
temp.width = textwidth(0.6, "Tahoma", temp.i[1], temp.i[0]);
  
    
showtext(300 + temp.o, (screenwidth / 2) + (temp.width / 2), (screenheight - 16) - (temp.o * 16), "Tahoma", temp.i[1], temp.i[0]);
    
changeimgvis(300 + temp.o, 4);
    
changeimgzoom(300 + temp.o, 0.6);
    
changeimgcolors(300 + temp.o, temp.i[2][0], temp.i[2][1], temp.i[2][2], 1);
    
    
this.("mode_" @ temp.o) = temp.i[2];
    
this.("fade_" @ temp.o) = 1;
  }
  
  if (
temp.o != null)
  {
    
scheduleevent( (temp.o / 15) + 3, "Fade", "");      
  }   
}
  
function 
onFade()
{
  
temp.i = client.cMessages.size();
    
  
this.("fade_" @ temp.i) -= 0.005;
  
  if (
this.("fade_" @ temp.i) <= 0)
  {
    
client.cMessages.delete(temp.i - 1);
    
this.updateMessages();
    
    return 
false;
  }
  
  
temp.g = this.("mode_" @ temp.i);
  
changeimgcolors(300 + temp.i, temp.g[0], temp.g[1], temp.g[2], this.("fade_" @ temp.i));
     
  
scheduleevent(0.05, "Fade", "");
} 
__________________
Reply With Quote