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

Solved Create Two Php files in a plugin

Comments in 'Plugin Development' started by amiremad, Nov 2, 2015.

  1. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    You want to get banned? Stop spamming.
  2. iDirtPlayzMC
    Offline

    iDirtPlayzMC Active Member

    Joined:
    Apr 10, 2015
    Posts:
    264
    Minecraft User:
    iZenith_xPr
    :( sorry
  3. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    thank you all guys for the help
    hoyinm14mc and Martin77Epic like this.
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    If you can't distinguish between files and classes, then that means you don't know what you are doing. Why would you do something that you don't know what it is?
  5. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    You only helped him to seperate Listener from "Main" class. And if you didnt know that other classes can be used for many reasons. For example if i'm making an TeamPVP with kits i will probably make new class for this
    PHP:
    class KitManager {

    public 
    $kits.

    public function 
    __construct(Main $plugin){
    $this->plugin $plugin;
    $this->loadKits();
    }

    }
    To access this object i will save it on my Main class.
    PHP:
    public $kitMgr;

    public function 
    onEnable(){
    $this->kitMgr = new KitManager($this);
    }
    LDX, hoyinm14mc and Ritch like this.
  6. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    he asks to put it is I file shows :D
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    What? Anyway read again
    He want them to read both not make test.php an Event Handler. Well yes it will read test.php and main.php in your situations but again he wanted just to read them.
  8. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
  9. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    What whyy? All objects you use as an Listener? you dont have to registerEvent(). For all of your objects >.<
  10. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    I know :p
  11. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    You don't seem to. Someonw close this thread lol.
  12. Artide
    Offline

    Artide Active Member

    Joined:
    Apr 20, 2015
    Posts:
    214
    Minecraft User:
    Artide5
    The period and the comma go inside the the double quotation marks.
    Taha_The_Hacker likes this.
  13. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    thx evryone i learned php and i am better coder now
    CraftingMania likes this.
  14. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Not for programmers, and programming trumps English punctuation. "classes" != "classes."
  15. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    English Parse error: syntax error, unexpected end of file, expecting ',' or '.'
    Hotshot_9930 likes this.
  16. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Lol, this is the funniest thing I've seen all night.
  17. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Main.php is a class?
    Maybe you have to search google definitions.
  18. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    If you want create a new file:
    - Right button.
    - Create a new file

    Easy.
    Last edited: Jan 8, 2016
  19. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Maybe you have to check the date that was posted? And for the record, more users tend to put one class per file, so no correction is needed. Please consider the significance of something like this before quoting me.
    amiremad and hoyinm14mc like this.
  20. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Excuse me, create a new directory if you want to create a new file?

    We are referring to the fact that wee do not create two PHP files unless we want to create two classes.
    XFuryMCPE and Gamecrafter like this.

Share This Page

Advertisement