File tree Expand file tree Collapse file tree
Code/MethodSystem/Methods/PlayerMethods Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using JetBrains . Annotations ;
2+ using LabApi . Features . Permissions ;
3+ using SER . Code . ArgumentSystem . Arguments ;
4+ using SER . Code . ArgumentSystem . BaseArguments ;
5+ using SER . Code . MethodSystem . BaseMethods . Synchronous ;
6+ using SER . Code . ValueSystem ;
7+
8+ namespace SER . Code . MethodSystem . Methods . PlayerMethods ;
9+
10+ [ UsedImplicitly ]
11+ public class HasPermissionMethod : ReturningMethod < BoolValue >
12+ {
13+ public override string Description => "Checks if a player has a specific permission." ;
14+
15+ public override Argument [ ] ExpectedArguments { get ; } =
16+ [
17+ new PlayerArgument ( "player" ) ,
18+ new TextArgument ( "permissions" )
19+ {
20+ ConsumesRemainingValues = true ,
21+ Description = "'true' is returned when player has any of the provided permissions"
22+ }
23+ ] ;
24+
25+ public override void Execute ( )
26+ {
27+ ReturnValue = Args
28+ . GetPlayer ( "player" )
29+ . HasAnyPermission ( Args . GetRemainingArguments < string , TextArgument > ( "permissions" ) ) ;
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments