Thread: kill and shop command arent working :(

Results 1 to 3 of 3
  1. #1 kill and shop command arent working :( 
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    ok these two commands i found in my misc.java i tried adding to my commands.java but they aren't working sadly.

    Code:
    				if (playerCommand.equals("kill")) {
    					try {	
    						String playerToKill = playerCommand.substring(5);
    						for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    							if(Server.playerHandler.players[i] != null) {
    								if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToKill)) {
    									c.sendMessage("You have killed the user: "+Server.playerHandler.players[i].playerName);
    									Client c2 = (Client)Server.playerHandler.players[i];
    									c2.isDead = true;
    									break;
    								} 
    							}
    						}
    					} catch(Exception e) {
    						c.sendMessage("Player Must Be Offline.");
    					}			
    				}
    
    				if (playerCommand.equals("shop")) {
    					try {
    						String shopID = playerCommand.substring(5);
    						c.getShops().openShop(Integer.parseInt(shopID));
    						c.sendMessage("Viewing shop ["+shopID+"]");
    					} catch(Exception e) {
    						c.sendMessage("Invalid input data! try typing ::shop 1");
    					}
    				}
    i changed the clanchat.substring to playerCommand.substring and the clanChat.startsWith to playerCommand.equals.
    Reply With Quote  
     

  2. #2  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    bumpp. just post your kill command and shop commands
    Reply With Quote  
     

  3. #3  
    Registered Member
    Cycle's Avatar
    Join Date
    Dec 2011
    Posts
    183
    Thanks given
    81
    Thanks received
    43
    Rep Power
    91
    just make a command that can be used on a player like ban but then make it do like appendDamage(99) or whatever it is in project insanity
    might be hitPlayer(int damage)
    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. [PI] ::Kill Command
    By PkedFirst in forum Requests
    Replies: 6
    Last Post: 09-01-2013, 04:55 PM
  2. Replies: 0
    Last Post: 10-08-2011, 02:29 PM
  3. Need a ::kill command.
    By Logisti-X in forum Help
    Replies: 11
    Last Post: 01-14-2010, 07:57 PM
  4. Staff/Tele/Kill Commands are not working?
    By Re4master8 in forum Projects
    Replies: 3
    Last Post: 11-27-2008, 09:06 AM
  5. Kill someone (With a command!)
    By i hazy i in forum Tutorials
    Replies: 9
    Last Post: 02-17-2008, 03:48 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
  •