Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Chat Gags & Mic Muting #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions MorbusGamemode/gamemodes/morbusgame/gamemode/server/sv_chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ end
function GM:PlayerSay(ply, text, to_all) -- Shitty chat shit
--ToDo: REDO THIS
if not ValidEntity(ply) then return end

--check ulx if the client is gagged and block chatting
--assume the client isn't gaged if ulx isn't present
if ply:GetNWBool("ulx_gagged", false) then return "" end

if ply.Gagged then return "" end -- for later use

to_all = !to_all
Expand Down Expand Up @@ -212,8 +217,10 @@ function MuteForRestart(state)
end

function GM:PlayerCanHearPlayersVoice(listener, speaker)

if mute_all then

-- If mute all clients or the client is muted from ulx
-- Notice: returns false if ulx nw boolean is not present
if (mute_all || speaker:GetNWBool("ulx_muted", false)) then
return false,false
end

Expand Down