File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
MethodSystem/Methods/PlayerMethods Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using SER . ArgumentSystem . Arguments ;
3+ using SER . ArgumentSystem . BaseArguments ;
4+ using SER . MethodSystem . BaseMethods ;
5+ using LabApi . Features . Wrappers ;
6+
7+ namespace SER . MethodSystem . Methods . PlayerMethods ;
8+
9+ public class SetGroupMethod : SynchronousMethod
10+ {
11+ public override string Description => "Sets or removes group from specified players" ;
12+
13+ public override Argument [ ] ExpectedArguments => [
14+ 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+ ] ;
17+
18+ public override void Execute ( )
19+ {
20+ string gr = Args . GetText ( "group" ) ;
21+ List < Player > pls = Args . GetPlayers ( "players" ) ;
22+ foreach ( Player p in pls )
23+ {
24+ p . UserGroup = gr == "NONE" ? null : ServerStatic . PermissionsHandler . GetGroup ( gr ) ;
25+ }
26+ }
27+ }
Original file line number Diff line number Diff line change 209209 <Compile Include =" MethodSystem\Methods\PlayerMethods\SetCustomInfoMethod.cs" />
210210 <Compile Include =" MethodSystem\Methods\PlayerMethods\GodModeMethod.cs" />
211211 <Compile Include =" MethodSystem\Methods\PlayerMethods\NoclipMethod.cs" />
212+ <Compile Include =" MethodSystem\Methods\PlayerMethods\SetGroupMethod.cs" />
212213 <Compile Include =" MethodSystem\Methods\PlayerMethods\SetSizeMethod.cs" />
213214 <Compile Include =" MethodSystem\Methods\PlayerVariableMethods\ContainsPlayerMethod.cs" />
214215 <Compile Include =" MethodSystem\Methods\PlayerVariableMethods\GetPlayerFromReferenceMethod.cs" />
You can’t perform that action at this time.
0 commit comments