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

Config file don't save.

Comments in 'Plugin Development' started by xpyctum, Dec 9, 2014.

  1. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Hmm...
    I don't know
  2. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    386
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    Tomorrow morning I will test your code on my private server, fix any crashes I can find without my client, and make a pull request.

    For future reference, no one can help you if you can't show a crash report. ;)
    EvolSoft likes this.
  3. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Hmmm, maybe it's interesting, BUT i don't et crash if i don't use this.
    PHP:
    if(strtolower(trim($event->getLine(0))) == "status" || strtolower(trim($event->getLine(0))) == "[status]"){
                
    $tps $this->getServer()->getTicksPerSecond();
                
    $p count($this->getServer()->getOnlinePlayers());
                
    $level $event->getBlock()->getLevel();
                
    $full $this->getServer()->getMaxPlayers();
                
    $event->setLine(0,"[STATUS]");
                
    $event->setLine(1,"TPS: [".$tps."]");
                
    $event->setLine(2,"ONLINE: ".$p."/".$full."");
                
    $event->setLine(3,"******");
                
    // $this->sign->set("x",$event->getBlock()->getX());          
                // $this->sign->set("y",$event->getBlock()->getY());          
                // $this->sign->set("z",$event->getBlock()->getZ());          
                // $this->sign->set("enabled","true");          
                // $this->sign->set("level",$level);          
                // $this->sign->save();
            
    }
    http://github.com/xpyctum/SignStatus/commit/cad88e1b7184284f272364621a1af0649b461f18
    Last edited: Dec 10, 2014
  4. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Crashes, if i use
    PHP:
    $this->sign->save();
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Why did you define $this->sign again? Then what is the use of making that field?
  6. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Thanks for all your replies! I fixed my plugin! That works :)
    [​IMG]
    Comedyman937 likes this.
  7. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Getted Segmentation Failed because save level in sign.yml without name level.
  8. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    386
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    On line 61, try to use $level = $event->getPlayer()->getLevel()->getName();
  9. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Yesterday, i'm already fixed this :)
    Comedyman937 likes this.
  10. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    Nice work, will be installed on one of my servers!: D
  11. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Thanks. I waiting when plugin will be uploaded :D

Share This Page

Advertisement