Help with Config

Discussion in 'Plugin Development' started by MrGermanrain, Dec 7, 2013.

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

    MrGermanrain

    So I was wondering if this would work:

    Config:
    Code:
    Elections:
    Code:
    Code:java
    1. this.getConfig().set("Elections", args[1] + " Time:");
    2. this.getConfig().set("Elections." + args[1] + ".Time", args[2]);


    fyi:
    (args[1] == name)
    (args[2] == time)



    Would be cool but I doubt it :/ give me what you think please :)

    How would it end up in the config?
     
  2. Offline

    samosaara

    Nice idea... I see no problem on it... I think it would work fine... Except... You have to check If it exists before set... Far as I know, creating an already existent key would mess things up... Something like:
    Code:java
    1. if (this.getConfig().get("Elections." + args[1] + ".Time") != null)
    2. this.getConfig().set("Elections." + args[1] + ".Time");
     
Thread Status:
Not open for further replies.

Share This Page