Skip to content

Commit 685bebf

Browse files
small syntax change to SetGroupMethod.cs
1 parent 524f2f3 commit 685bebf

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

MethodSystem/Methods/PlayerMethods/SetGroupMethod.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,25 @@ public class SetGroupMethod : SynchronousMethod
1010
{
1111
public override string Description => "Sets or removes group from specified players";
1212

13-
public override Argument[] ExpectedArguments => [
13+
public override Argument[] ExpectedArguments =>
14+
[
1415
new PlayersArgument("players"),
15-
new TextArgument("group"){Description = "Name of the group or set to NONE if you want to remove group from specified players" }
16+
new TextArgument("group")
17+
{
18+
Description = "Name of the group or set to NONE if you want to remove group from specified players"
19+
}
1620
];
1721

1822
public override void Execute()
1923
{
20-
string gr = Args.GetText("group");
21-
List<Player> pls = Args.GetPlayers("players");
22-
foreach(Player p in pls)
24+
string group = Args.GetText("group");
25+
List<Player> players = Args.GetPlayers("players");
26+
27+
foreach (Player plr in players)
2328
{
24-
p.UserGroup = gr == "NONE" ? null : ServerStatic.PermissionsHandler.GetGroup(gr);
29+
plr.UserGroup = group == "NONE"
30+
? null
31+
: ServerStatic.PermissionsHandler.GetGroup(group);
2532
}
2633
}
2734
}

0 commit comments

Comments
 (0)