- `css_hide` - Hide on scoreboard
Code stolen from https://github.com/DeadSwimek/cs2-hideadmin
Thanks DeadSwimek ;]
This commit is contained in:
Dawid Bepierszcz
2024-01-17 23:21:37 +01:00
parent 38020e6509
commit 99ce2cdf6a
2 changed files with 16 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
public override string ModuleName => "CS2-SimpleAdmin";
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
public override string ModuleAuthor => "daffyy";
public override string ModuleVersion => "1.2.7b";
public override string ModuleVersion => "1.2.7c";
public CS2_SimpleAdminConfig Config { get; set; } = new();
@@ -277,6 +277,20 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
}
}
[ConsoleCommand("css_hide")]
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
[RequiresPermissions("@css/kick")]
public void OnHideCommand(CCSPlayerController? caller, CommandInfo command)
{
if (caller == null) return;
caller.PlayerPawn.Value!.CommitSuicide(true, false);
caller.ChangeTeam(CsTeam.Spectator);
AddTimer(1.0f, () => { caller.ChangeTeam(CsTeam.None); });
command.ReplyToCommand("You are hidden now");
}
[ConsoleCommand("css_who")]
[CommandHelper(minArgs: 1, usage: "<#userid or name>", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
[RequiresPermissions("@css/generic")]

View File

@@ -13,6 +13,7 @@ Manage your Counter-Strike 2 server by simple commands :)
- css_deladmin <steamid> - Delete admin by steamid // @css/root
- css_reladmin - Reload sql admins // @css/root
- css_silentmode - Enable or disable silentmode for admins // @css/kick
- css_hide - Hide admin on scoreboard // @css/kick
- css_admin - Display all admin commands // @css/generic
- css_who <#userid or name> - Display informations about player // @css/generic
- css_players - Display player list // @css/generic