[SEC] PermissionsPlus All the ideas and discussions
0 votes Vote

Source or hooks?

Is it possible to see the source of this somewhere? Or, altnernatively, is there an easy way to hook into the /groupset command? Thanks :)

Ben , 12.07.2011, 10:01
Response from the site administrator
mymchost, 12.07.2011
The /groupset command is an alias for the /user -setgroup command. You can run this command, as well as any command for any other plugin using the code:

PermissionsPlus p2;
String[] sendArgs = new String[4];
sendArgs[0] = "-setgroup";
sendArgs[1] = "u:"+user;
sendArgs[2] = "s:"+group;
sendArgs[3] = "w:"+world;
p2.onCommand(sender, p2.getCommand("user"), "user", sendArgs);

Hope that helps.
Idea status: completed

Comments

Ben, 15.07.2011, 00:58
Thanks for the quick response! I do appreciate it. Sadly, I seem to get a NullPointerException from the p2.onCommand line, when I try to use it :(

I guess I'll need to read up more on onCommand and the CommandSender in general.
mymchost, 25.07.2011, 15:25
If you are using the code exactly, it relies on the sender variable from the onCommand function. You can define a sender to put in it's place.

Leave a comment