Closed StephanToGo closed 7 years ago
Hello. Your solution:
// Transfer $player
foreach ($player->getSynapse()->getClientData() as $hash => $cdata)
{
if ($cdata["description"] == 'lobby') // to lobby
{
$player->transfer($hash);
break;
}
}
can $player be a pocketmine\Player instance or we need an instance of synapse\Player? If so, how can we get that instance? I'm getting mad.
pocketmine\Player
doesnt really matter.......
no. synpase\Player where the getSynapse() method
@iPocket
I used pocketmine\Player, and it still worked for me. No matter which one is being used.
@iPocket how to get synapse\Player instance if there isn't a getSynapsePlayer($player) function in SynapsePM's Main class?
@AryToNeX synapse\Player is extended from pocketmine\Player. So, if $player instanceof \synapse\Player is true, then $player instanceof \pocketmine\Player is also true.
@Tarik02 That's mostly what i was trying to them tell....
But @iPocket got it all wrong....
i love your work, really!!! but i cant write down a plugin that can transfer player... i didnt find the right using of synapse. can someone help? i missed something maybe...
have someone more infos as $this->getServer()->getPluginManager()->getPlugin('SynapsePM')->getSynapses(); it doesnt work to get the ways...
ps. all runs fine, synapse server and my lobby server is connected. but cant tranfer a player from lobby to another server because i dont know how xD