I have created a dictionary named Teams and I use a struct to make hold an integer, a string and a boolean.
So if anyone joins a red team, the bool will be false to prevent other players from joining same team.
I tried to set the boolean to false but it failed.
public Dictionary <int , myCustomType> Teams = new Dictionary<int,myCustomType>();
private ExitGames.Client.Photon.Hashtable m_PlayerCustomPropeties = new ExitGames.Client.Photon.Hashtable();
private void addTeams() 
{
    myCustomType t=new myCustomType();
    t.name="Yellow"; 
    t.flag= true;
    Teams.Add(1,t);
    t.name="Red"; 
    t.flag= true;
    Teams.Add(2,t);
    t.name="Blue"; 
    t.flag= true;
    Teams.Add(3,t);
    t.name="Green"; 
    t.flag= true;
    Teams.Add(4,t);
    Debug.Log("Teams created.");
}
public void getPlayers() 
{
    Debug.Log(Teams[1].flag);
    Teams[1] = new myCustomType { flag = false };
}
 
     
    