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

Solved Get player from string

Discussion in 'Plugin Help' started by NatanM, Nov 17, 2018.

  1. NatanM

    NatanM Spider

    Messages:
    10
    I have a string with player name and I must get the player, I used the below code:

    $pnm = $this->getServer()->getPlayer($name);

    but don't work, how can I solve it ?

    (Sorry if my English contains errors)
     
    Last edited: Nov 18, 2018
  2. XenialDan

    XenialDan Baby Zombie

    Messages:
    141
    GitHub:
    thebigsmilexd
    Must be
    PHP:
    getServer()->
     
  3. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    $player = $this->getServer()->getPlayerExact($name);
     
    NatanM likes this.
  4. NatanM

    NatanM Spider

    Messages:
    10
    This worked ! Thanks !
     
  5. XenialDan

    XenialDan Baby Zombie

    Messages:
    141
    GitHub:
    thebigsmilexd
    Or getPlayerByName
     
  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.