Basically I'm trying to make it so when a player performs a command it charges them money gives them a permission. For example, I do /buy kit pvp and it gives them the permission kit.pvp for $5,000. I know how to make a command and take money I more just need to know to give the permission.
Harmings I don't think there is a clean way to do this. If you know what permissions plugin is been used you can just get the console to dispatch the command to change a users group.
You can hook into the Permissions plugin such as PermissionsEX by making it a dependency for your plugin and using the PEX API to add the permission to the user. or you can do the simple but hacky solution: (PEX example) Player.performCommand("/pex user playerName add .this.is.a.permission") You would also want to check if the plugin was enabled.