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

Need Help With $player Variable

Discussion in 'Facepalm' started by Bintang Putra, Jun 1, 2017.

  1. Bintang Putra

    Bintang Putra Witch

    Messages:
    63
    GitHub:
    chaostixzix
    Hi, I'm A Newbie At PHP

    So, I Want To Use $player->getX;
    But, I Dont Know How To Declare $player Variable
     
  2. Lowkey

    Lowkey Slime

    Messages:
    94
    You must use $player as pocketmine\Player.
     
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    you need to learn PHP FULLY including OOP
    if you did check $this i heard there's a way to get server and get player by name using server
     
    Muqsit likes this.
  4. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    PHP:
    $player $event->getPlayer(); // If you're using events
    $player->getX();
     
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Telling people to get a player by name is not reasonable. Most of the time whatever you do with the player has entirely nothing to do with the name.
     
  6. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    but due to lack of context i have no way to tell about anything...
     
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    But you have insufficient information to tell that you get a player by name as well.
     
  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.