@@ -19,7 +19,7 @@ public sealed class BasicAdmin : BasePlugin, IPluginConfig<BasicAdminConfig>
1919{
2020 public override string ModuleName => "BasicAdmin" ;
2121 public override string ModuleAuthor => "livevilog" ;
22- public override string ModuleVersion => "1.5 .0" ;
22+ public override string ModuleVersion => "1.6 .0" ;
2323
2424 public BasicAdminConfig Config { get ; set ; } = new ( ) ;
2525
@@ -164,6 +164,12 @@ public void OnKickCommand(CCSPlayerController? caller, CommandInfo info)
164164
165165 target ? . Players . ForEach ( player =>
166166 {
167+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
168+ {
169+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
170+ return ;
171+ }
172+
167173 ServerUtils . KickPlayer ( player . UserId , reason ) ;
168174
169175 if ( ! Config . HideActivity )
@@ -178,6 +184,11 @@ public void OnSlayCommand(CCSPlayerController? caller, CommandInfo info)
178184 {
179185 GetTarget ( info ) ? . Players . ForEach ( player =>
180186 {
187+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
188+ {
189+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
190+ return ;
191+ }
181192 player . Pawn . Value ? . CommitSuicide ( false , true ) ;
182193
183194 if ( ! Config . HideActivity )
@@ -212,6 +223,11 @@ public void OnSwapCommand(CCSPlayerController? caller, CommandInfo info)
212223 var target = GetTarget ( info ) ;
213224 target ? . Players . ForEach ( player =>
214225 {
226+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
227+ {
228+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
229+ return ;
230+ }
215231 if ( ( int ) CsTeam . Spectator == player . TeamNum )
216232 {
217233 info . ReplyToCommand ( FormatMessage ( $ "Target { info . GetArg ( 1 ) } is a spectator.") ) ;
@@ -235,6 +251,11 @@ public void OnForceSpecCommand(CCSPlayerController? caller, CommandInfo info)
235251 var target = GetTarget ( info ) ;
236252 target ? . Players . ForEach ( player =>
237253 {
254+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
255+ {
256+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
257+ return ;
258+ }
238259 player . ChangeTeam ( CsTeam . Spectator ) ;
239260
240261 if ( ! Config . HideActivity )
@@ -250,6 +271,11 @@ public void OnRespawnCommand(CCSPlayerController? caller, CommandInfo info)
250271 var target = GetTarget ( info ) ;
251272 target ? . Players . ForEach ( player =>
252273 {
274+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
275+ {
276+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
277+ return ;
278+ }
253279 player . Respawn ( ) ;
254280
255281 if ( Config . HideActivity )
@@ -349,6 +375,12 @@ public void OnBuryCommand(CCSPlayerController? caller, CommandInfo info)
349375
350376 target ? . Players . ForEach ( player =>
351377 {
378+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
379+ {
380+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
381+ return ;
382+ }
383+
352384 player . Pawn . Value ? . Bury ( ) ;
353385
354386 if ( duration > 0 )
@@ -366,6 +398,12 @@ public void OnUnburyCommand(CCSPlayerController? caller, CommandInfo info)
366398 {
367399 GetTarget ( info ) ? . Players . ForEach ( player =>
368400 {
401+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
402+ {
403+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
404+ return ;
405+ }
406+
369407 player . Pawn . Value ? . Unbury ( ) ;
370408
371409 if ( ! Config . HideActivity )
@@ -380,6 +418,12 @@ public void OnDisarmCommand(CCSPlayerController? caller, CommandInfo info)
380418 {
381419 GetTarget ( info ) ? . Players . ForEach ( player =>
382420 {
421+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
422+ {
423+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
424+ return ;
425+ }
426+
383427 player . RemoveWeapons ( ) ;
384428
385429 if ( ! Config . HideActivity )
@@ -400,6 +444,12 @@ public void OnHealthCommand(CCSPlayerController? caller, CommandInfo info)
400444
401445 GetTarget ( info ) ? . Players . ForEach ( player =>
402446 {
447+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
448+ {
449+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
450+ return ;
451+ }
452+
403453 player . Pawn . Value ! . Health = health ;
404454
405455 if ( ! Config . HideActivity )
@@ -490,6 +540,11 @@ public void OnSlapCommand(CCSPlayerController? caller, CommandInfo info)
490540
491541 GetTarget ( info ) ? . Players . ForEach ( player =>
492542 {
543+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
544+ {
545+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
546+ return ;
547+ }
493548
494549 player . Pawn . Value ! . Slap ( damage ) ;
495550
@@ -513,6 +568,12 @@ public void OnFreezeCommand(CCSPlayerController? caller, CommandInfo info)
513568
514569 GetTarget ( info ) ? . Players . ForEach ( player =>
515570 {
571+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
572+ {
573+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
574+ return ;
575+ }
576+
516577 player . Pawn . Value ! . Freeze ( ) ;
517578
518579 AddTimer ( duration , ( ) => player . Pawn . Value ! . Unfreeze ( ) ) ;
@@ -529,6 +590,12 @@ public void OnUnfreezeCommand(CCSPlayerController? caller, CommandInfo info)
529590 {
530591 GetTarget ( info ) ? . Players . ForEach ( player =>
531592 {
593+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
594+ {
595+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
596+ return ;
597+ }
598+
532599 player . Pawn . Value ! . Unfreeze ( ) ;
533600
534601 if ( ! Config . HideActivity )
@@ -543,6 +610,12 @@ public void OnNoclipCommand(CCSPlayerController? caller, CommandInfo info)
543610 {
544611 GetTarget ( info ) ? . Players . ForEach ( player =>
545612 {
613+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
614+ {
615+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
616+ return ;
617+ }
618+
546619 player . Pawn . Value ! . ToggleNoclip ( ) ;
547620
548621 if ( ! Config . HideActivity )
@@ -557,6 +630,12 @@ public void OnGodmodeCommand(CCSPlayerController? caller, CommandInfo info)
557630 {
558631 GetTarget ( info ) ? . Players . ForEach ( player =>
559632 {
633+ if ( ! AdminManager . CanPlayerTarget ( caller , player ) )
634+ {
635+ info . ReplyToCommand ( FormatMessage ( "You can't target this player." ) ) ;
636+ return ;
637+ }
638+
560639 if ( ! ActiveGodMode . Remove ( player . Handle ) )
561640 {
562641 ActiveGodMode [ player . Handle ] = true ;
@@ -570,7 +649,7 @@ public void OnGodmodeCommand(CCSPlayerController? caller, CommandInfo info)
570649 [ ConsoleCommand ( "css_rcon" , "Run a server console command." ) ]
571650 [ CommandHelper ( 1 , "<command>" ) ]
572651 [ RequiresPermissions ( "@css/rcon" ) ]
573- public void OnRcomCommand ( CCSPlayerController ? caller , CommandInfo info )
652+ public void OnRconCommand ( CCSPlayerController ? caller , CommandInfo info )
574653 {
575654 info . ReplyToCommand ( $ "Command executed ({ info . ArgString } ).") ;
576655
0 commit comments