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

i tried to deny windows 10 players from join

Discussion in 'Facepalm' started by r7vmc, Aug 1, 2017.

  1. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    i tried to deny windows 10 players from join unless if they but my username but it got to deny all platforms from join even if they but my username

    here's the code

    PHP:
    public function onPacketReceived(DataPacketReceiveEvent $event){ //thx PMMP community for code
            
    $packet $event->getPacket();
            if(
    $packet instanceof LoginPacket) {
                
    $player $event->getPlayer();
                
    $name $player->getPlayer();
                if (
    $packet->gameEdition === && $name === "r7vmc") {

                }
                else {
                    
    $player->close("""§l§4ﺮﻓﺮﻴﺴﻟﺍ ﻝﻮﺧﺩ ﻦﻣ ﻦﻴﻋﻮﻨﻤﻣ 10 ﺯﻭﺪﻨﻳﻭ ﻦﻴﺒﻋﻻ");
                }
            }
        }
     
  2. InxGaming

    InxGaming Spider

    Messages:
    14
    I think you meant $name = $player->getName() instead of $name = $player->getPlayer(). In $name, you want to store the name of the player, not the player itself. .
     
  3. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    no luck :(
     
  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.