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

help with registering commands

Comments in 'Plugin Development' started by FunneyShip, Jun 8, 2014.

  1. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    is it possiable to do this

    $this->api->console->register($this->CONFIG["A"], "do nothing!", array($this, "first"));

    i know it's noob question but i need the answer
  2. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Yes.
    MCPE_gamer and PEMapModder like this.
  3. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    whooooooo!!! my if it is right then my first plugin is coming out today!!
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Make sure you define $this->config though.
  5. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Mayby use this
    PHP:
    $this->config['A']
    PEMapModder likes this.
  6. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    where should i put it?
  7. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Replace in code
  8. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    here is the code
    plz tell if there is anything wrong. well it is but tell me where is it

    Attached Files:

  9. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    PHP:
    $this->api->console->register($this->CONFIG['A'], "do nothing!", array($this"first"));
    It replace.
    This ready code.
    FunneyShip likes this.
  10. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Watch Economys plugin, he use this
  11. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    okay i well look. thanks
  12. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    And, replace

    PHP:
    $this->CONFIG["B"]
    To
    PHP:
    $this->CONFIG['B']
  13. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    can you tell me on which file. its too big and i dont have time to look all over it
  14. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    here are the errors

    [ERROR] A E_NOTICE error happened: "Use of undefined constant reload - assumed 'reload'" in "C:\Users\Public\Videos\Sample Videos\New folder\PocketMine-MP1.4\PocketMine-MP\plugins\CommandChanger.php" at line 26
    15:35:39 [ERROR] A E_NOTICE error happened: "Use of undefined constant stop - assumed 'stop'" in "C:\Users\Public\Videos\Sample Videos\New folder\PocketMine-MP1.4\PocketMine-MP\plugins\CommandChanger.php" at line 27
    15:35:39 [ERROR] A E_NOTICE error happened: "Undefined property: Change::$CONFIG" in "C:\Users\Public\Videos\Sample Videos\New folder\PocketMine-MP1.4\PocketMine-MP\plugins\CommandChanger.php" at line 30
  15. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    You must put reload and stop in quotation marks.
    xpyctum likes this.
  16. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    And end the plugin.
    Add at the end of plugin
    PHP:
    ?>
    LDX likes this.
  17. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    oh
  18. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    it not very importent
  19. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    First, you need to know the basics.
  20. FunneyShip
    Offline

    FunneyShip Active Member

    Joined:
    Jun 7, 2014
    Posts:
    36
    Minecraft User:
    FunneyMan
    i changed it to what you said and it is still one erorr and reload do nothing
    here is the error

    15:35:39 [ERROR] A E_NOTICE error happened: "Undefined property: Change::$CONFIG" in "C:\Users\Public\Videos\Sample Videos\New folder\PocketMine-MP1.4\PocketMine-MP\plugins\CommandChanger.php" at line 30

Share This Page

Advertisement