1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Removing Players From Player-list!

Discussion in 'Development' started by AlexPads, Feb 18, 2019.

Thread Status:
Not open for further replies.
  1. AlexPads

    AlexPads Spider Jockey

    Messages:
    27
    GitHub:
    alexpads
    @ZackyVN Got it to Work!!!! Thank you so Much!

    Will add edited code to Github Soon!
     
  2. AlexPads

    AlexPads Spider Jockey

    Messages:
    27
    GitHub:
    alexpads
    @wolfdale DO you all know any other ways of Making it so when People join the server they also get sent the new packets without the vanished player? i have already tried player login and player join events neither worked. :(
     
  3. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    If you mean you want new players to not be able to see the vanished player, cancel DataPacketSendEvent if packet is PlayerListPacket and uuid matches vanished player's uuid (save it somewhere) and type is TYPE_ADD
     
  4. AlexPads

    AlexPads Spider Jockey

    Messages:
    27
    GitHub:
    alexpads
    What event would you run that on so that when they join that's what happens is if you are vanished then they get the packet.
     
  5. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
     
  6. AlexPads

    AlexPads Spider Jockey

    Messages:
    27
    GitHub:
    alexpads
    I did -_- i tried it on PlayerJoinEvent and PlayerLoginEvent and Neither worked so i was asking WHEN you cancel the function i know how to do it just not when.
     
  7. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    Maybe you should consider getting glasses -_- im not sure what you read but here it is again...
    Did i even say anything about PlayerJoinEvent and PlayerLoginEvent?
     
  8. AlexPads

    AlexPads Spider Jockey

    Messages:
    27
    GitHub:
    alexpads
    ok Thanks :) Solved!
     
  9. sup

    sup Spider

    Messages:
    12
    hi I used your way to hide someone in player list and to re add the player but with the new version of pmmp when I re add the player I have this error in my console;

    TypeError: "Argument 1 passed to pocketmine\network\mcpe\NetworkBinaryStream:putSkin() must be an instance of pocketmine\network\mcpe\protocol\types\SkinData, instance of pocketmine\entity\Skin given, called in phar://C:/Users/coude/OneDrive/Documents/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/network/mcpe/protocol/PlayerListPacket.php on line 85" (EXCEPTION) in "src/pocketmine/network/mcpe/NetworkBinaryStream" at line 106

    and I use this to re add the player;

    $entry = new PlayerListEntry();
    $entry->uuid = $sender->getUniqueId();
    $entry->entityUniqueId = $sender->getId();
    $entry->xboxUserId = $sender->getXuid();
    $entry->username = $sender->getName();
    $entry->skinData = $sender->getSkin();
    $pk = new PlayerListPacket();
    $pk->entries[] = $entry;
    $pk->type = PlayerListPacket::TYPE_ADD;
    foreach($this->getServer()->getOnlinePlayers() as $players){

    $players->sendDataPacket($pk);
     
  10. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Please do not bump old threads.

    Locking
     
    Provsnoobgaming likes this.
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.