Cvar sv_allchat 2 to set spectator text message visible dead only (#17)

This commit is contained in:
Eason 2024-08-04 16:44:21 +08:00 committed by GitHub
parent 9d9c2de1ff
commit 1bd2c55ce4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

@ -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.<br/>`-1` Don't affect teammates neither flash owner <br/>`0` Don't affect teammates <br/>`1` Affects teammates |
| mp_fadetoblack | 0 | 0 | 2 | Observer's screen will fade to black on kill event or permanent.<br/> `0` No fade.<br/>`1` Fade to black and won't be able to watch anybody.<br/>`2` fade to black only on kill moment. |
| mp_falldamage | 1 | 0 | 1 | Damage from falling.<br/>`0` disabled <br/>`1` enabled |
| sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply<br/>`0` disabled <br/>`1` enabled |
| sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply<br/>`0` disabled <br/>`1` enabled <br/> `2` enabled, but only dead player can see spectator's message |
| sv_autobunnyhopping | 0 | 0 | 1 | Players automatically re-jump while holding jump button.<br/>`0` disabled <br/>`1` enabled |
| sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.<br/>`0` disabled <br/>`1` enabled |
| mp_plant_c4_anywhere | 0 | 0 | 1 | When set, players can plant anywhere, not only in bombsites.<br/>`0` disabled <br/>`1` enabled |

1
dist/game.cfg vendored
View File

@ -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'smessage
//
// Default value: "0"
sv_allchat "0"

View File

@ -1010,6 +1010,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)
{