The title said all :3 Example: if a player in array $vanish and $nick. It will show a repeating popup
it doesnt work PHP: }elseif(in_array($name, $this->plugin->nickpopup) && in_array($name, $this->plugin->vanishpopup) && $player->getLevel()->getName() === "world"){ $player->sendPopup("You are currently§c VANISHED, NICKED");
I think operator replace && to || because the first in_array can return you true and the second one false and if (true && false) the problem here. it can not be checked because your condition can't check. Your array he need returned to true. It is necessary to put operator || to find out if one of your array contains the index he return you true.
He's asking how to check if a player is in both arrays, so it wouldn't make sense using || statement. If the code returns false it's because the player is not in the two arrays. Also remember that elseif will only be executed if the past if returns false. PHP: $name = "diduhless";if($name === "diduhless") { // returns true} elseif($name === "zackyvn") { // this won't be executed as the first if doesn't return false}if($name === "zackyvn") { // returns false} elseif($name === "diduhless") { // this will be executed}
Ohh i don't understand OP lol He want to check two array oh okay. I think he want check if one of two array content the index can be passed.