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

Config edit

Discussion in 'Development' started by Matrox, Aug 6, 2019.

  1. Matrox

    Matrox Slime

    Messages:
    92
    GitHub:
    MatroxMC
    I created my configuration thanks to this line:
    PHP:

    // @name player name

    new Config($this->plugin->data "$name.yml"Config::YAML, []);

    and I would like to know how to edit each player's file...

    And also how to save them
     
  2. DaRealPandaz

    DaRealPandaz Silverfish

    Messages:
    24
    GitHub:
    mrpandaz
    Try This:

    PHP:

    $config 
    = new Config($this->core->getDataFolder().strtolower($sender->getName()).".yml"Config::YAML);
    $config->set("data name here"your data here)

     
  3. Matrox

    Matrox Slime

    Messages:
    92
    GitHub:
    MatroxMC
    No work
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    What is in the property "$this->plugin->data"?
     
  5. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    You need $config->save() for it to save
     
  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.