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

Solved Tag with PurePerms

Discussion in 'Development' started by ToddyWars, Feb 5, 2019.

  1. ToddyWars

    ToddyWars Spider Jockey

    Messages:
    30
    GitHub:
    ToddyWars
    How can I get the tag name of a group?
    Code:
    #Here it takes the name of the group
    
    $rank = $this->api->getUserDataMgr()->getGroup($p)->getName();
    
    #But how do I get the tag from this group?
    
    #example: group is "Owner" Tag is "§7[§6Owner§7]"
    
     
  2. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    PHP:

    /** @var PureChat $pc */
    /** @var Player $player */
    $pc $this->getServer()->getPluginManager()->getPlugin("PureChat");
    $tag $pc->getSuffix($player);
    //or
    $tag $pc->getPrefix($player);
     
    ToddyWars likes this.
  3. ToddyWars

    ToddyWars Spider Jockey

    Messages:
    30
    GitHub:
    ToddyWars
    Code:
    public function onEnable{
    $pc = $this->getServer()->getPluginManager()->getPlugin("PureChat");
    }
    public function onJoin(PlayerJoinEvent $event){
    $player = $event->getPlayer();
    $tag = $pc->getPrefix($player); //LINE 47
    }
     
  4. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    learn OOP, please, just learn OOP.

    anyways:
    PHP:

    public $pc;

    public function 
    onEnable(){
        
    $this->pc $this->getServer()->getPluginManager()->getPlugin("PureChat");
    }

    public function 
    onJoin(PlayerJoinEvent $ev): void{
        
    $player $ev->getPlayer();
        
    $this->pc->getPrefix($player);
    }
     
    ToddyWars likes this.
  5. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    :facepalm: no need to learn oop just to post here(offtopic kinda)
     
  6. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    i didn't say he shouldn't post here just because he needed help, I suggested him to learn OOP so he does not make posts similar to this again
     
  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.