Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is It Possible?

Comments in 'Plugin Development' started by Renzo, May 31, 2014.

  1. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    Hello I Have A Question:

    I know how to say something to the console:

    PHP:
    Console ("Type a Number");
    Is it possible to store the number that they typed in a variable?
    Tuff likes this.
  2. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    Why can't you just take in command arguments?
  3. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    ?
    (Sorry not a pro developer)
  4. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    You don't need to be a pro developer to be able to do what I said. There are lots of tutorials for PocketMine-MP on the forum.
  5. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    What Are Command Arguments?

    Can You Give An Example
  6. Tuff
    Offline

    Tuff Active Member

    Joined:
    Jan 25, 2014
    Posts:
    203
    Minecraft User:
    Roboroug2
    Is this a plugin request? You want a player to be able to type a number, and it to show up in the console? And you want to store the number?
  7. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    It is no request it is just a question. But you know what iam trying to do
  8. Tuff
    Offline

    Tuff Active Member

    Joined:
    Jan 25, 2014
    Posts:
    203
    Minecraft User:
    Roboroug2
    Ya it's possible, I can make you a plugin that could do this if you want. It should take like two seconds.
    Purpose?
  9. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    No i just need the code for my plugin that iam making
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Refer to pocketmine\wizard\Installer.
    Andrey Nazarchuk likes this.
  11. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    Not trying to hate but im kinda confused by the fact that your trying to make a plugin yet dont know (or at least didnt know) what command arguments are....
    PEMapModder and Tuff like this.
  12. Reid
    Offline

    Reid New Member

    Joined:
    May 27, 2014
    Posts:
    13
    Minecraft User:
    Suppert2
    Plz help if any one has cooed porkchop servers how do u install plugins for it
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Start another thread at the correct forum.
    Comedyman937 likes this.
  14. Reid
    Offline

    Reid New Member

    Joined:
    May 27, 2014
    Posts:
    13
    Minecraft User:
    Suppert2
  15. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    Can you tell me what they are?
  16. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    One of the 10 billion plugin making tutorials should have an explanation but I guess I can anyway:

    Command arguments are what allow a single command to have multiple options. For example you can use arguments to make a command add or delete people from a config by using a single command like /config add <info> or /config delete <info>. I normally dont use the $args though since Im used to parameters.
    PEMapModder likes this.
  17. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    But can you give an example?
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Comedyman937 likes this.
  19. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    388
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    If you want examples you can look at tutorials or view the code of my plugins (they use parameters though)

    However, if you view my plugins code DO NOT just copy and paste it into your own plugin! I WILL report any stolen content that I find. Regardless of if it is stolen from one of my plugins or not.
    PEMapModder and Tuff like this.
  20. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    Feel free to use it in your plugin as long as you leave me credit. :)

    PHP:
    public function init() {
    $this->api->addHandler("console.command",array($this,"command"));
    }
    public function 
    command($data) {
    if(!(
    $data["issuer"] instanceof Player) && is_numeric($data["cmd"])) {
    $this->number $data["cmd"];
    return 
    false;
    }
    }

Share This Page

Advertisement