2 commands with the same name just 2 after the second one?

Discussion in 'Plugin Development' started by julllleee, Feb 21, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Waterflames

    Seems like a basic tutorial on Java could do wonders for you.
    You ain't learning Java if you don't know what the code means ;)
    EDIT: maybe try reading this? :)
     
  2. Offline

    messageofdeath

    ok I'm going to fix this on next post.

    this may take me a while

    WOW! I had it along time ago how you wanted it i was testing on my test server and it wouldn't go so i removed your messages and put in my custom ones and it worked IM SO PISSED! but i will release code on next one after i finish code and test it becuase most people dont test before they post it...

    Ok I finished the code and its working perfectly

    PHP:
    @Override
        
    public boolean onCommand(CommandSender senderCommand cmdString commandLabelString[] args) {
            
    Player player = (Playersender;
            if(
    cmd.getName().equalsIgnoreCase("help")) {
                if(
    args.length == 0) {
                    
    player.sendMessage(this.getConfig().getString("1"));
                    
    player.sendMessage(this.getConfig().getString("2"));
                    
    player.sendMessage(this.getConfig().getString("3"));
                    
    player.sendMessage(this.getConfig().getString("4"));
                    
    player.sendMessage(this.getConfig().getString("5"));
                    
    player.sendMessage(this.getConfig().getString("6"));
                    
    player.sendMessage(this.getConfig().getString("7"));
                    
    player.sendMessage(this.getConfig().getString("8"));
                    
    player.sendMessage(this.getConfig().getString("9"));
                    
    player.sendMessage(this.getConfig().getString("10"));
                    return 
    true;
                }
                if(
    args.length == 1) {
                    if(
    args[0].equalsIgnoreCase("2")) {
                        
    player.sendMessage(this.getConfig().getString("11"));
                        
    player.sendMessage(this.getConfig().getString("12"));
                        
    player.sendMessage(this.getConfig().getString("13"));
                        
    player.sendMessage(this.getConfig().getString("14"));
                        
    player.sendMessage(this.getConfig().getString("15"));
                        
    player.sendMessage(this.getConfig().getString("16"));
                        
    player.sendMessage(this.getConfig().getString("17"));
                        
    player.sendMessage(this.getConfig().getString("18"));
                        
    player.sendMessage(this.getConfig().getString("19"));
                        
    player.sendMessage(this.getConfig().getString("20"));
                        return 
    true;
                    }
                }
            }
            return 
    false;
        }
    sorry couldn't get the spanish in there
    but i think you can keep it as a aliasis

    the commands are

    /help
    /help 2
    ok

    hope it works i spent like an hour on it trying diff ways when they were right lol

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
Thread Status:
Not open for further replies.

Share This Page