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

i get error help pls

Discussion in 'Plugin Help' started by Patrycy04, Nov 26, 2016.

  1. Patrycy04

    Patrycy04 Spider Jockey

    Messages:
    38
    GitHub:
    Patrycy04
    PHP:
    <?php
    namespace patrycy04;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\CommandSender;

    class 
    Main extends PluginBase{
    }

    public 
    funtion OnLoad(){
    $this->getLogger()->info("Plugin ładowanie");
    GetLogger()->info("Plugin ładowanie"); } public function onEnable(){
    $this->getLogger()->info("Plugin włączony"); } public function onDisable(){
    $this->getLogger()->info("Plugin wyłączony"); } }
    }

    public function 
    onCommand(CommandSender $sender,Command $cmd,$label,array $args){
       if(
    $cmd->getName() == "kitgracz"){
            
    $sender->getInventory()->addItem(Item::get(298,0,1));
            
    $sender->getInventory()->addItem(Item::get(299,0,1));
            
    $sender->getInventory()->addItem(Item::get(300,0,1));
            
    $sender->getInventory()->addItem(Item::get(301,0,1));
            
    $sender->getInventory()->addItem(Item::get(274,0,1));
            
    $sender->getInventory()->addItem(Item::get(297,0,64));
            
    $sender->sendMessage("§aOtrzymałeś kit §lgracz!"); } } return true;
            }
     

    Attached Files:

    Last edited by a moderator: Nov 26, 2016
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    It would certainly help us if you would give the error and put [PHP][/PHP] tags around your code.
     
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Please tell us what the error is
     
    SOFe likes this.
  4. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Please tell us what error you are experiencing, if there are any errors on the console. Also please tell us what you want the code to do.
     
  5. Patrycy04

    Patrycy04 Spider Jockey

    Messages:
    38
    GitHub:
    Patrycy04
    I want code for command give player these items with permission
     
  6. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    We still need the error you get :p
     
  7. KelvinCyaX

    KelvinCyaX Silverfish

    Messages:
    18
    GitHub:
    CyanKelv
    Think its the return true; and GetLogger() lol
     
    Sandertv likes this.
  8. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Yeah it doesn't exactly seem good lol.
     
  9. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    You don't have the faintest idea what you are doing, do you? Format your code properly.
     
  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.