For example.. there is two teams. the members of each teams see their teammates display name in green, and enemies in red. this happens for both teams. a spectator sees all in grey. how is this possible?
You should dig into https://github.com/BlockHorizons/FactionsPE it IS big and i couldnt manage to pin down where the code i found previously was but it's something about relation and explain to
Since you havent bothered to show any of your current code, dont ask me if you cant get this to work. Its just an idea. PHP: use pocketmine\Player;use pocketmine\utils\TextFormat;public function getColor(Player $him, Player $me): string { $hisTeam = $this->getPlayerInTeam($him); $myTeam = $this->getPlayerInTeam($me); // idk what the code is to get the team if($hisFaction === $myTeam) { return TextFormat::GREEN; } elseif($hisTeam === /* team */) { return TextFormat::RED; } elseif($hisTeam === /* team */) { return TextFormat::YELLOW; } else { return TextFormat::WHITE; // Not in a team }}
https://github.com/BlockHorizons/Fa...rc/factions/relation/RelationParticipator.php You must implement your own code into these functions, for example PHP: public function isFriend(RelationParticipator $rp): bool { if(!$rp instanceof GameParticipator) return false; return $rp->getTeam() === $this->getTeam();}