Just asking a question to know if something is possible

Discussion in 'Plugin Development' started by deadbeat91, Feb 15, 2011.

Thread Status:
Not open for further replies.
  1. well today i was at uni and i had to do maths so i got my laptop out and went on netbeans, cus dam maths sucks. well i was writing a small administration/permission addon then i hit a wall :(.
    at the moment i am trying to find a way to make the permission mod take over the OnPlayerCommand event so that it goes first and if the person writing that command does not have the permissions then it won't execute any of the events for any other plugin.

    if this can't be done i was just gonna make a small injecting permission mod which basicly all plugin developers would complie maybe 1 - 3 files that would just have functions to connect to the accounts and group db/configs i have made then all they would need is one if statement saying if they get false they can't do the command and if its true then they can do the command.

    thank you in advance for any help
     
  2. Offline

    retsrif

    Try looking at the Permissions source code if it's available.
     
  3. Offline

    Byteflux

  4. Offline

    Uristqwerty

    Check Getting your priorities straight: The plugin version.

    You cannot "take over" the event, and if you required all other plugins to interface with yours, it wouldn't work, because plugin writers are lazy, and don't like to write compatibility with other plugins unnecessarily.

    However, you could check the event at the lowest priority (so that you go first), and cancel the event if the user shouldn't be allowed to use that command. All of the other plugins will still get the event (and could even un-cancel it), but they would either have to be poorly written or have a good reason to un-cancel it or to ignore the fact that it has been cancelled. A higher priority would work, but then anything with a lower priority would respond to it before it is cancelled, so choose wisely.
     
  5. thanks for the replys will have a little look :)
     
Thread Status:
Not open for further replies.

Share This Page