Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Set an array in config?

Comments in 'Plugin Development' started by Legoboy0215, Aug 6, 2015.

Thread Status:
Not open for further replies.
  1. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    The title says it all. Also, how do I get something in a config?
    For example,
    Code:
    legoboy:
    - points: 100
    - kills:5
    
    And get the points number for the user legoboy.
  2. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    PHP:
    $legoboy = array(
    "kills" => 5
    "points" => 100
    );
    $this->getConfig()->set("legoboy",$legoboy);
    Maybe something like this
  3. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    and get it like:
    PHP:
    $legoboy $this->getConfig()->get("legoboy");
    $legoboy["kills"] = 0;
    $legoboy["points"] = 0;
  4. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Thanks!!!
    Khaled098 likes this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement