Hey there, I have a config.yml where I saved things like this: Code: test: true something: false Now I got this code and when I run the plugin it gives me something like true false: Code: foreach($this->cfg->getAll() as $w) { $this->getLogger()->info($w); } So I get the values of "test" and "something". But now I want to get the keys of every entry and not the value of them. How can I do that?
@PEMapModder Got a new problem now. I have this code inside a PluginTask: PHP: foreach($this->plugin->cfg->getAll() as $key => $w){ $key = explode("_", $key); $world = $key[0]; $map = $this->plugin->getServer()->getLevelByName($key[0]); if($w == true) { $this->plugin->getLogger()->info(TF::GREEN."True"); } else { $this->plugin->getLogger()->info(TF::GREEN."False"); }} I have keys like "world_day" with true or false as value. And then I get the text before the "_" and get the world with that name. I want to change the time in the world, when it's false as an example, but if the value is false it prints out "True" too. I don't know why the if-thing isn't working. So the problem is not that I don't know how to change the time. The problem is, that when $w is false it prints out "True".
@PEMapModder Gives out string(5) "false" and string(4) "true". I changed this: PHP: if($w == true) { to: PHP: if($w === "true") { and now it works! Thanks again!