Muqsit / InvMenu

A PocketMine-MP virion to create and manage virtual inventories!
https://poggit.pmmp.io/ci/Muqsit/InvMenu/~
GNU General Public License v3.0
201 stars 75 forks source link

Use multiple InvMenu instances instead #90

Closed rjworks closed 4 years ago

rjworks commented 4 years ago

what does it mean? Use multiple InvMenu instances instead on $this->menu = InvMenu::createSessionized( InvMenu::TYPE_DOUBLE_CHEST );

Muqsit commented 4 years ago

Create a separate instance of InvMenu for each player if you want a sessionized invmenu Instead of:

$menu = InvMenu::createSessionized(InvMenu::TYPE_DOUBLE_CHEST);
$menu->readonly();
$menu->setName($name);
$menu->setListener($listener);
$menu->send($player1);
$menu->send($player2);

use:

$menu = InvMenu::create(InvMenu::TYPE_DOUBLE_CHEST);
$menu->readonly();
$menu->setName($name);
$menu->setListener($listener);
$menu->send($player1);

$menu = InvMenu::create(InvMenu::TYPE_DOUBLE_CHEST);
$menu->readonly();
$menu->setName($name);
$menu->setListener($listener);
$menu->send($player2);