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

Editi plugin

Discussion in 'Plugin Help' started by dragonflex, Jan 31, 2017.

  1. dragonflex

    dragonflex Spider Jockey

    Messages:
    44
    Hi! I need your help on plugin. Well, my plugin it's not complet.
    PHP:
    if($this->config->get("Level of tag display") == "on"){
    $player->setNameTag("[§a".$this->kill->get($user)."§f]".$user2);
    $player->save();
    }
    if(
    $this->config->get("Level of display display") == "on"){
    $player->setDisplayName("[§a".$this->kill->get($user)."§f]".$user2);
    $player->save();
    How set this code before faction name[/PhP]
     

    Attached Files:

    Last edited: Jan 31, 2017
  2. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    Holla/Salut/Bonjour!

    1) My Suggestion:
    You could use array lines (not sure if I call it correct):
    Example Code:
    PHP:
    public $enable;

    Command execution:
    if(isset(
    $this->enable[strtolower($sender->getName())])) {
        unset(
    $this->enable[strtolower($sender->getName())]);
       
    ## your code
        
    $sender->sendMessage("You have disabled!");
    }
    else {
            
    # if the player has to turn thus on
           
    $this->enable[strtolower($sender->getName())] = $sender->getName();
          
    # Your code
           
    $sender->sendMessage("Enabled");
    }
     
    Last edited: Jan 31, 2017
  3. Dog2puppy

    Dog2puppy Slime

    Messages:
    94
    GitHub:
    colesquared
    Please use the code blocks feature. ([PHP.] BBCode)
     
    Last edited: Jan 31, 2017
    InspectorGadget likes this.
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    more explanation?
     
  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.