0.0.1
This commit is contained in:
27
resources/[standalone]/pma-voice/client/init/submix.lua
Normal file
27
resources/[standalone]/pma-voice/client/init/submix.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
AddStateBagChangeHandler("submix", "", function(bagName, _, value)
|
||||
local tgtId = tonumber(bagName:gsub('player:', ''), 10)
|
||||
if not tgtId then return end
|
||||
-- We got an invalid submix, discard we don't care about it
|
||||
if value and not submixIndicies[value] then
|
||||
return logger.warn("Player %s applied submix %s but it isn't valid",
|
||||
tgtId, value)
|
||||
end
|
||||
|
||||
-- we don't want to reset submix if the player is talking on the radio
|
||||
if not value then
|
||||
if not radioData[tgtId] and not callData[tgtId] then
|
||||
logger.info("Resetting submix for player %s", tgtId)
|
||||
MumbleSetSubmixForServerId(tgtId, -1)
|
||||
end
|
||||
return
|
||||
end
|
||||
logger.info("%s had their submix set to %s", tgtId, value)
|
||||
MumbleSetSubmixForServerId(tgtId, submixIndicies[value])
|
||||
end)
|
||||
|
||||
RegisterNetEvent("onPlayerDropped", function(tgtId)
|
||||
if not radioData[tgtId] and not callData[tgtId] then
|
||||
logger.info("Resetting submix for player %s", tgtId)
|
||||
MumbleSetSubmixForServerId(tgtId, -1)
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user