I have a config were I save players in groups. How can I check If every online player is in the same group? My code example: Config: Code: group1: - Steve - Steve1 group2: [] The Code: PHP: Task start...If(/*all players in same group*/) {//do...}
I tried this: PHP: $groups = array("G1", "G2"); foreach($groups as $sgroup) {$group = $conf->get($this->owner->getServer()->getMotd() . $sgroup);$names = $conf->get("players");$tmp = 0; foreach($names as $name) { if(($key = array_search($name, $group) !== false)) { $tmp++; $this->plugin->getLogger()->error(array_search($name, $group)); } } } Error: Code: array_search() expects parameter 2 to be array, boolean giveN