if (player->GetZoneId() == NUMBER)
return false;
You could probably add a check in Group.cpp under Group::AddMember. Example:
I'd probably add the following code above this if statement: https://github.com/TrinityCore/TrinityCore/blob/master/src/server/game/Groups/Group.cpp#L368
Code:if (player->GetZoneId() == NUMBER) return false;
In addition to that, you would probably also want to remove them from their current group when they enter the desired zone.
SubGroupCounterIncrease(subGroup);
player->SetGroupInvite(NULL);
if (player->GetZoneId() == 33)
player->GetSession()->SendNotification("You aren't allowed to group up with anyone in this zone!");
return false;
if (player->GetGroup())
{
if (isBGGroup() || isBFGroup()) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid()
player->SetBattlegroundOrBattlefieldRaid(this, subGroup);
if (player->GetZoneId() == 33)
[COLOR="#00FF00"]{[/COLOR]
player->GetSession()->SendNotification("You aren't allowed to group up with anyone in this zone!");
return false;
[COLOR="#00FF00"]}[/COLOR]