├── .gitignore ├── README.md ├── ServerGraphic.cs └── ServerGraphic.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | *.sln -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Works kinda alike `sv_server_graphic1` but a little bit higher, displays image in hint message to every spectating player. 2 | Optimal image size `~870px x ~350px` 3 | 4 | ## Config 5 | Located in: `/configs/plugins/ServerGraphic/` 6 | ```c# 7 | { 8 | "Image": "LINK_TO_YOUR_IMAGE", 9 | "ConfigVersion": 1 10 | } 11 | ``` 12 | -------------------------------------------------------------------------------- /ServerGraphic.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using CounterStrikeSharp.API; 3 | using CounterStrikeSharp.API.Core; 4 | 5 | namespace ServerGraphic; 6 | 7 | public class ServerGraphicConfig : BasePluginConfig 8 | { 9 | [JsonPropertyName("Image")] 10 | public string Image { get; set; } = "LINKTOIMAGE"; 11 | } 12 | 13 | public class ServerGraphic : BasePlugin, IPluginConfig 14 | { 15 | public override string ModuleName => "ServerGraphic"; 16 | public override string ModuleVersion => "1.0.2"; 17 | public override string ModuleAuthor => "unfortunate"; 18 | 19 | public ServerGraphicConfig Config { get; set; } = new(); 20 | 21 | public void OnConfigParsed(ServerGraphicConfig config) 22 | { 23 | Config = config; 24 | RegisterListener(() => 25 | { 26 | foreach (var player in Utilities.GetPlayers()) 27 | { 28 | if (!IsPlayerValid(player)) 29 | continue; 30 | 31 | if (player.PawnIsAlive) 32 | continue; 33 | 34 | player.PrintToCenterHtml($""); 35 | } 36 | }); 37 | } 38 | 39 | #region Helpers 40 | public static bool IsPlayerValid(CCSPlayerController? player) 41 | { 42 | return player != null 43 | && player.IsValid 44 | && !player.IsBot 45 | && player.Pawn != null 46 | && player.Pawn.IsValid 47 | && player.Connected == PlayerConnectedState.PlayerConnected 48 | && !player.IsHLTV; 49 | } 50 | #endregion 51 | } 52 | -------------------------------------------------------------------------------- /ServerGraphic.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | --------------------------------------------------------------------------------