Skip to content

Commit

Permalink
Improved muting systems
Browse files Browse the repository at this point in the history
  • Loading branch information
azalty committed Feb 4, 2023
1 parent ca265e7 commit 9a3544e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
11 changes: 11 additions & 0 deletions addons/sourcemod/scripting/MyJailbreak/Modules/Warden/mute.sp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public void Mute_OnPluginStart()
// Hooks
HookEvent("round_end", Mute_Event_RoundEnd);
HookEvent("round_start", Mute_Event_RoundStart);
HookEvent("player_team", Mute_Event_PlayerTeam_Post, EventHookMode_Post);
}

public void Mute_OnConfigsExecuted()
Expand Down Expand Up @@ -228,6 +229,16 @@ public void Mute_Event_RoundEnd(Event event, const char[] name, bool dontBroadca
UnMuteAll(true);
}

public void Mute_Event_PlayerTeam_Post(Event event, const char[] szName, bool bDontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));

if (event.GetInt("team") == CS_TEAM_CT)
{
UnMuteClient(client, -1);
}
}

/******************************************************************************
FORWARDS LISTEN
******************************************************************************/
Expand Down
14 changes: 7 additions & 7 deletions addons/sourcemod/scripting/MyJailbreak/ratio.sp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public Action Command_JoinGuardQueue(int client, int iArgNum)
{
ForcePlayerSuicide(client);
ChangeClientTeam(client, CS_TEAM_CT);
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
MinusDeath(client);
CS_RespawnPlayer(client);
}
Expand Down Expand Up @@ -1055,7 +1055,7 @@ public int Handler_AcceptGuardRules(Handle menu, MenuAction action, int param1,

if (gc_bRespawn.BoolValue)
{
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
MinusDeath(client);
CS_RespawnPlayer(client);
}
Expand Down Expand Up @@ -1160,7 +1160,7 @@ public int Handler_GuardQuestions(Handle menu, MenuAction action, int param1, in
{
ForcePlayerSuicide(client);
ChangeClientTeam(client, CS_TEAM_CT);
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
if (gc_bRespawn.BoolValue)
{
MinusDeath(client);
Expand Down Expand Up @@ -1199,7 +1199,7 @@ public int Handler_GuardQuestions(Handle menu, MenuAction action, int param1, in
{
ForcePlayerSuicide(client);
ChangeClientTeam(client, CS_TEAM_CT);
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
if (gc_bRespawn.BoolValue)
{
MinusDeath(client);
Expand Down Expand Up @@ -1237,7 +1237,7 @@ public int Handler_GuardQuestions(Handle menu, MenuAction action, int param1, in
{
ForcePlayerSuicide(client);
ChangeClientTeam(client, CS_TEAM_CT);
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
if (gc_bRespawn.BoolValue)
{
MinusDeath(client);
Expand Down Expand Up @@ -1424,7 +1424,7 @@ void FixTeamRatio()
}

SetClientPendingTeam(client, CS_TEAM_CT);
SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
//SetClientListeningFlags(client, VOICE_NORMAL); // unmute if sm_hosties or admin has muted prisoners on round start
MinusDeath(client);
bMovedPlayers = true;
}
Expand Down Expand Up @@ -1697,7 +1697,7 @@ public int ChangeMenu(Menu menu, MenuAction action, int client, int selection)
}

ChangeClientTeam(newGuard, CS_TEAM_CT);
SetClientListeningFlags(newGuard, VOICE_NORMAL);
//SetClientListeningFlags(newGuard, VOICE_NORMAL);
MinusDeath(newGuard);
}
}
Expand Down

0 comments on commit 9a3544e

Please sign in to comment.