Thread: [PI] ::yell Error in Run.bat

Results 1 to 5 of 5
  1. #1 [PI] ::yell Error in Run.bat 
    Banned

    Join Date
    Nov 2009
    Posts
    4,219
    Thanks given
    2,950
    Thanks received
    1,362
    Rep Power
    0
    When someone types in ::yell without any words after it, this comes up in the run.bat:

    Code:
    [13/12/10 9:05 PM]:     at java.lang.String.substring(Unknown Source)
    [13/12/10 9:05 PM]:     at java.lang.String.substring(Unknown Source)
    [13/12/10 9:05 PM]:     at server.model.players.packets.Commands.processPacket(C
    ommands.java:44)
    [13/12/10 9:05 PM]:     at server.model.players.PacketHandler.processPacket(Pack
    etHandler.java:138)
    [13/12/10 9:05 PM]:     at server.model.players.Client.processQueuedPackets(Clie
    nt.java:990)
    [13/12/10 9:05 PM]:     at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:136)
    [13/12/10 9:05 PM]:     at server.Server.main(Server.java:152)
    Here's the yell command:

    Code:
    			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];
    						switch (c.playerRights){
    							case 0:
    								c.sendMessage("Only donators can use the ::yell command.");
    							break;
    							case 1:
    								c2.sendMessage("<col=255>[Yell]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							break;
    							case 2:
    								c2.sendMessage("<col=255>[Yell]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							break;
    							case 3:
    								c2.sendMessage("<col=255>[Yell]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							break;
    							case 4:
    								c2.sendMessage("<col=255>[Yell]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							break;
    						}
    					}
    				}
    			}
    How do I stop this from happening?
    Reply With Quote  
     

  2. #2  
    Botnet admin

    HaVoK0321's Avatar
    Join Date
    Jan 2009
    Posts
    551
    Thanks given
    51
    Thanks received
    23
    Rep Power
    247
    Try this, edit it how you like it.

    Code:
    		if (playerCommand.startsWith("yell")) {
    					String text = playerCommand.substring(5);
    					String[] bad = {"chalreq", "duelreq", "tradereq", ". com", "com", 
    							"org", "net", "biz", ". net", ". org", ". biz", 
    							". no-ip", "- ip", ".no-ip.biz", "no-ip.org", "servegame",
    							".com", ".net", ".org", "no-ip", "****", "is gay", "****",
    							"crap", ". c o m", ". com", ". serve", ". no-ip", ". net", ". biz"};
    					for(int i = 0; i < bad.length; i++){
    						if(text.indexOf(bad[i]) >= 0){
    							return;
    						}
    					}
    				for (int j = 0; j < Server.playerHandler.players.length; j++) {
    					if (Server.playerHandler.players[j] != null) {
    						Client c2 = (Client)Server.playerHandler.players[j];
    						if(c.playerRights == 0){
    						c.sendMessage("Yell channel has been disabled for players.");
    						return;
    						}
    						switch (c.playerRights){
    		
    							case 0:
    								/*c2.sendMessage("<col=255>[Player]</col>"+Misc.optimizeText(c.playerName)+": "
    												+ Misc.optimizeText(playerCommand.substring(5))+"");*/
    							break;
    							case 1:
    								c2.sendMessage("<col=255>[Moderator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							break;
    							case 2:
    								c2.sendMessage("<col=255>[Administrator]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							break;
    							case 3:
    								c2.sendMessage("<col=255>[Co-Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    
    							break;
    							case 4:
    								c2.sendMessage("<col=255>[Owner]</col><img=3>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							break;
    							case 5:
    							c2.sendMessage("<col=255>[Donator]</col><img=5>"+ Misc.optimizeText(c.playerName) +": "
    												+ Misc.optimizeText(playerCommand.substring(5)) +"");
    							break;
    							
    						}
    					}
    				}
    			}
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Nov 2009
    Posts
    4,219
    Thanks given
    2,950
    Thanks received
    1,362
    Rep Power
    0
    I shall try.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Aug 2010
    Posts
    739
    Thanks given
    32
    Thanks received
    51
    Rep Power
    35
    Code:
    			if (playerCommand.startsWith("yell")) {
    				if(playerCommand.length() > 5) {
    					for (int j = 0; j < Server.playerHandler.players.length; j++) {
    						if (Server.playerHandler.players[j] != null) {
    							Client c2 = (Client)Server.playerHandler.players[j];
    							switch (c.playerRights){
    								case 0:
    									c.sendMessage("Only donators can use the ::yell command.");
    									break;
    								case 1:
    									c2.sendMessage("<col=255>[Yell]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    										+ Misc.optimizeText(playerCommand.substring(5)) +"");
    									break;
    								case 2:
    									c2.sendMessage("<col=255>[Yell]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
    										+ Misc.optimizeText(playerCommand.substring(5)) +"");
    									break;
    								case 3:
    									c2.sendMessage("<col=255>[Yell]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    										+ Misc.optimizeText(playerCommand.substring(5)) +"");
    									break;
    								case 4:
    									c2.sendMessage("<col=255>[Yell]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    										+ Misc.optimizeText(playerCommand.substring(5)) +"");
    									break;
    							}
    						}
    					}
    				}
    			}
    [SPOIL]
    Quote Originally Posted by Archon Server View Post
    What do you mean compile?
    Quote Originally Posted by Hughes View Post
    I don't know the program i need to open a CLASS file since every time i try to open one in notepad it brings up random symbols.

    Quote Originally Posted by Flux View Post
    Quote Originally Posted by Tyluur View Post
    your better
    my better
    [/SPOIL]
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Nov 2009
    Posts
    4,219
    Thanks given
    2,950
    Thanks received
    1,362
    Rep Power
    0
    Ahhhh.
    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. Adding a yell command. Error - iClarity
    By BenDZN. in forum Help
    Replies: 6
    Last Post: 07-25-2009, 11:45 PM
  2. Yell Command Error
    By Rise Against in forum Help
    Replies: 2
    Last Post: 05-05-2009, 02:02 AM
  3. yell command error easy
    By Deh Jiizz in forum Help
    Replies: 2
    Last Post: 02-01-2009, 03:05 AM
  4. very easy yell timer can yell once in 5 secs
    By lord jahva in forum Tutorials
    Replies: 13
    Last Post: 07-06-2008, 10:57 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
  •