[REQ] Magic Word

Discussion in 'Archived: Plugin Requests' started by BLOWUPFISH, Jul 5, 2011.

  1. Offline

    BLOWUPFISH

    Hey On my server when people join they have to read the rules and find a Magic Word to get building rights and they say the magic word and they need a mod or admin online to make them a citizen and I want a plugin that if you do /<magic word> (you can set the magic word in the config) and they get added to the group you choose. Please i Really need this thanks! ask me if you want more info!:)
     
  2. Offline

    JorganPubshire

    I have been looking into this and working on it. The part that is quite difficult is giving it the /<magic word> (set in config) command. All commands must be registered with the server via a plugin.yml file which cannot be accessed by the user unless they decompile, edit and recompile it so adding custom commands on the fly is rather difficult. However, I am working on a way to modify the plugin.yml file from inside the .jar file to include user defined commands. I am 100% sure that it is possible and that it will work, but I'm not 100% sure that I can do it.
    Now that I have said all of that:
    If you would like, I can make you a slightly less impressive plugin in the meantime that will have all the same features, but rather than the command being /<magic word> it would be /MagicWord <magic word>. I realize that this might not seem like a huge difference, but to a programmer, taking off that "MagicWord" at the beginning is an impressive task. PM me if you still need the plugin made and want to talk about the specifics of what you want it to do.
     
  3. Offline

    Deleted user

    This is a great idea. I was just now thinking about making a door from the starting spawn point that had a password and the password would be in the rules list somewhere.

    However, I don't want players to constantly have to enter the password whenever they go to the spawn area.

    So something like this would be nice.
     
  4. Offline

    nisovin

    You can use the Player Command Preprocess event to do this without modifying the plugin.yml file. However, this isn't really necessary anymore, as any server owner can easily set their own command aliases in the Bukkit config file now.
     
  5. Offline

    NuclearW

    Code:
    public void onPlayerCommandPreprocess (PlayerCommandPreprocessEvent event) {
        if(event.getMessage().equalsIgnoreCase(magicWord)) {
            //Do permissions things
        }
    }
    Code:
    aliases:
        magicword: [abrakadabra]
    Take your pick.
     
  6. Offline

    CainFoool

    @NuclearW

    public void onPlayerCommandPreprocess (PlayerCommandPreprocessEvent event) { if(event.getMessage().equalsIgnoreCase("magicWord")) { // Forgot the quotes. //Do permissions things } }
     
  7. Offline

    NuclearW

    No, I left it as a variable as I assume that being read from a config file it won't be hard coded.

    But I understand why you would think that.
     
  8. Offline

    BLOWUPFISH

    Thank you all for helping each other :) But the thing is that if you want to change the magic word incase someone leaks it or tells other people thats where the config comes in, and I think that the command should be /mw <magic word here> It seems better.

    But also remember that it will promote the person to the group you choose or builder in my case!

    Thank you all!


    The problem with that some people don't know how to use it and it still doesn't solve the problem of auto adding to the groups :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  9. Offline

    JorganPubshire

    Really? It's that easy? I can't believe that I never knew about this. Ok, I'm going to go change the program and re-test. I should have it done tomorrow. I can easily restrict building from players that you haven't allowed it to, but I've never worked with permissions on a coding level before so that might take me an extra day.
     
  10. Offline

    NuclearW

    Good luck with the permissions code Jorgan. I salute your valor.
     
  11. Offline

    JorganPubshire

    I like to make it so everything can be done within the game. Using the preprocess event will allow me to make it so the player can define commands from the chat console.

    I cannot believe that it was that easy, I was ready to start a program that would search the jar for the plugin.yml, modify it, then put it all into a new jar, and overwrite the existing one. Ok, BLOWUPFISH do you want the command to be /<magicword> or /mw <magicword>? Either way it will work exactly the same and you can set the word in the config.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  12. Offline

    BLOWUPFISH


    I think /<magic word> would be better and will it add them to the selected group or builder as i have it? And could I change the magic word to what I choose? Thank you!
     
  13. Offline

    JorganPubshire

    I'm about to go camping for the weekend and I'm not taking my computer, so I probably won't have the permissions group part done until after I get back. You can expect to see the first version of thsi plugin tomorrow before 3. It will have the configurable magic word for the command /<MagicWord> and will only let the player build/destroy blocks if you give them permission (/allow <playername>). You can also revoke someone's privileges (/deny <playername>) if they start griefing. The /allow and /deny commands will be temporary until I implement permissions. I'll post a link to the plugin's page in this thread once I upload it tomorrow. Now I'm going to get back to working on it.

    Ok, I finished v1.0. Here it is! I'll check my computer right before I leave for camping tomorrow to see if there is any feedback (good or bad), but if there is any problems (I say this because I haven't had time to perform bug-testing) they wont be fixed until after the weekend. The default magic word is "Please" so the command will be "/please" (not case-sensitive). I hope you enjoy it.!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  14. Offline

    BLOWUPFISH

    Thank you sooo much!
     
  15. Offline

    JorganPubshire

    How's it been working out? I just got back from camping (just in time to dodge the rain) and want to know if there's any bugs to be fixed or tweaks to be made before I work on permissions groups.
     
  16. Offline

    BLOWUPFISH

    Well Can you make it so you can do /<magic word> and it adds you to a group I already have anti-build in the deafult group thanks!
     

Share This Page