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

make edit of .yaml

Discussion in 'Development' started by Hoyee, Mar 13, 2020.

  1. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    I want to make like
    Code:
    blue : playername, playername2 ...
    
    but it changes to
    Code:
    A: player
    player: player's name
    here is code
    Code:
      @mkdir ($this->getDataFolder());
          $this->database = new Config ($this->getDataFolder()."data.yml",Config::YAML,[
              "A" => "player"
          ]);
          $this->db = $this->database->getAll();
    Code:
    case "TA"
    if(isset($args[1])){
    
                  $this->db["player"]="$args[1]";
                  $this->database->setAll($this->db);
    $this->database->save();
    
                }
    And if I add a player's name, the existing player's name disappears. How do I make it possible for many people to exist in A: ?
     
  2. Gianluxx

    Gianluxx Slime

    Messages:
    94
    GitHub:
    Gianluxx
    arrays.
    $this->db["blue"] = ["player1", "player2"];
     
  3. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    Is = use by : ?
     
  4. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    How can I get Player that is in "A"?
     
  5. Gianluxx

    Gianluxx Slime

    Messages:
    94
    GitHub:
    Gianluxx
    $player = $this->db["A"];
     
  6. Gianluxx

    Gianluxx Slime

    Messages:
    94
    GitHub:
    Gianluxx
    $this->db["blue"] = ["player1", "player2"];
    //set an array in "blue"



    $arrayofplayers = $this->db["blue"];
    //read the array in "blue"
     
  7. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    Can I use any other thing that I want instead of using database?

    and is db means database?
     
  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.