v1.2.4: оставлен только PrintHintText, убран неработающий MOTD/CenterText

- Удалены ShowMOTDPanel и PrintCenterText (не показывались на CSGO/MyArena)
- Удалены Timer_RepeatOverlay, GetRoundUrlSlug, CR_MOTD_BASE_URL
- Уведомление о режиме теперь только через PrintHintText
This commit is contained in:
deidara
2026-05-01 18:01:36 +03:00
parent 13958f1e33
commit f047cf7667
2 changed files with 11 additions and 83 deletions
+3 -71
View File
@@ -9,8 +9,6 @@
#define CR_PREFIX "\x04[ArcaneGame CR]\x01"
#define CR_REASON_MAX 128
#define CR_LOG_FILE "logs/custom_rounds.log"
#define CR_MOTD_BASE_URL "http://37.228.88.57/cr/"
#define MAX_SAVED_GRENADES 6
enum CustomRoundType
@@ -33,7 +31,7 @@ public Plugin myinfo =
name = "ArcaneGame Custom Rounds Core",
author = "deidara.dev",
description = "Core plugin for custom rounds with AG Coin integration",
version = "1.2.3",
version = "1.2.4",
url = "https://deidara.dev"
};
@@ -111,7 +109,7 @@ public void OnPluginStart()
gCvarLowGravityValue = CreateConVar("sm_cr_lowgravity_value", "0.40", "Gravity value for Low Gravity round.", FCVAR_NONE, true, 0.1, true, 1.0);
gCvarOneHPValue = CreateConVar("sm_cr_onehp_value", "1", "Health value for One HP round.", FCVAR_NONE, true, 1.0, true, 100.0);
gCvarAnnounce = CreateConVar("sm_cr_announce", "1", "Show chat messages about custom rounds.", FCVAR_NONE, true, 0.0, true, 1.0);
gCvarShowMOTD = CreateConVar("sm_cr_show_motd", "1", "Show MOTD image during freezetime when a custom round starts.", FCVAR_NONE, true, 0.0, true, 1.0);
gCvarShowMOTD = CreateConVar("sm_cr_show_motd", "1", "Show on-screen overlay (PrintHintText) when a custom round starts.", FCVAR_NONE, true, 0.0, true, 1.0);
gCvarCooldownRounds = CreateConVar("sm_cr_cooldown_rounds", "5", "Cooldown in rounds for regular admins between custom rounds. DEIDARA/TESTER and ROOT bypass.", FCVAR_NONE, true, 0.0);
gCvarInfiniteAmmo = FindConVar("sv_infinite_ammo");
@@ -1196,39 +1194,12 @@ void GetRoundDisplayName(CustomRoundType roundType, char[] buffer, int maxlen)
}
}
void GetRoundUrlSlug(CustomRoundType roundType, char[] buffer, int maxlen)
{
switch (roundType)
{
case CR_AWP: strcopy(buffer, maxlen, "awp");
case CR_NoScope: strcopy(buffer, maxlen, "awp-noscope");
case CR_HE: strcopy(buffer, maxlen, "he");
case CR_Knife: strcopy(buffer, maxlen, "knife");
case CR_Scout: strcopy(buffer, maxlen, "scout");
case CR_ScoutNoScope: strcopy(buffer, maxlen, "scout-noscope");
case CR_Deagle: strcopy(buffer, maxlen, "deagle");
case CR_DeagleHS: strcopy(buffer, maxlen, "deagle-hs");
case CR_LowGravity: strcopy(buffer, maxlen, "lowgrav");
case CR_OneHP: strcopy(buffer, maxlen, "onehp");
default: strcopy(buffer, maxlen, "");
}
}
void ShowFreezeImageToAll(CustomRoundType mode)
{
char title[64], description[128];
GetRoundDisplayName(mode, title, sizeof(title));
GetRoundDescription(mode, description, sizeof(description));
char slug[32];
GetRoundUrlSlug(mode, slug, sizeof(slug));
char url[256];
if (slug[0] != '\0')
{
Format(url, sizeof(url), "%s%s.html", CR_MOTD_BASE_URL, slug);
}
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || IsFakeClient(i))
@@ -1236,48 +1207,9 @@ void ShowFreezeImageToAll(CustomRoundType mode)
continue;
}
// 1) MOTD URL — для тех у кого включён HTML MOTD на клиенте
if (slug[0] != '\0')
{
ShowMOTDPanel(i, title, url, MOTDPANEL_TYPE_URL);
}
// 2) PrintHintText — уведомление в правом нижнем углу со звуком
// PrintHintText — большое уведомление в правом нижнем углу со звуком
PrintHintText(i, "★ КАСТОМНЫЙ РАУНД ★\n%s\n\n%s", title, description);
// 3) PrintCenterText — большой текст в центре экрана (первый показ)
PrintCenterText(i, "★ %s ★\n%s", title, description);
}
// Повторяем PrintCenterText на 2-й, 4-й, 6-й секундах чтобы держать сообщение видимым
// на протяжении freezetime (в CSGO он обычно 6-15 сек)
CreateTimer(2.0, Timer_RepeatOverlay, view_as<int>(mode), TIMER_FLAG_NO_MAPCHANGE);
CreateTimer(4.0, Timer_RepeatOverlay, view_as<int>(mode), TIMER_FLAG_NO_MAPCHANGE);
CreateTimer(6.0, Timer_RepeatOverlay, view_as<int>(mode), TIMER_FLAG_NO_MAPCHANGE);
}
public Action Timer_RepeatOverlay(Handle timer, any modeRaw)
{
CustomRoundType mode = view_as<CustomRoundType>(modeRaw);
if (mode != g_CurrentRound)
{
return Plugin_Stop;
}
char title[64], description[128];
GetRoundDisplayName(mode, title, sizeof(title));
GetRoundDescription(mode, description, sizeof(description));
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || IsFakeClient(i))
{
continue;
}
PrintCenterText(i, "★ %s ★\n%s", title, description);
}
return Plugin_Stop;
}
void GetRoundDescription(CustomRoundType roundType, char[] buffer, int maxlen)