HomeHome  ­FAQFAQ  ­SearchSearch  ­MemberlistMemberlist  ­UsergroupsUsergroups  ­RegisterRegister  ­Log inLog in  
Post new topic   Reply to topicShare | 
 

 Away message

View previous topic View next topic Go down 
AuthorMessage
Flav



Posts: 24
Join date: 2008-08-16

PostSubject: Away message   Fri Jan 30, 2009 7:34 pm

better version is following Razz

Quote:
Self explanatory.

MapleCharacter.java
Code:

   private String awayMessage = null;

   public String getAwayMessage() {
      return this.awayMessage;
   }

   public void setAwayMessage(String text) {
      this.awayMessage = text;
   }


WhisperHandler.java
Code:

   if (player.getAwayMessage() != null) {
      c.getPlayer().getClient().getSession().write(MaplePacketCreator.getWhisper(player.getName(), player.getClient().getChannel(), player.getAwayMessage()));
   }


CharCommands.java
Code:

      } else if (splitted[0].equalsIgnoreCase("!awayMessage")) {
         String message = "";
         if (splitted.length < 2) {
            player.setAwayMessage(null);
            mc.dropMessage("Your away message has been removed.");
         } else {
            for (int i = 1; i < splitted.length; i++) {
               message += splitted[i] + " ";
            }
            message = message.trim();
            player.setAwayMessage(message);
            mc.dropMessage("Your away message has been set to [" + message + "].");
         }
      }

new CommandDefinition("awayMessage", "<message>", "This allows you to set an away message. Leave blank to remove it.", 0),
Back to top Go down
View user profile
 

Away message

View previous topic View next topic Back to top 
Page 1 of 1

Permissions of this forum:You cannot reply to topics in this forum
 :: OdinMS :: Releases-
Post new topic   Reply to topic