11using CounterStrikeSharp . API ;
22using CounterStrikeSharp . API . Core ;
33using CounterStrikeSharp . API . Modules . Admin ;
4+ using CounterStrikeSharp . API . Modules . Entities . Constants ;
45using CustomCommands . Model ;
56
67namespace CustomCommands ;
@@ -37,7 +38,7 @@ private void AddCommands(Commands com)
3738 AddCommand ( aliases [ i ] , com . Description , ( player , info ) =>
3839 {
3940 if ( player == null ) return ;
40- if ( ! RequiresPermissions ( player , com . Permissions ) )
41+ if ( ! RequiresPermissions ( player , com . Permission ) )
4142 return ;
4243
4344 TriggerMessage ( player , com ) ;
@@ -46,23 +47,23 @@ private void AddCommands(Commands com)
4647 }
4748 }
4849
49- private bool RequiresPermissions ( CCSPlayerController player , PermissionsElement permissions )
50+ private bool RequiresPermissions ( CCSPlayerController player , Permission permissions )
5051 {
51- if ( permissions . ReguiresAllPermissions )
52+ if ( ! permissions . ReguiresAllPermissions )
5253 {
5354 foreach ( var permission in permissions . PermissionList )
5455 {
5556 if ( AdminManager . PlayerHasPermissions ( player , new string [ ] { permission } ) )
5657 return true ;
5758 }
58- PrintToChat ( Receiver . Client , player , "You don't have the required permissions to execute this command1 " ) ;
59+ PrintToChat ( Receiver . Client , player , "You don't have the required permissions to execute this command " ) ;
5960 return false ;
6061 }
6162 else
6263 {
6364 if ( ! AdminManager . PlayerHasPermissions ( player , permissions . PermissionList . ToArray ( ) ) )
6465 {
65- PrintToChat ( Receiver . Client , player , "You don't have the required permissions to execute this command2 " ) ;
66+ PrintToChat ( Receiver . Client , player , "You don't have the required permissions to execute this command " ) ;
6667 return false ;
6768 }
6869 return true ;
0 commit comments