This allows you to set and check whole groups flags. As it may not be obvious, this requires a custom file in your plugins folder.
Code:
sub CheckGroupFlag {
my $client = plugin::val('client');
my $flag = shift;
if ($client->GetGroup()) {
for ($i = 0; $i < 6; $i++) {
if ($client->GetGroup()->GetMember($i) && !$client->GetGroup()->GetMember($i)->HasZoneFlag($flag)) {
return 0;
}
}
} else {
if (!$client->HasZoneFlag($flag)) {
return 0;
}
}
return 1;
}
sub SetGroupFlag {
my $client = plugin::val('client');
my $flag = shift;
if ($client->GetGroup()) {
for ($i = 0; $i < 6; $i++) {
if ($client->GetGroup()->GetMember($i) && !$client->GetGroup()->GetMember($i)->HasZoneFlag($flag)) {
$client->GetGroup()->GetMember($i)->SetZoneFlag($flag);
}
}
} else {
if (!$client->HasZoneFlag($flag)) {
$client->SetZoneFlag($flag);
}
}
}
return 1;