PurePerms offers a few API methods: https://github.com/poggit-orphanage...8de8/src/_64FF00/PurePerms/PurePerms.php#L234
No, don't copy code from there, use the methods there. setGroup is probably what you need. And since that method needs an instance of PPGroup as parameter, you will need to get a group using getGroup.
PHP: $purePerms = $this->getServer()->getPluginManager()->getPlugin("PurePerms");$group = $purePerms->getGroup("groupname");$purePerms->setGroup($player, $group); (assuming $this is a PluginBase instance (or anything with a getServer method) and $player implements the IPlayer interface (for example an instance of Player))
Error PHP: 01:30:04] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected '$this' (T_VARIABLE)" (EXCEPTION) in "plugins/PermChangeur/src/Matroxplay/PermChangeur/Main" at line 27 My full code: PHP: <?phpnamespace Matroxplay\PermChangeur;use pocketmine\plugin\PluginBase;use pocketmine\command\CommandSender;use pocketmine\command\Command;use pocketmine\Server;use pocketmine\Player;use pocketmine\event\Listener;class Main extends PluginBase implements Listener{public function onEnable(){$this->getLogger()->info("Activation...");}public function onDisable(){$this->getLogger()->info("Désactivation...");}public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool {switch($command->getName()){case "modo": $purePerms = $this->getServer()->getPluginManager()->getPlugin("PurePerms"); <--- line 27 $group = $purePerms->getGroup("modo"); $purePerms->setGroup($player, $group) return true;}}}
1. There is a semicolon missing after "$purePerms->setGroup($player, $group)" 2. $player is not defined Also the Syntax error you gave me does not exist, so you either didn't send the right code or left something out. You seem to need more practise in php.