I made a noteblock song plugin work without the noteblocks and I want to add custom nbs sounds effects when you win or kill someone in my edited Skywars plugin and that works fine with a perms system I made,if you are not an op player,but if you have op,the chosen sound effect will not play because the op player has all of existing perms in server and plugin plays only the last sound I added. So I want to check from player's config in PurePerms,if he has the perm set in config to send the certain sound only on win or kill on an op player.I tried this thing,but I don't think it worked because I tested the code in my server. PHP: case 0: $getperm = new Config("plugins/PurePerms/players/" . $sender->getName() . ".yml", Config::YAML); $getperm->getAll(); if($getperm->get("- fortnitedefaultdance.sound.on") == true) { $sender->sendMessage("§cYou have already chosen this sound!"); } else { if($sender->hasPermission("vip.perm") == false) { $sender->sendMessage("§cYou need to be §6VIP §cto use this taunt!"); } if($sender->hasPermission("vip.perm") == true) { \pocketmine\Server::getInstance()->dispatchCommand(new ConsoleCommandSender, "setuperm " . $sender->getName() . " fortnitedefaultdance.sound.on"); $sender->sendMessage("§aSound Selected Successfully!"); } } break;
Oh my god that's a very creative approach for testing for a permission if I've ever seen one. Why can't you just use $sender->hasPermission("fortnitedefaultdance.sound.on") like with the other two permission checks?
Because an op player has all the server's permissions and checks will be useless and in sw plugin I have,if an op player exists,plugin plays the last sw win sound code I have.(edited:my way with getting perm didn't work,if you have any solution for that which helps me,I would appreciate it.)
You can set the permission to "default: false" instead of "default: op", that way the player only gets the permission if it's explicitly set.
Permissions are not registered in any plugin if I understood correctly,so I can't do that with the way you said.
I'm not sure, but I think OP's shouldn't have permissions when they aren't registered either. Do you mean actual OPs or PurePerms' OP rank that has the permission "*"?
I want to give the ability to OP's to use the sound they want on kill or win and not only one sound and I don't know other way to do that for now.
checkperm alia.sound.on Saxavlax001 Is that correct? No probably because it doesnt work it says checkperm <node> [playerName] Idk what is wrong.
> checkperm alia.sound.on Makairosei [23:52:45] [Server thread/INFO]: ---- Permission node alia.sound.on ---- [23:52:45] [Server thread/INFO]: Permission does not exist [23:52:45] [Server thread/INFO]: Default: op [23:52:45] [Server thread/INFO]: Makairosei has it set to true
Ahh so apparently undefined permissions are by default "default: op", you will need to register the permissions you use as default false or use another method of storing the win sound per player
Ok I registered the permissions I use for sounds in my plugin, made some changes to my codes and now sounds work fine when I choose a certain sound.Thanks for helping me.