LeadBoard can't work

Discussion in 'Plugin Help' started by sdsd16, Jun 1, 2019.

  1. sdsd16

    sdsd16 Spider Jockey

    Messages:
    35
    GitHub:
    Danding1314
    [Server thread/CRITICAL]: Error: "Call to a member function getAll() on array" (EXCEPTION) in "plugins/sexdcore/src/xinghao2003/SEXDCore/Main" at line 785

    #error ^

    #code v
    public function getDJList(){

    $text = "§l§d-================ §eTop10 Lv §d================-\n";
    $gl = $this->getPlugin("Grade");

    if(is_null($gl)){
    $text .= "No plugin!";
    }else{

    $tmp = [];
    $glData = $gl->exp->getAll();

    if(count($glData) < 1) return $text;

    foreach($glData as $$playerName => $data){
    $tmp[$playerName] = (int)["grade"];
    }

    arsort($tmp);
    $num = 0;
    foreach($tmp as $playerName => $dengji){
    $num++;
    if($num > 10) break;
    $text .= " §l§6TOP{$num} >> Name: {$playerName} Lv: {$dengji}\n";
    }
    }
    return $text;
    }

    #config V
    ---
    sdsd16:
    exp: 1
    grade: 18
    maxHealth: 54
    MI: 0
    fix: ""
     
  2. JORDAN SAUNDERS

    JORDAN SAUNDERS Silverfish

    Messages:
    19
    GitHub:
    brunswickyt
    Error: "Call to a member function getAll() on array" (EXCEPTION) in "plugins/sexdcore/src/xinghao2003/SEXDCore/Main" at line 785
    can I see the Main?
    :)
     
  3. HimbeersaftLP

    HimbeersaftLP Chicken

    Messages:
    1,555
    GitHub:
    HimbeersaftLP
    Please use code and php tags in order to make code more readable, you can do this by pressing the "+" button of the post field and then pressing "Code".
    You can also write it like this:

    [php]php code here[/php]
    or
    [code]config files here [/code]
     
    Edwardthedog2 likes this.

Share This Page

  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.