From 884b73ebe94673208bc35ce9d73cc46c68c93c62 Mon Sep 17 00:00:00 2001 From: h0mev Date: Mon, 5 Feb 2024 12:21:24 +0800 Subject: [PATCH 1/2] cvar sv_allchat 2 to set spectator text message visible dead only --- README.md | 2 +- regamedll/dlls/client.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 93cd795d2..1387cc1cf 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_team_flash | 1 | -1 | 1 | Sets the behaviour for Flashbangs on teammates.
`-1` Don't affect teammates neither flash owner
`0` Don't affect teammates
`1` Affects teammates | | mp_fadetoblack | 0 | 0 | 2 | Observer's screen will fade to black on kill event or permanent.
`0` No fade.
`1` Fade to black and won't be able to watch anybody.
`2` fade to black only on kill moment. | | mp_falldamage | 1 | 0 | 1 | Damage from falling.
`0` disabled
`1` enabled | -| sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply
`0` disabled
`1` enabled | +| sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply
`0` disabled
`1` enabled
`2` enabled, but only dead player can see spectator's message | | sv_autobunnyhopping | 0 | 0 | 1 | Players automatically re-jump while holding jump button.
`0` disabled
`1` enabled | | sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.
`0` disabled
`1` enabled | | mp_plant_c4_anywhere | 0 | 0 | 1 | When set, players can plant anywhere, not only in bombsites.
`0` disabled
`1` enabled | diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 2a58443d7..55de48983 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -984,6 +984,17 @@ void Host_Say(edict_t *pEntity, BOOL teamonly) continue; } + // when allchat is 2,only dead player can see spectator's message + if ( +#ifdef REGAMEDLL_ADD + allchat.value == 2.0f && +#endif + (pPlayer->m_iTeam == UNASSIGNED || pPlayer->m_iTeam == SPECTATOR) + ) { + if (pReceiver->pev->deadflag == DEAD_NO) + continue; + } + if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY && pReceiver->m_iTeam == pPlayer->m_iTeam) || pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_NONE) { From 89b3a1428265a597a129780f75e13662533c5b72 Mon Sep 17 00:00:00 2001 From: h0mev Date: Mon, 5 Feb 2024 12:24:27 +0800 Subject: [PATCH 2/2] Update game.cfg --- dist/game.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/game.cfg b/dist/game.cfg index 91009dd00..82ee94b5a 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -485,6 +485,7 @@ mp_team_flash "1" // Players can receive all other players text chat, team restrictions apply. // 0 - disabled (default behaviour) // 1 - enabled +// 2 - enabled, but only dead player can see spectator's message // // Default value: "0" sv_allchat "0" @@ -521,7 +522,7 @@ mp_give_c4_frags "3" // Default value: "1.0" mp_hostages_rescued_ratio "1.0" -// Legacy func_vehicle behavior when blocked by another entity. +// Legacy func_vehicle behavior when blocked by another entity. // New one is more useful for playing multiplayer. // // 0 - New behavior