Thread: ::yell [PI] (rep/thank)

Results 1 to 3 of 3
  1. #1 ::yell [PI] (rep/thank) 
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,472
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    This is my yell command, it capitalizes the first 2 letters of the players name and I need a fix. (will rep/thank)

    if (playerCommand.startsWith("yell")) {
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c2 = (Client)Server.playerHandler.players[j];

    if (Connection.isMuted(c)) {
    return;
    }

    if (c.playerRights == 7){ // support
    c2.sendMessage("<shad=6081134>[Helper]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }
    if(c.playerRights == 1){
    c2.sendMessage("<shad=123456>[Moderator<img=0>]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }
    if(c.playerRights == 2){
    c2.sendMessage("<shad=36096>[Admin<img=2>]</col>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }
    if(c.playerRights == 3){
    c2.sendMessage("<shad=15695415>[Owner<img=2>]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }
    if(c.playerRights == 4){
    c2.sendMessage("<shad=6081134>[Donator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }
    if(c.playerRights == 5){
    c2.sendMessage("<shad=6081134>[Super Donator<img=3>]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }
    if (c.playerRights == 0){
    c.sendMessage("You must be a donator/helper to use this feature, type :onate!");
    }
    }
    }
    }

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  2. #2  
    Registered Member
    Bubletan's Avatar
    Join Date
    May 2011
    Posts
    593
    Thanks given
    133
    Thanks received
    282
    Rep Power
    320
    Change Misc.opimizeText(c.playerName) to c.playerName
    Reply With Quote  
     

  3. #3  
    Cash Back Guaranteed!


    Join Date
    Sep 2012
    Age
    26
    Posts
    247
    Thanks given
    36
    Thanks received
    42
    Rep Power
    164
    Build of this is better:

    Code:
    	if (playerCommand.startsWith("yell")) {
                  if (Connection.isMuted(c)) {
                  return;
                  }
    				String rank = "";
    				String Message = playerCommand.substring(4).toLowerCase();
    					switch (c.playerRights) {
    						case 0:
    							rank = "<col=160>[Player] "+c.playerName +": ";
    							break;
    						case 1:
    							rank = "<col=160>[Mod] <img=1>"+c.playerName +": ";
    							break;
    						case 2:
    							rank = "<col=160>[Admin] <img=2>"+c.playerName +": ";
    							break;
    						case 3:
    							rank = "<col=160>[Owner] <img=2>"+c.playerName +": ";
    							break;
    					}       
    					for (int j = 0; j < PlayerHandler.players.length; j++) {
    						if (PlayerHandler.players[j] != null) {
    							Client c2 = (Client)PlayerHandler.players[j]; 
    							c2.sendMessage(rank+Misc.optimizeText(Message));
    						}
    					}
    			}
        }
    Spoiler for Rune Plus:
    Reply With Quote  
     


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. Replies: 8
    Last Post: 08-04-2011, 10:15 PM
  2. [PI] Colors for yell? [PI] Rep++
    By Jmk600 in forum Help
    Replies: 0
    Last Post: 06-12-2011, 10:03 PM
  3. [PI] Yell command. Rep++
    By susurik in forum Help
    Replies: 9
    Last Post: 03-31-2011, 01:15 PM
  4. Runeslay yell rep+
    By brentjuu in forum Help
    Replies: 5
    Last Post: 10-29-2010, 01:00 AM
  5. Help On ::Yell rep++
    By Quise in forum Help
    Replies: 5
    Last Post: 10-08-2010, 10:19 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •