Skip to content

Commit 2c08629

Browse files
committed
add proximity state bags
1 parent 0bb1b63 commit 2c08629

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

client/main.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ RegisterCommand('+cycleproximity', function()
120120
voiceMode = (newMode <= #Cfg.voiceModes and newMode) or 1
121121
MumbleSetAudioInputDistance(Cfg.voiceModes[voiceMode][1] + 0.0)
122122
mode = voiceMode
123+
LocalPlayer.state:set('proximity', Cfg.voiceModes[voiceMode][1], true)
123124
-- make sure we update the UI to the latest voice mode
124125
SendNUIMessage({
125126
voiceMode = voiceMode - 1
@@ -133,8 +134,10 @@ RegisterKeyMapping('+cycleproximity', 'Cycle Proximity', 'keyboard', GetConvar('
133134
RegisterNetEvent('pma-voice:mutePlayer', function()
134135
playerMuted = not playerMuted
135136
if playerMuted then
137+
LocalPlayer.state:set('proximity', 0.1, true)
136138
MumbleSetAudioInputDistance(0.1)
137139
else
140+
LocalPlayer.state:set('proximity', Cfg.voiceModes[mode][1], true)
138141
MumbleSetAudioInputDistance(Cfg.voiceModes[mode][1])
139142
end
140143
end)
@@ -273,6 +276,7 @@ AddEventHandler('onClientResourceStart', function(resource)
273276

274277
-- sets how far the player can talk
275278
MumbleSetAudioInputDistance(Cfg.voiceModes[mode][1] + 0.0)
279+
LocalPlayer.state:set('proximity', Cfg.voiceModes[mode][1] + 0.0, true)
276280

277281
-- this sets how far the player can hear.
278282
MumbleSetAudioOutputDistance(Cfg.voiceModes[#Cfg.voiceModes][1] + 0.0)

0 commit comments

Comments
 (0)