ISource2ModVoice
Who hears whom in voice chat.
A player's flags say how they speak and listen; an override decides one receiver and one sender. Each plugin keeps its own, the core combines them (a mute wins) and drops a plugin's when it unloads, and a player's when they leave. A mute the player made themselves (the scoreboard) always holds.
In order, the first that applies decides:
- the receiver muted the sender themselves: not heard;
- the sender has Source2ModVoice_Muted: not heard;
- an override: Mute is not heard, Hear is heard;
- the sender has _All or the receiver _ListenAll: heard;
- the sender has _Team or the receiver _ListenTeam: heard within the team;
- what the game decided.
g_pSource2ModVoice->SetVoiceFlags(slot, Source2ModVoice_Muted);
g_pSource2ModVoice->SetListenOverride(warden, prisoner, Source2ModListen::Hear);Interface id ISource2ModVoice001 (SOURCE2MOD_VOICE_INTERFACE) · Global g_pSource2ModVoice · Header source2mod/ISource2ModVoice.h
Methods
SetVoiceFlags
virtual void SetVoiceFlags(CPlayerSlot slot, int flags) = 0;This plugin's flags for the player, replacing what it set before.
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
flags | int |
GetVoiceFlags
virtual int GetVoiceFlags(CPlayerSlot slot) = 0;The player's flags from every plugin together.
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
SetListenOverride
virtual void SetListenOverride(CPlayerSlot receiver, CPlayerSlot sender, Source2ModListen listen) = 0;This plugin's override for what the receiver hears of the sender.
| Parameter | Type |
|---|---|
receiver | CPlayerSlot |
sender | CPlayerSlot |
listen | Source2ModListen |
GetListenOverride
virtual Source2ModListen GetListenOverride(CPlayerSlot receiver, CPlayerSlot sender) = 0;The override from every plugin together.
| Parameter | Type |
|---|---|
receiver | CPlayerSlot |
sender | CPlayerSlot |
IsSelfMuted
virtual bool IsSelfMuted(CPlayerSlot receiver, CPlayerSlot sender) = 0;Whether the receiver muted the sender themselves. Clients report the first 32 slots only.
| Parameter | Type |
|---|---|
receiver | CPlayerSlot |
sender | CPlayerSlot |
Enums
Source2ModVoiceFlags
enum Source2ModVoiceFlags : intWho hears whom in voice chat.
A player's flags say how they speak and listen; an override decides one receiver and one sender. Each plugin keeps its own, the core combines them (a mute wins) and drops a plugin's when it unloads, and a player's when they leave. A mute the player made themselves (the scoreboard) always holds.
In order, the first that applies decides:
- the receiver muted the sender themselves: not heard;
- the sender has Source2ModVoice_Muted: not heard;
- an override: Mute is not heard, Hear is heard;
- the sender has _All or the receiver _ListenAll: heard;
- the sender has _Team or the receiver _ListenTeam: heard within the team;
- what the game decided.
g_pSource2ModVoice->SetVoiceFlags(slot, Source2ModVoice_Muted);
g_pSource2ModVoice->SetListenOverride(warden, prisoner, Source2ModListen::Hear);| Name | Value |
|---|---|
Source2ModVoice_Normal | 0 |
Source2ModVoice_Muted | 1 << 0 |
Source2ModVoice_All | 1 << 1 |
Source2ModVoice_ListenAll | 1 << 2 |
Source2ModVoice_Team | 1 << 3 |
Source2ModVoice_ListenTeam | 1 << 4 |
Source2ModListen
enum class Source2ModListen : int| Name | Value |
|---|---|
Default | 0 |
Mute | |
Hear |