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

2vs2

Comments in 'Plugin Development' started by TheClimbing, Feb 3, 2016.

  1. TheClimbing
    Offline

    TheClimbing New Member

    Joined:
    Jan 13, 2016
    Posts:
    20
    As you can see its 1vs1 but im trying to make it 2vs2 and I don't know if im going somewhere with this.I don't know nothing about php...Went from python.

    Attached Files:

  2. TheClimbing
    Offline

    TheClimbing New Member

    Joined:
    Jan 13, 2016
    Posts:
    20
    Keep getting Error call to undefined method getServer() but I don't see that as a problem
  3. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    I didn't read your code, because I don't know line, file or where you're getting that error.
    When you get that messages usually means that are you're using $this->getServer() instead $event (Or your event variable name).
    applqpak likes this.
  4. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Probably, you call the method $this->getServer() not from your Main class
    applqpak likes this.
  5. TheClimbing
    Offline

    TheClimbing New Member

    Joined:
    Jan 13, 2016
    Posts:
    20
    From ArenaManager line 68
  6. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    I suggest you to learn PHP before making modifying a plugin
    applqpak likes this.
  7. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Vaivez66 likes this.
  8. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    What I'm trying to point out: IT IS NOT YOUR FAULT it's that commit...
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Using Server::getInstance() is bad practice. The proper way to fix it is to properly reference your main class rather than using statics everywhere.
    CrazedMiner and applqpak like this.
  10. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    I was thinking this was a copy of minifixio's plugin
    if you dont know php you shouldnt be trying to make plugins knowing php alone is quiet the challenge but then you gotta learn OOP and thats also a challenge and then knowing the docs ontop of that is a lot and it takes time you should study up before you attempt to make plugins or modify others #learnfromexp
    CrazedMiner likes this.
  11. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    If you don't know anything about PHP, it's probably best to try to learn a bit.
  12. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    So what should i do?
    Should i pass $server = $this->getServer() to the ArenaManager class?
    And why is Server::getInstance() an bad practise?
  13. FlamingGenius
    Offline

    FlamingGenius Active Member

    Joined:
    Sep 23, 2015
    Posts:
    173
    Minecraft User:
    FlamingGenius
    Somebody told me once it just caused errors sometimes in plugins its easier to remember the other one anyways
  14. TheClimbing
    Offline

    TheClimbing New Member

    Joined:
    Jan 13, 2016
    Posts:
    20
    I was thinking about the same question.Really why it is a bad practice?As i said im new,right now im learning php so what you mean by passing the $server = $this->getServer() to the ArenaManager class
    Last edited: Feb 3, 2016
  15. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Just change $this->getServer() to Server::getInstance() in ArenaManager
  16. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Thats a BAD practise, it's an property
  17. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Screenshot_2016-02-04-07-57-27-1.png
    I have removed ALL the bad practice. Your plug in should work properly now. Also I have edited the set kit section in the Arena.php file and made it a bit interesting. If any issues pm or post here!! Also sorry for the double plugins.

    Attached Files:

  18. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Also if you use this webpage http://pmt.mcpe.me it practically tells you what errors are in the plugins file when you convert the compressed files into a .phar
  19. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    It even tells you where the errors are located :D Screenshot_2016-02-04-08-20-10-1.png
  20. TheClimbing
    Offline

    TheClimbing New Member

    Joined:
    Jan 13, 2016
    Posts:
    20
    Thanks,now learning,inspecting...:DReally
    Skullex likes this.

Share This Page

Advertisement