in pocketmine.yml: permissions: reserveslots.player: default: false in main.php just code that wont work: if(!$event->getPlayer()->hasPermission("reserveslots.player")){ $event->getPlayer()->kick("§9Server Full!! §a Only players with permission can join now!"); $event->setCancelled(); } I added permision with pureperms!! I did many tests! It just wont work!! Can someone tell me why? Or how does permission work?? Even if i give me permission using pureperms , it wont work at all !!!
I wanna to do!! If player does not have permission !!! He gets kicked!!! But the permission is ok?? It just wont work!! I get kicked even if i have permission!! Idk what to do!!!Im Blocked!! I just cant understand these perms!! !!! Im sure i did it ok!!
Nope ! I add perm to a group!! ! So , nothing wrong with these codes? Edit:Hmm!! If i think about it! Maybe u right!! :0 Edit again: I will do a .txt file , were i can add players to bypass this !! Im making a reserve slots!! You take , for example (in config) , 10 slots from your total, and reserve them for vips, that u add , manually in a .txt file (idk if i will add a command) !! Tests are done , and work but i had problems with da perms :0 !!! Well , i will just do with files and done!! So i have 80 players ! Only 70 players can login , becouse 10 slots are reserved for vips :3 !!
Well the code ur kicking ur self lemme give u a sample code PHP: <?php//////Copy Right EmeraldLordYT////namespace plugin;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\event\block\BlockBreakEvent;use pocketmine\event\block\BlockPlaceEvent;use pocketmine\utils\TextFormat as TF;use pocketmine\event\player\PlayerInteractEvent;class MainBase extends PluginBase implements Listener { public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onBlockBreakEvent(BlockBreakEvent $event) { if($event->getPlayer()->hasPermission('plugincustom.break')){ $event->setCancelled(false); }else{ $event->setCancelled(true); $event->getPlayer()->sendPopup(TF::RED . "Hey! You are not allowed to break"); } } public function onBlockPlaceEvent(BlockPlaceEvent $event) { if($event->getPlayer()->hasPermission('plugincustom.place')){ $event->setCancelled(false); }else{ $event->setCancelled(true); $event->getPlayer()->sendPopup(TF::RED . "Hey! You are not allowed to place"); } } } Well u gatto fix it if there are errors
I still think this is the real reason. According to PurePerms source code, player data is only loaded in PlayerLoginEvent, and the permissions are probably initialized after that. Therefore, calling hasPermission() in PlayerPreLoginEvent will not receive any effect from PurePerms.