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

Help with saving coords.

Comments in 'Plugin Development' started by luca28pet, Sep 5, 2014.

  1. luca28pet
    Offline

    luca28pet Active Member

    Joined:
    Feb 20, 2014
    Posts:
    251
    Minecraft User:
    luca28pet
    Hi coders, I am making an area-protection plugin, and, I am not sure of a thing that I've done in the config.
    So the conf. format looks like this:

    areas:
    -areaname
    --x: 1
    --y: 2
    --z: 3
    --x2: 4
    --y2: 5
    --z2: 6
    --owner: PlayerName
    --level: world

    -areaname2
    -- and so on..

    So, I'm ok with this, I know that there would be some more efficient way to save the areas, but for now I'd like just to make this works.
    My problem is how to read it.
    I've done something like this:
    PHP:
    foreach($this->config->get('areas') as $a){
      
    $a['owner'//it should get the owner
    }
    Would this work or there's something wrong? I have a big doubt about that, can anybody help? Thanks in advice.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Why don't you test with var_dump() if you are not sure? (and yes it is correct, but the YAML is wrong)
    LDX and luca28pet like this.
  3. luca28pet
    Offline

    luca28pet Active Member

    Joined:
    Feb 20, 2014
    Posts:
    251
    Minecraft User:
    luca28pet
    Thanks, I didn't know var_dump() function.
    What do you mean "the YAML is wrong"?
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It should not be --
  5. luca28pet
    Offline

    luca28pet Active Member

    Joined:
    Feb 20, 2014
    Posts:
    251
    Minecraft User:
    luca28pet
    Ah ok, will change.
  6. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,434
    Plugins:
    14
    Code:
    areas:
      areaname:
        x: 1
        y: 2
        z: 3
        x2: 4
        y2: 5
        z2: 6
        owner: PlayerName
        level: world
    luca28pet, PEMapModder and Adaasi like this.

Share This Page

Advertisement