Open a menu with Yes and No buttons

Discussion in 'Plugin Development' started by perwin, Dec 21, 2012.

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

    perwin

    Hello,
    I have an important question. I want to create plugin, which will on first player join to my server open the menu with yes and no buttons. The window will look like the window which opens when the server wants you to download custom texture pack. But there will be text with rules and question "Do you agree with rules?" and the two buttons. If players klick yes, it will allow him to play, and if he clicks no, it will kick him from the server.
    I mean this window:
    [​IMG]
    I have already been searching on forums.bukkit.org, but I haven't found any solution yet. I also searched on jd.bukkit.org, but it was also unsuccessful.
    Please help me.
    Thank you very much for responses.
     

    Attached Files:

  2. Offline

    EnvisionRed

    Can't be done because Bukkit only controls the server side.
     
  3. Offline

    perwin

    Yes, but this window has been sent from the server side. The server tells client to open this window.
     
  4. Offline

    EnvisionRed

    The server sends a packet to the client that the client handles as "Open the server texture pack dialogue"
    Since the client has got that dialogue inbuilt, it works. It won't have your custom dialogues in its code, which is why it wouldn't work.
    Take a look at Spout, it can do what you want.
     
  5. Offline

    perwin

  6. Offline

    ZeusAllMighty11

  7. Offline

    perwin

    I think it could be somehow done, becouse I saw a server where they had something like this. But unfortunately I forgot the IP...
     
  8. Offline

    nisovin

  9. Offline

    perwin

  10. Offline

    nisovin

  11. Offline

    perwin

    Then I found this:
    Code:
    // This informs Bukkit that you will send messages through that channel
    Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, channel);
     
    // This informs Bukkit that you want to receive messages through that channel, to myPluginMessageListener
    Bukkit.getMessenger().registerIncomingPluginChannel(plugin, channel, myPluginMessageListener);
     
    class MyPluginMessageListener implements PluginMessageListener {
        public void onPluginMessageReceived(String channel, Player player, byte[] message) {
            // Do something with this message from the player
        }
    }
     
    somePlayer.sendPluginMessage(plugin, channel, message);
    on this link: http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/.
    So it is possible to set the message, right?
     
  12. Offline

    ZeusAllMighty11

    No, it is not possible to change what you see on the screen.
     
  13. Offline

    nisovin

    That's to be used with client mods. It won't do anything on its own.
     
  14. Offline

    perwin

    And what about sending some other text to MC|TPack channel than TP url?
     
  15. Offline

    nisovin

    The client is expecting a URL, it won't know what to do if it gets something else.

    Look, I know you really want this to work, but just stop. You've been told multiple times already that it isn't possible.
     
  16. Offline

    perwin

    Ok, than I have the last question. What about the window, which opens when I click on some URL in chat? What channel is it or what packet is using that? Is this usable for my intention?
     
  17. Offline

    nisovin

    There is no packet involved, that is purely client-side.
     
  18. Offline

    tommycake50

    if it was something else it would throw a MalformedURLEception when they clicked yes :/.
     
  19. Offline

    Gravity

    You are not reading what people are telling you - this isn't possible with Bukkit.

    The URL-link thing is all client-side. The client sees a string of text that looks like a url and makes it clickeable. There's no packets or server involvement.
     
    ZeusAllMighty11 and gomeow like this.
  20. Offline

    gamerzap

    If you really want to do this, take a look at Spout, but be aware it requires the client mod SpoutCraft for it to show up on your client.
     
Thread Status:
Not open for further replies.

Share This Page