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

Config Not Showing

Discussion in 'Plugin Help' started by princeace, May 23, 2020.

  1. princeace

    princeace Slime

    Messages:
    78
    GitHub:
    PrincessSeah
    anyone can help me to show the
    JoinMessage:
    Broadcast:
    theres no error!

    i already input the
    private $config;

    PHP:
    public function onPlayerJoin(PlayerJoinEvent $sender)
    {
        
         
    /** TAGS PLAYERNAME */
         
    $seahjoinmsg str_replace("{name}"$sender->getName(), $seahjoinmsg);
        
         
    /** GP JOIN MESSAGE */
         
    $config $this->getConfig->get('GPJoinMessage');
        
              
    /** JOIN MESSAGE */
         
    $sender->sendMessage($this->getConfig()->get("JoinMessage"));
        
        
    /** BROADCAST MESSAGE */
         
    $broadcast $this->getConfig()->get("Broadcast");
         
    $sender->getServer()->broadcastMessage($broadcast);
        
    }
    heres my config.yml
    PHP:
    # NOTE NOTE NOTE ! ! !
    ## dont remove or edit this "GPJoinMessage" or else you got a server crash
    GPJoinMessage#version 3.0.0

    # Color Codes
    # §0 = Black §1 = DarkBlue  §2 = DarkGreen  §3 = DarkAqua  §4 = DarkRed  §5 = DarkPurple §6 = Gold §7 = Gray §8 = DarkGray §9 = Blue a = Green §b = Aqua §c = Red §d = LightPurple §e = Yellow §f = White
    # Format
    # §k = Obfuscated §l = Bold §m = StrikeThrough §n = Underline §o = Italic §r = Reset

    # JoinMessage
    ## tags {player} , {server_name}
    ## {player} = show Player Name
    ## {server_name} = show Server Name
    JoinMessage"JoinMessage"

    # Broadcast
    ## tags {player} , {server_name}
    ## {player} = show Player Name
    ## {server_name} = show Server Name
    Broadcast"BroadcastMessage"

    #  GPJoinMessage by SeahStar
     
  2. RicardoMilos384

    RicardoMilos384 Slime

    Messages:
    82
    GitHub:
    ricardomilos384

    $this->saveResource("config.yml");
     
  3. princeace

    princeace Slime

    Messages:
    78
    GitHub:
    PrincessSeah
    what line ? in the bottom of the broadcast line?
     
  4. princeace

    princeace Slime

    Messages:
    78
    GitHub:
    PrincessSeah
    sorry
    PHP:
    <?php

    declare(strict_types=1);

    namespace 
    SeahStar\GPJoinMessage;

    use 
    pocketmine\event\Listener;
    use 
    pocketmine\event\player\PlayerJoinEvent;
    use 
    pocketmine\Player;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\utils\TextFormat;
    use 
    pocketmine\utils\Config;

    class 
    Main extends PluginBase implements Listener{
     
        private 
    $config;
        
        public function 
    onEnable()
    {
        
    $this->saveDefaultConfig();
        
    $this->reloadConfig();
        
    $this->getLogger()->info("GPJoinMessage by SeahStar has been enabled!");

    }

    public function 
    onPlayerJoin(PlayerJoinEvent $sender)
    {
        
         
    /** TAGS PLAYERNAME */
         
    $seahjoinmsg str_replace("{name}"$sender->getName(), $seahjoinmsg);
        
         
    /** GP JOIN MESSAGE */
         
    $config $this->getConfig->get('GPJoinMessage');
        
              
    /** JOIN MESSAGE */
         
    $sender->sendMessage($this->getConfig()->get("JoinMessage"));
        
        
    /** BROADCAST MESSAGE */
         
    $broadcast $this->getConfig()->get("Broadcast");
         
    $sender->getServer()->broadcastMessage($broadcast);
        
    }

    public function 
    onDisable(){
            
    $this->getLogger()->info("GPJoinMessage by SeahStar has been disabled!");
          }


             }
    this is my whole main.php
     
  5. RicardoMilos384

    RicardoMilos384 Slime

    Messages:
    82
    GitHub:
    ricardomilos384

    PHP:
    public function onEnable() {
        
    $this->saveResource("config.yml");
    }
     
  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.