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

Player Name string..

Discussion in 'Development' started by PixelzChris, Mar 23, 2019.

  1. PixelzChris

    PixelzChris Silverfish

    Messages:
    17
    How can I get any players name on a string
    Like $pname

    Code

    if($item->getName() === C::clear . ".$pname."){
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    What are you trying to do?
     
    Muqsit likes this.
  3. PixelzChris

    PixelzChris Silverfish

    Messages:
    17
    Καλησπέρα
    Im trying to use transaction event or click event... I have added custom name on the item which if a player is online there will be 1 item with players name you can check my video on yt "PixelzChris" so you can see what im trying to do
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    For reference:
    Screenshot_20190323-164444_YouTube.jpg
    You can clean the item name and then use $server->getPlayerExact($name) to get the Player instance.
    PHP:
    $name TextFormat::clean($item->getName());
     
    PixelzChris likes this.
  5. PixelzChris

    PixelzChris Silverfish

    Messages:
    17
    Sounds useful thank you I will try it!
     
  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.