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

PrisonEssentials/ScoreHud

Discussion in 'Plugin Help' started by yolodude1234567, Aug 28, 2020.

  1. yolodude1234567

    yolodude1234567 Silverfish

    Messages:
    17
    So I used the API from a plugin and made an addon for ScoreHud, and well I'll just show you what happens when someone who is rank Z joins the server and the Scoreboard updates:
    Code:
    [205]         foreach($this->prestiges as $index => $prestige){
    [206]             if($prestige["tag"] === $name) return $prestige["money"];
    [207]         }
    [208]         return 0;
    [209]     }
    [210]
    [211]     public function calculateMoney(Player $player) : int{
    [212]         if($this->getNextRank($player) === ""){
    [213]             if(isset($this->players[$player->getLowerCaseName()]["prestige"])){
    [214]                 return $this->getNextPrestige($player) !== "" ? $this->prestiges[$this->getNextPrestige($player)]["money"] : 0;
    [215]             }
    [216]         }
    [217]         return $this->ranks[$this->getNextRank($player)];
    [218]     }
    [219]
    [220]     public function removeAllPermissions(string $player) : void{
    [221]         foreach($this->ranks as $rank => $price){
    [222]             if($rank !== $this->getDefaultRank()) $this->getPurePerms()->getUserDataMgr()->unsetPermission($this->getPurePerms()->getPlayer($player), strtolower(str_replace("{rank}", $rank, $this->getConfig()->get("permission"))));
    [223]         }
    [224]     }
    Does anyone know how this would be fixable?
     
  2. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    There's like 10 thousand functions used in those two functions.
    Mind sending the whole code and the error?
     
  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.