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

not working

Discussion in 'Development' started by Doxestic, Apr 11, 2020.

  1. Doxestic

    Doxestic Spider Jockey

    Messages:
    41
    why this is not working?


    PHP:
    <?php

    namespace ServerL;

    use 
    pocketmine\player;
    use 
    pocketmine\server;
    use 
    pocketmine\inventory\inventory;
    use 
    pocketmine\command\commandsender;
    use 
    pocketmine\event\player\playerjoinevent;
    use 
    FormAPI\src\jojoe77777\FormAPI\simpleform;
    use 
    Doxestic\ServerL\UI;
    use 
    pocketmine\plugin\pluginbase;
    use 
    pocketmine\item\item;
    use 
    pocketmine\event\player\Pl;

    class 
    main extends PluginBase{
        
        
        public function 
    onenable(){
            
    $this->getlogger()->info("Plugin Enabled...");
        }
        
        public function 
    givep(){
            
    $this->getPlayer()->getname();
            
    $player $this->getplayer()->getname();
            if(
    $player->hasplayedbefore !== true){
                
    $this->$player->additem(347)->setCustomName("Select server");
            }
        }
        
        public function 
    onuse(){
            
    $item $player->getname()->PlayerItemHeldEvent()->getitem();
            if(
    $item == 347){
                
    $this->UI();
                return 
    true;
            }
            else{
                return 
    false;
            }
        }
    }
     
  2. James-COMMANDO

    James-COMMANDO Spider

    Messages:
    8
    GitHub:
    james-commando
    what kind of error does it give you?
    That would help a bit
    (the whole console error please)
     
  3. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    There are errors everywhere, consider learning how to write proper php
     
  4. James-COMMANDO

    James-COMMANDO Spider

    Messages:
    8
    GitHub:
    james-commando
    That is wrong because if you you do that it will not register properly, and just do use jojoe77777\FormAPI\simpleform
     
  5. James-COMMANDO

    James-COMMANDO Spider

    Messages:
    8
    GitHub:
    james-commando
    you have to implement Listener
     
  6. James-COMMANDO

    James-COMMANDO Spider

    Messages:
    8
    GitHub:
    james-commando
    What IDE do you use?
     
  7. ethaniccc

    ethaniccc Baby Zombie

    Messages:
    189
    GitHub:
    ethaniccc
    1) Captilization matters
    2) Your function will never be called
    3) Listener not registered
    4) getPlayer is NOT a part of your plugin's main
    5) $player is not defined in "onuse"
    6) UI is NOT a function in your Main
    7) hasPlayedBefore is a function, NOT a Variable in Player.php
    8) The arguments for "addItem" are invalid
    9) Wth is "$this->$player" it should just be $player
    10) $player is defined as the NAME of the player?? So let's give an item to a string, just yes.
    11)
    I- wha-

    TLDR:
     
    HimbeersaftLP likes this.
  8. ethaniccc

    ethaniccc Baby Zombie

    Messages:
    189
    GitHub:
    ethaniccc
    Whether OP had implemented Listener or not, he would still get errors (from code), and the functions will never be called.
     
  9. James-COMMANDO

    James-COMMANDO Spider

    Messages:
    8
    GitHub:
    james-commando
    My Guy I did not know you will be making a fucking test so chill out with you being mad at me, atleast say it was a test lmfao like what
     
  10. ethaniccc

    ethaniccc Baby Zombie

    Messages:
    189
    GitHub:
    ethaniccc
    ?? When did I say I was mad at you? Th you even getting that from ?? I just answered his/her question like ⁉️

    "fucking test"
    No, it's the answer OP asked for.
    Question: Why is this not working?

    Quit your BS while you're at it too.
     
    Last edited: Apr 11, 2020
  11. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    This is your third thread containing shit code that just vaguely resembles php. For the love of god, show some respect and try to learn at least a bit of php before attempting to make a plugin.
     
    ethaniccc and James-COMMANDO like this.
  12. James-COMMANDO

    James-COMMANDO Spider

    Messages:
    8
    GitHub:
    james-commando
    Now thank you, here is a person who understands
     
  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.