View Single Post
  #2  
Old 12-03-2012, 02:02 AM
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
I just skimmed the code, but it sounds like you just want to have different types of messages? Why not just store them all in the same array?

PHP Code:
player.client.messages = {
  
// {message, category}
  
{"Message one!", "mass"},
  {
"Message two!", "tell"},
  {
"Message three!", "guild"} // etc
}; 
If you keep them all in the same array (use a multi-dimensional array so you can store multiple attributes for each message), you don't have to worry about sorting them later on, plus you keep maintaining the code a lot easier (for example, adding a new message type is a cinch).

(I'm still not really sure why you're not just sending triggers and insist on using arrays)
__________________
Reply With Quote