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

Crash my plugin

Discussion in 'Plugin Help' started by dragonflex, Feb 1, 2017.

  1. dragonflex

    dragonflex Spider Jockey

    Messages:
    44
    Hi! well, my plugin it's crashed -
    This code
    PHP:
                                }
                            }
                       
                        
    /////////////////////////////// Gildia MSG ///////////////////////////////
                       
                        
    if(strtolower($args[0] == "msg")){
                            if(!isset(
    $args[1])){
                                
    $sender->sendMessage($this->plugin->formatMessage("Use: /f say <mensagem>"));
                                return 
    true;
                            }
                            if(!(
    $this->plugin->isInFaction($player))){
                               
                                
    $sender->sendMessage($this->plugin->formatMessage("Crie Uma Fac"));
                                return 
    true;
                            }
                            
    $r count($args);
                            
    $row = array();
                            
    $rank "";
                            
    $f $this->plugin->getPlayerFaction($player);
                           
                            if(
    $this->plugin->isOfficer($player)){
                                
    $rank "*";
                            } else if(
    $this->plugin->isLeader($player)){
                                
    $rank "**";
                            }
                            
    $message "-> ";
                            for(
    $i=0;$i<$r-1;$i=$i+1){
                                
    $message $message.$args[$i+1]." "
                            }
                            
    $result $this->plugin->db->query("SELECT * FROM master WHERE faction='$f';");
                            for(
    $i=0;$resultArr $result->fetchArray(SQLITE3_ASSOC);$i=$i+1){
                                
    $row[$i]['player'] = $resultArr['player'];
                                
    $p $this->plugin->getServer()->getPlayerExact($row[$i]['player']);
                                if(
    $p instanceof Player){
                                    
    $p->sendMessage(TextFormat::RED.TextFormat::RED."-FacPv-".TextFormat::GOLD." [$rank$f] ".TextFormat::YELLOW."[$player] ".": ".TextFormat::RESET);
                                    
    $p->sendMessage(TextFormat::WHITE.TextFormat::WHITE.$message.TextFormat::RESET);
    }
                }
            } else {
                
    $this->plugin->getServer()->getLogger()->info($this->plugin->formatMessage("Użyj tej komendy w grze"));
            }
        }
    }
    This photo crash
     

    Attached Files:

  2. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    You have a syntax error. Please send the whole file or learn how to properly place curly brackets.
     
  3. kaliiks

    kaliiks Zombie

    Messages:
    250
    PHP:
    if(strtolower($args[0] == "msg")){
        if(!isset(
    $args[1])){
            
    $sender->sendMessage($this->plugin->formatMessage("Use: /f say <mensagem>"));
            return 
    true;
        }
        if(!(
    $this->plugin->isInFaction($player))){

            
    $sender->sendMessage($this->plugin->formatMessage("Crie Uma Fac"));
            return 
    true;
        }
        
    $r count($args);
        
    $row = array();
        
    $rank "";
        
    $f $this->plugin->getPlayerFaction($player);

        if(
    $this->plugin->isOfficer($player)){
            
    $rank "*";
        } else if(
    $this->plugin->isLeader($player)){
            
    $rank "**";
        }
        
    $message "-> ";
        for(
    $i=0;$i<$r-1;$i=$i+1){
            
    $message $message.$args[$i+1]." ";
        }
        
    $result $this->plugin->db->query("SELECT * FROM master WHERE faction='$f';");
        for(
    $i=0;$resultArr $result->fetchArray(SQLITE3_ASSOC);$i=$i+1){
            
    $row[$i]['player'] = $resultArr['player'];
            
    $p $this->plugin->getServer()->getPlayerExact($row[$i]['player']);
            if(
    $p instanceof Player){
                
    $p->sendMessage(TextFormat::RED.TextFormat::RED."-FacPv-".TextFormat::GOLD." [$rank$f] ".TextFormat::YELLOW."[$player] ".": ".TextFormat::RESET);
                
    $p->sendMessage(TextFormat::WHITE.TextFormat::WHITE.$message.TextFormat::RESET);
            }
        }
    } else {
        
    $this->plugin->getServer()->getLogger()->info($this->plugin->formatMessage("Użyj tej komendy w grze"));
    }
     
  4. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    I may able to help you with your problem but i need the whole files of the plugin or send me the phar file
     
  5. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    No, you only need the 1 file with the syntax error in it. Also syntax errors should really be fixable by everyone.
     
  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.