1s: Default NetworkSetTalkerProximity should be lowered to something 'decent'

When people are joining our server, sadly, they get “voice-spammed” as the range is global by default.

We need at float value, and by default it is int 0

I’ve tried using this, but the case is that voice receiving is in active state before this is run, so it results in about 5 seconds where you can hear everyone on the server. Imagine that with 64 players, and :rp: server :laughing:

-- fix for OneSync global voice -- attempt 3 -- not working
AddEventHandler('onClientResourceStart', function(name)
	if name == GetCurrentResourceName() then
		NetworkSetTalkerProximity(7.0)
	end
end)

Right now I’m using a rather wacko solution, to make sure it’s actually get’s changed as it doesn’t with the one above.

-- fix for OneSync global voice -- attempt #1
local oneSyncCount = 0
Citizen.CreateThread(function()
	while true do

				--print("NetworkGetTalkerProximity: "..NetworkGetTalkerProximity())
						-- we're checking if we have a bad value, or if its not set at all (0 = not a float) - we need a float value
						if NetworkGetTalkerProximity() > 1000000000 or NetworkGetTalkerProximity() < 1.0 or NetworkGetTalkerProximity() == 0 then

								--print("Voice radius was: "..NetworkGetTalkerProximity().." - we're setting it ...")
								NetworkSetTalkerProximity(7.0)
								--print("talk proximity: "..NetworkGetTalkerProximity() .. " -- count: "..oneSyncCount)

								oneSyncCount = oneSyncCount + 1
								if oneSyncCount > 100 then
										print("## Gee OneSync Voice work-around succeded ##")
									 return
								end
						end
						Wait(5)
	end
end)

Again, wacko. But what should work doesn’t seem to work like intended :stuck_out_tongue:

1 Like

I am fairly sure the default for base GTA is to have this be global as well. The only difference I can see is that voice connections are established faster here, so that there’s an audible gap before scripts run to clip down the proximity configuration.

You could be right on that one.
Could we do a work-around for this though?

Maybe delay the voice connections? For about 6 seconds. Maybe 10 just to be sure that client values are set beforehand if needed.

Not a very pleasent experience hearing up to 64 players talking at once for 5 seconds each time you join the server :smiley:

Did u get to solve this voice issue? Can u help me please? I have the same issue with my server :slight_smile:

It’s already resolved - scripts now have enough time to set proximity on first initialization. If your scripts don’t that’s a you issue.

And can u tell me how to resolve this if i share my resources.cfg?