Skip to content

Commit 9a3544e

Browse files
committed
Improved muting systems
1 parent ca265e7 commit 9a3544e

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

addons/sourcemod/scripting/MyJailbreak/Modules/Warden/mute.sp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public void Mute_OnPluginStart()
9191
// Hooks
9292
HookEvent("round_end", Mute_Event_RoundEnd);
9393
HookEvent("round_start", Mute_Event_RoundStart);
94+
HookEvent("player_team", Mute_Event_PlayerTeam_Post, EventHookMode_Post);
9495
}
9596

9697
public void Mute_OnConfigsExecuted()
@@ -228,6 +229,16 @@ public void Mute_Event_RoundEnd(Event event, const char[] name, bool dontBroadca
228229
UnMuteAll(true);
229230
}
230231

232+
public void Mute_Event_PlayerTeam_Post(Event event, const char[] szName, bool bDontBroadcast)
233+
{
234+
int client = GetClientOfUserId(event.GetInt("userid"));
235+
236+
if (event.GetInt("team") == CS_TEAM_CT)
237+
{
238+
UnMuteClient(client, -1);
239+
}
240+
}
241+
231242
/******************************************************************************
232243
FORWARDS LISTEN
233244
******************************************************************************/

addons/sourcemod/scripting/MyJailbreak/ratio.sp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public Action Command_JoinGuardQueue(int client, int iArgNum)
564564
{
565565
ForcePlayerSuicide(client);
566566
ChangeClientTeam(client, CS_TEAM_CT);
567-
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
567+
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
568568
MinusDeath(client);
569569
CS_RespawnPlayer(client);
570570
}
@@ -1055,7 +1055,7 @@ public int Handler_AcceptGuardRules(Handle menu, MenuAction action, int param1,
10551055

10561056
if (gc_bRespawn.BoolValue)
10571057
{
1058-
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
1058+
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
10591059
MinusDeath(client);
10601060
CS_RespawnPlayer(client);
10611061
}
@@ -1160,7 +1160,7 @@ public int Handler_GuardQuestions(Handle menu, MenuAction action, int param1, in
11601160
{
11611161
ForcePlayerSuicide(client);
11621162
ChangeClientTeam(client, CS_TEAM_CT);
1163-
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
1163+
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
11641164
if (gc_bRespawn.BoolValue)
11651165
{
11661166
MinusDeath(client);
@@ -1199,7 +1199,7 @@ public int Handler_GuardQuestions(Handle menu, MenuAction action, int param1, in
11991199
{
12001200
ForcePlayerSuicide(client);
12011201
ChangeClientTeam(client, CS_TEAM_CT);
1202-
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
1202+
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
12031203
if (gc_bRespawn.BoolValue)
12041204
{
12051205
MinusDeath(client);
@@ -1237,7 +1237,7 @@ public int Handler_GuardQuestions(Handle menu, MenuAction action, int param1, in
12371237
{
12381238
ForcePlayerSuicide(client);
12391239
ChangeClientTeam(client, CS_TEAM_CT);
1240-
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
1240+
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
12411241
if (gc_bRespawn.BoolValue)
12421242
{
12431243
MinusDeath(client);
@@ -1424,7 +1424,7 @@ void FixTeamRatio()
14241424
}
14251425

14261426
SetClientPendingTeam(client, CS_TEAM_CT);
1427-
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
1427+
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
14281428
MinusDeath(client);
14291429
bMovedPlayers = true;
14301430
}
@@ -1697,7 +1697,7 @@ public int ChangeMenu(Menu menu, MenuAction action, int client, int selection)
16971697
}
16981698

16991699
ChangeClientTeam(newGuard, CS_TEAM_CT);
1700-
SetClientListeningFlags(newGuard, VOICE_NORMAL);
1700+
//SetClientListeningFlags(newGuard, VOICE_NORMAL);
17011701
MinusDeath(newGuard);
17021702
}
17031703
}

0 commit comments

Comments
 (0)