Solved Menus?

Discussion in 'Plugin Development' started by Jackcheetham, Oct 24, 2013.

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

    Jackcheetham

    I want the menu to open on every time someone joins.

    The command to open a menu for someone is:
    /menu open [Player] [Id]

    The menu ID i'm using is 1

    the command should be:
    /menu open [Player] 1

    My code is:
    Code:java
    1. @EventHandler
    2. public boolean onPlayerJoinEvent(PlayerJoinEvent event) {
    3. Player p = event.getPlayer();
    4. this.getServer().dispatchCommand(this.getServer().getConsoleSender(), "menu open" + p + "1");
    5. return true;
    6. }


    Any ideas why?
     
  2. Offline

    remremrem

    Try changing this ( "menu open" + p + "1" )
    to this ( "menu open " + p + " 1" )

    note the spaces.

    I think currently it is executing: /menu openPlayer1
    instead of : /menu open Player 1
     
  3. Offline

    Jackcheetham


    Now in console it says:
     
  4. Offline

    remremrem

    try changing p to p.getName()
     
  5. Offline

    Jackcheetham

    Works, thanks a bunch man, needed that =]
     
Thread Status:
Not open for further replies.

Share This Page