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

On null level crash, even with isLevelLoaded() check

Comments in 'Plugin Development' started by MyNameIsTriXz, Feb 15, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Why? :/
    PHP:
    public function Second(){

    foreach(
    $this->games as $game => $value){

    $Arena $value["Arena"];

    if(
    $this->getServer()->isLevelLoaded($Arena)){

    $Phase $value["Phase"];
    $RedPoints $value["RedPoints"];
    $BluePoints $value["BluePoints"];



    foreach(
    $this->getServer()->getLevelByName($Arena)->getPlayers() as $player){

    if(
    $this->getTeam($player) == "Red"){
    $player->sendTip("§c"$RedPoints." §b".$BluePoints);
    }


    if(
    $this->getTeam($player) == "Blue"){
    $player->sendTip("§b"$BluePoints." §c".$RedPoints);

    }}}}
    }

Share This Page

Advertisement