Made slap menu

This commit is contained in:
Valentin Barat
2024-01-31 17:29:28 +01:00
parent 65b33c17ea
commit f622701f5e
2 changed files with 83 additions and 57 deletions

View File

@@ -1486,17 +1486,22 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
{
if (caller!.CanTarget(player))
{
player!.Pawn.Value!.Slap(damage);
StringBuilder sb = new(_localizer!["sa_prefix"]);
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
{
sb.Append(_localizer["sa_admin_slap_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName]);
Server.PrintToChatAll(sb.ToString());
}
Slap(caller, player, damage);
}
});
}
public void Slap(CCSPlayerController? caller, CCSPlayerController player, int damage)
{
player.Pawn.Value!.Slap(damage);
StringBuilder sb = new(_localizer!["sa_prefix"]);
if (caller == null || caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
{
sb.Append(_localizer["sa_admin_slap_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName]);
Server.PrintToChatAll(sb.ToString());
}
}
[ConsoleCommand("css_team")]
[RequiresPermissions("@css/kick")]