This is fairly difficult if you're new to gmod's Lua stuff, because you have to understand how hooks work etc. There's no easy function to call that just disables someone's mic.
This is the hook you'd have to use:
Gamemode.PlayerCanHearPlayersVoice You'd use it a little like this:
local function MuteDeviceHook(listener, speaker)
-- don't affect spectators or traitors
if speaker:IsTerror() and (not speaker:IsTraitor()) then
-- check if a mute device has been planted, maybe check if the speaker is
-- close enough, whatever you want...
local mute = ShouldSpeakerBeMuted(speaker)
-- return false to prevent the listener from hearing the speaker
return (not mute)
end
-- do nothing for all other cases, so TTT can do its own thing for those
end
hook.Add("PlayerCanHearPlayersVoice", "MyMuteDeviceHook", MuteDeviceHook)
Of course you need to define "ShouldSpeakerBeMuted" there to check if a mute device has been planted, stuff like that. That's up you.
Cheers for the reply, I'll get to work on this.
As a second question, do you know how the disguiser that makes you appear as another player was coded? Just a general function or array that calls for players names.
And my mate had a suggestion for a feature in the mod:
A little icon above players heads
that can be seen through walls for spectators, that displays peoples locations?