Turn plugin actions on and off with a command?

Discussion in 'Plugin Development' started by Lookatmego, Oct 10, 2011.

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

    Lookatmego

    Hey there,
    im working on a plugin thats basically done and all i need to add is a way where if you do a command for example:

    /example enable
    the plugin is on enable and does what it is suppose to and then if you do

    /example disable
    it stops the plugin from what it was set to do.
    I was wondering how can i pull this off and how would i check for it in the method?


    also another way this may work for me is if i make it so the players with the certain permission node can use this plugin so no command at all just if player has example.example then the plugin will work for them if not it wont....thats it thanks:)
     
  2. Offline

    Darkman2412

    Code:
    private boolean pluginenabled = false; //somewhere in the main .java.
    
    //in onEnable():
    Pluginenabled = true;
    //a method in your main .java:
    Public boolean isPluginEnabled() {
        Return pluginenabled;
    }
    public void setPluginEnabled(boolean flag) {
        This.pluginenabled = flag;
    }
     
  3. Offline

    Lookatmego

    hmmm this might work thats dude ill try it:D
     
  4. Offline

    Darkman2412

    You just need to fix the capitalized letters. I'm on my mobile so it automatically changes the first letter. :)
     
Thread Status:
Not open for further replies.

Share This Page