From 418bee4990079d3a8e52829c2265c0f1efe8eebc Mon Sep 17 00:00:00 2001 From: snorux <34697265+snorux@users.noreply.github.com> Date: Sun, 27 Jul 2025 21:16:33 +0800 Subject: [PATCH] change @ to match csgo behaviour --- configs/admins.jsonc.example | 2 +- src/cs2fixes.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/configs/admins.jsonc.example b/configs/admins.jsonc.example index 3b4ba8235..54e5008e5 100644 --- a/configs/admins.jsonc.example +++ b/configs/admins.jsonc.example @@ -51,7 +51,7 @@ // // // If at least 1 group is added above, these are all optional fields. // "flags": "abcdefg", // Permission flags. Combines with any flags defined in user's groups - // "immunity": "1" // Non-negative value. Takes highest value from here or any of user's groups + // "immunity": 1 // Non-negative value. Takes highest value from here or any of user's groups //} } } \ No newline at end of file diff --git a/src/cs2fixes.cpp b/src/cs2fixes.cpp index d9637d0bb..88a8d1814 100644 --- a/src/cs2fixes.cpp +++ b/src/cs2fixes.cpp @@ -532,6 +532,7 @@ void CS2Fixes::Hook_DispatchConCommand(ConCommandRef cmdHandle, const CCommandCo auto pController = CCSPlayerController::FromSlot(iCommandPlayerSlot); bool bGagged = pController && pController->GetZEPlayer()->IsGagged(); bool bFlooding = pController && pController->GetZEPlayer()->IsFlooding(); + bool bIsAdmin = pController && pController->GetZEPlayer()->IsAdminFlagSet(ADMFLAG_GENERIC); bool bAdminChat = bTeamSay && *args[1] == '@'; bool bSilent = *args[1] == '/' || bAdminChat; bool bCommand = *args[1] == '!' || *args[1] == '/'; @@ -575,10 +576,8 @@ void CS2Fixes::Hook_DispatchConCommand(ConCommandRef cmdHandle, const CCommandCo if (!pPlayer) continue; - if (pPlayer->IsAdminFlagSet(ADMFLAG_GENERIC)) - ClientPrint(CCSPlayerController::FromSlot(i), HUD_PRINTTALK, " \4(ADMINS) %s:\1 %s", pController->GetPlayerName(), pszMessage); - else if (i == iCommandPlayerSlot.Get()) // Sender is not an admin - ClientPrint(pController, HUD_PRINTTALK, " \4(TO ADMINS) %s:\1 %s", pController->GetPlayerName(), pszMessage); + if (i == iCommandPlayerSlot.Get() || pPlayer->IsAdminFlagSet(ADMFLAG_GENERIC)) + ClientPrint(CCSPlayerController::FromSlot(i), HUD_PRINTTALK, " \4(%sADMINS) %s:\6 %s", bIsAdmin ? "" : "TO ", pController->GetPlayerName(), pszMessage); } }