Thread: Server Announcement

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Server Announcement 
    Banned
    Join Date
    Mar 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    How do I make one so when some reaches a 99 in any skill, it announces it to the whole server. Here is the text I want


    <col=255>[Server]</col>: Code here....


    Where do I add it, and can someone give me the code.
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Feb 2012
    Posts
    616
    Thanks given
    300
    Thanks received
    120
    Rep Power
    0
    in addXp boolean. Make it check if the skill level is 99 then add the yell code and c2.<col=255>[Server]</col>: Code here....
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Mar 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    That won't work.
    Reply With Quote  
     

  4. #4  
    Super Donator


    Join Date
    Sep 2008
    Age
    30
    Posts
    1,894
    Thanks given
    677
    Thanks received
    776
    Rep Power
    456
    Code:
    public void sendAnnouncement(String m){
          for(Player player : players){
                player.sendMessage("<col=255>[Server]</col>:" + m);
          }
    }
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Mar 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Where to put it, and do I need to edit anything in it?
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Feb 2012
    Posts
    616
    Thanks given
    300
    Thanks received
    120
    Rep Power
    0
    Quote Originally Posted by Kobarz View Post
    That won't work.
    Oh, and why not ?
    I have it works fine
    You just have to make it check if its the first time they get level 99 and not that they are 99 and they just get XP
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Mar 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Well I'm stupid and don't know how to make it check.
    Reply With Quote  
     

  8. #8  
    Super Donator


    Join Date
    Sep 2008
    Age
    30
    Posts
    1,894
    Thanks given
    677
    Thanks received
    776
    Rep Power
    456
    Quote Originally Posted by Kobarz View Post
    Well I'm stupid and don't know how to make it check.
    Maybe you should learn java if you don't know how to write an if statement
    Reply With Quote  
     

  9. Thankful user:


  10. #9  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Code:
    public void sendAnnouncement(String m){
          for(Player player : players){
                player.sendMessage("<col=255>[Server]</col>:" + m);
          }
    }
    You should really check if the player is null or not or this could cause issues.

    Code:
    public void sendAnnouncement(String m){
          for(Player player : players){
                     if (player != null) {
                          Client all = (Client) player;
                         all.sendMessage("<col=255>[Server]</col>:" + m);
                     }
          }
    }
    Reply With Quote  
     

  11. #10  
    Donator
    Cartela's Avatar
    Join Date
    Mar 2012
    Posts
    10
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Robbie` View Post
    Maybe you should learn java if you don't know how to write an if statement
    Why would he be in the help section if he knew how to write Java?
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Announcement?
    By Queer in forum Help
    Replies: 5
    Last Post: 04-02-2010, 12:01 AM
  2. need help how do i add server announcement
    By pk crazy in forum Help
    Replies: 4
    Last Post: 03-12-2009, 07:49 AM
  3. Announcement
    By Numbers in forum Announcements
    Replies: 35
    Last Post: 12-11-2008, 09:23 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •