Need help with Local voice script cider

I have a customized cider on my server, and I try to get local voice to work, but it doesn’t.

In sh_configuration.lua I have:



cider.configuration["Local Voice"] = true; 
cider.configuration["Talk Radius"] = 256;


I have this code:
[lua]
– Create the voice chat radius.
function ChatRadius()
EntsInRange = ents.FindInSphere( LocalPlayer():GetPos(), cider.configuration[“Talk Radius”] )
for i = 2,#EntsInRange do
if EntsInRange*:GetClass() == “player” then
if LocalPlayer().IsMuted(EntsInRange*) then
LocalPlayer():SetMuted(EntsInRange*)
// Works like this - LocalPlayer is the player doing the muting, the player being muted
// is EntsInRange*.
end
EntsInRange*.InVCRadius = true
end
end
for i = 2,#player.GetAll() do
if player.GetByID(i).InVCRadius then
if LocalPlayer().IsMuted(player.GetByID(i)) then //IsMuted works pretty much the same as SetMuted.
// Do nothing, because the player is already muted, DUH.
// And yes, I know I can just use !LocalPLayer().IsMuted(player.GetByID(i)) instead, but I’ll do that when I know my script is working.
else
LocalPlayer():SetMuted(player.GetByID(i))
end
end
end
end
timer.Create( “VoiceChatRadius”, 1.0, 0, ChatRadius)
[/lua]

Can someone help me get this script working?

Let me quote the offical wiki code:


 
VC_MAX_RADIUS = 120
timer.Create( "VoiceChatRadius", 1, 0, function()
	local lpl = LocalPlayer();
	for _,ply in ipairs(player:GetAll()) do
		if (ply ~= lpl) then
			if (ply:GetPos():Distance(lpl:GetPos()) <= VC_MAX_RADIUS) then
				if (ply:IsMuted()) then
					lpl:SetMuted(ply);
				end
			elseif (not ply:IsMuted()) then
				lpl:SetMuted(ply);
			end
		end
	end
end)


I didn’t tested it but is should work.
(Copy paste from the wiki: http://wiki.garrysmod.com/?title=Player.SetMuted)

That’s a horrible method, use **[Gamemode.PlayerCanHearPlayersVoice

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PlayerCanHearPlayersVoice)** instead