Skip to content

Commit 418bee4

Browse files
committed
change @<msg> to match csgo behaviour
1 parent e1a7aeb commit 418bee4

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

configs/admins.jsonc.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
//
5252
// // If at least 1 group is added above, these are all optional fields.
5353
// "flags": "abcdefg", // Permission flags. Combines with any flags defined in user's groups
54-
// "immunity": "1" // Non-negative value. Takes highest value from here or any of user's groups
54+
// "immunity": 1 // Non-negative value. Takes highest value from here or any of user's groups
5555
//}
5656
}
5757
}

src/cs2fixes.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ void CS2Fixes::Hook_DispatchConCommand(ConCommandRef cmdHandle, const CCommandCo
532532
auto pController = CCSPlayerController::FromSlot(iCommandPlayerSlot);
533533
bool bGagged = pController && pController->GetZEPlayer()->IsGagged();
534534
bool bFlooding = pController && pController->GetZEPlayer()->IsFlooding();
535+
bool bIsAdmin = pController && pController->GetZEPlayer()->IsAdminFlagSet(ADMFLAG_GENERIC);
535536
bool bAdminChat = bTeamSay && *args[1] == '@';
536537
bool bSilent = *args[1] == '/' || bAdminChat;
537538
bool bCommand = *args[1] == '!' || *args[1] == '/';
@@ -575,10 +576,8 @@ void CS2Fixes::Hook_DispatchConCommand(ConCommandRef cmdHandle, const CCommandCo
575576
if (!pPlayer)
576577
continue;
577578

578-
if (pPlayer->IsAdminFlagSet(ADMFLAG_GENERIC))
579-
ClientPrint(CCSPlayerController::FromSlot(i), HUD_PRINTTALK, " \4(ADMINS) %s:\1 %s", pController->GetPlayerName(), pszMessage);
580-
else if (i == iCommandPlayerSlot.Get()) // Sender is not an admin
581-
ClientPrint(pController, HUD_PRINTTALK, " \4(TO ADMINS) %s:\1 %s", pController->GetPlayerName(), pszMessage);
579+
if (i == iCommandPlayerSlot.Get() || pPlayer->IsAdminFlagSet(ADMFLAG_GENERIC))
580+
ClientPrint(CCSPlayerController::FromSlot(i), HUD_PRINTTALK, " \4(%sADMINS) %s:\6 %s", bIsAdmin ? "" : "TO ", pController->GetPlayerName(), pszMessage);
582581
}
583582
}
584583

0 commit comments

Comments
 (0)