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

get player data and set a advanced function on command?

Discussion in 'Facepalm' started by Tester_master, Dec 7, 2016.

  1. Tester_master

    Tester_master Silverfish

    Messages:
    19
    does anyone know how to set a advanced function on command? no not messages something more advanced then x y z or just equal to it since player data might also be needed for a plugin to work and i need links to plugin tutorials latest plugin tutorials
     
  2. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    If you want POS, code is:
    PHP:
    use pocketmine\level\Level;
    use 
    pocketmine\level\Position;

    // Define $p
    X:
    $p->getX();
    Y:
    $p->getY();
    Z:
    $p->getZ()
     
    LilCrispy2o9 likes this.
  3. Junkdude

    Junkdude Zombie

    Messages:
    346
    GitHub:
    JunkDaCoder
    Explain more please
     
    applqpak likes this.
  4. Intyre

    Intyre Administrator Staff Member PMMP Team

    Messages:
    81
    GitHub:
    Intyre
    Instead of asking questions you could start reading the source. Everything anyone can do with PocketMine is in there.

    "But there are many files! Where should I start?"
    The obvious answer to that would be either start.sh or start.cmd.

    "But that isn't a PHP file! Why do I need to read it?"
    When you read one of the start files you'll find the first clue "./src/pocketmine/PocketMine.php".
    It all starts with PocketMine.php.

    "Ok! Now what?"
    If you know PHP you know how functions and classes and objects work.
    Read PocketMine.php and try to understand what the code is doing.
    When you see a function or class you want to know more about then use the search function on http://php.net or https://github.com/pmmp/PocketMine-MP.

    We are not here to hold your hand or spoon feed you.
    You want to make a plugin so you also have to put some effort into it.
    Be specific when you ask questions. Provide code to show your effort.
    When you do all that and your plugin works you can be proud at yourself.
     
  5. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Primus, applqpak and HimbeersaftLP like this.
  6. Intyre

    Intyre Administrator Staff Member PMMP Team

    Messages:
    81
    GitHub:
    Intyre
    True, but those docs don't show how things get used. But when you read/search in the source code you see how it gets used.
     
    applqpak, HimbeersaftLP and dktapps like this.
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    This question is too vague. There doesn't exist something called "advanced functions" in PocketMine. Everything is advanced. What you're asking is how you can write code if you can't copy it from the forums.
     
    applqpak, HimbeersaftLP and dktapps like this.
  8. Tester_master

    Tester_master Silverfish

    Messages:
    19
    Well what about plugins like vpnblock
     
  9. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Is that relevant to any of this?
    Anyways, Vpnblock is a plugin that isn't that advanced.
     
  10. Tester_master

    Tester_master Silverfish

    Messages:
    19
    wouldn't you look at source code to learn from there
     
  11. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    That should be spoken to yourself, right?
    They are plugins where you can't copy code to write. Start learning and stop copying, that's how you make "advanced" plugins. Otherwise, a plugin that sends a message when player joins and a plugin that checks if the player is blocked according to your VPN information vendor are essentially only slightly different in terms of the difficulty to make.
     
    Primus likes this.
  12. Tester_master

    Tester_master Silverfish

    Messages:
    19
    I didn't say I would copy 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.