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

ERROR: 'Could not load plugin 'CommandTracer'

Discussion in 'Development' started by InspectorGadget, Jan 9, 2017.

  1. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    Hi! I've been working on this plugin lately.. I encountered this issue where i says

    Here's the FULL Loader.php
    PHP:

    <?php

    /*
     * All rights reserved RTGNetworkkk
    */
    namespace RTG\Tracker;

    use 
    pocketmine\utils\Config;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\Server;
    use 
    pocketmine\Player;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\event\player\PlayerCommandPreprocessEvent;

    class 
    Loader extends PluginBase implements Listener {
     
       public function 
    onEnable() {
           
    $this->getServer()->getPluginManager()->registerEvents($this$this);
           
    $this->logs = new Config($this->getDataFolder() . "logs.txt");
       }
     
       public function 
    onFilter(PlayerCommandPreprocessEvent $e) {
           
    $msg $e->getMessage();
           
    $carray explode(" ",trim($msg));
           
    $m $carray[0];
           
    $p $e->getPlayer();
           
    $n $p->getName();
           
    $r intval(time());
           
    $time date("m-d-Y H:i:s"$r);
             
               if(
    $p->isOp() or $p->hasPermission("system.track")) {
                   if(
    $m === "/kick" or $m === "/ban" or $m === "/pardon") {
                       
    $this->logs->set($time"Player: " $n " | Command: " $msg);
                       
    $this->logs->save();
                   }
               }
       }
     
       public function 
    onDisable() {
       }
     
    }

    On GitHub:
    - https://github.com/RTGNetworkkk/CommandTracker

    Issue:
    - https://github.com/RTGNetworkkk/CommandTracker/issues/1
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    any more errors?
     
  3. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
  4. HBIDamian

    HBIDamian HBIDamian Staff Member

    Messages:
    365
    GitHub:
    HBIDamian
    the issue at hand here was in the plugin.yml
    Here is the corrected version.
    Code:
    name: CommandTracker
    version: 1.0.0
    main: RTG\Tracker\CommandTracker
    api: 2.1.0
    author: IG
    permissions:
      system.track:
        default: op
    
    You have added a semicolon on the main class.
    RTG\Tracker\CommandTracker;

    DevTools gave me a warning.
    Warning: Couldn't load source plugin CommandTracker: main class not found in phar://C:/Users/TheDeibo/Desktop/_PM/plugins/DevTools_v1.11.1-95929e1d.phar/src/FolderPluginLoader/FolderPluginLoader.php on line 70
     
    Last edited: Jan 9, 2017
  5. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    Wow! You're the best. I didnt even notice that!.. :)
    Thanks!
    DevTools didnt give me any error like that...
     
  6. HBIDamian

    HBIDamian HBIDamian Staff Member

    Messages:
    365
    GitHub:
    HBIDamian
    Simple mistake that could have been a slip of the key. (accidental)
    Always be careful of what key you press.

    [​IMG]
     
    Muqsit likes this.
  7. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    Lmao, Ok
     
  8. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Or things you forget since PHP was ever a thing
     
  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.