Hello, I have a problem with the 1vs1 plugin by Minfiixo. https://github.com/Minifixio/pocketmine-1vs1-plugin (The author is inactive so I decided to ask here) Here's my problem: Players on my server are exploiting a bug, first they enter the 1vs1 match, and then do /hub to get back to spawn immediately, keeping the items which should be only get able in the 1vs1 match. This is very unfair since the 1vs1 match gives you full diamond armor, and they are abusing this bug. How I fix this? My idea is that, when they do /hub or /spawn, their inventories get cleared and loose the match, what code should I add for that though?
Yeah, i think you should try to clear the player's inventory by executing the /hub command. If you execute /hub you are teleported to another world and now you can code in, that if one player leaves the world in combat time, the second player wins, get rewarded and returned to lobby again.
First, i would not modify Arena.php but rather EventsManager.php. You could add this code to the onPlayerQuit() event handler, but keep in mind you might need to link more classes (like ConsoleCommandSender) Code: $this->arenaManager->getServer()->dispatchCommand(new ConsoleCommandSender(), "clear $event->getPlayer()");
Hello, thanks for replying. But on what line should I add the code in EventsManager? (Sorry I'm a newbie)
eventually on line 35. but remember you need to link ConsoleCommandSender and some other classes, too.
How do I link ConsoleCommandSender? And what are other classes to link besides that? (Again, sorry I'm a newbie)
So I made a Version that clears the players inventory upon leaving the server: https://github.com/DarkWav/1vs1 [Phar]
Wait, but does it clear the players' inventories when they do /hub or /spawn? I want to prevent those too
whenever they switch to a different gameserver, the inventory will be cleared. If your hub is at the same server as the 1v1 arena is, it wont be cleared.