First commit

This commit is contained in:
2026-07-07 16:36:30 +02:00
commit b0669c4f4d
9 changed files with 545 additions and 0 deletions

53
utils/info.cs Normal file
View File

@@ -0,0 +1,53 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Menu;
namespace Porning;
class Info
{
private string message = "";
private BasePlugin plugin = null!;
private CenterHtmlMenu? menu = null;
private Action? callback = null;
public Info(BasePlugin plugin, string message)
{
this.plugin = plugin;
this.message = $"<font color=\"red\">Porning</font><br>{message}";
}
public void Show(CCSPlayerController? player=null)
{
menu = new CenterHtmlMenu(message, plugin)
{
ExitButton = false
};
if (player !=null)
{
MenuManager.OpenCenterHtmlMenu(plugin, player, menu);
} else
{
foreach (CCSPlayerController p in Utilities.GetPlayers())
{
MenuManager.OpenCenterHtmlMenu(plugin, p, menu);
}
}
plugin.AddTimer(5.0f, Close);
}
public void Close()
{
foreach (CCSPlayerController player in Utilities.GetPlayers())
{
MenuManager.CloseActiveMenu(player);
}
callback?.Invoke();
}
public void OnClose(Action callback)
{
this.callback = callback;
}
}