pma-voice

Manual Installation

1

Edit pma-voice

Go to: pma-voice/client/module/radio.lua

2

Replace command

RegisterCommand('+radiotalk', function()
	if isDead() then return end
	if not isRadioEnabled() then return end
	if not radioPressed then
		if radioChannel > 0 then
			addVoiceTargets(radioData, callData)
			TriggerServerEvent('pma-voice:setTalkingOnRadio', true)
			radioPressed = true
			playMicClicks(true)
			TriggerEvent("pma-voice:radioActive", true)
			CreateThread(function()
				LocalPlayer.state:set("radioActive", true, true);
				local checkFailed = false
				TriggerEvent("pma:animazioneRadio", true)
				while radioPressed do
					if radioChannel < 0 or isDead() or not isRadioEnabled() then
						checkFailed = true
						break
					end
					SetControlNormal(0, 249, 1.0)
					SetControlNormal(1, 249, 1.0)
					SetControlNormal(2, 249, 1.0)
					Wait(0)
				end

				if checkFailed then
					logger.info("Canceling radio talking as the checks have failed.")
					ExecuteCommand("-radiotalk")
				end
			end)
		else
			logger.info("Player tried to talk but was not on a radio channel")
		end
	end
end, false)

RegisterCommand('-radiotalk', function()
	if radioChannel > 0 and radioPressed then
		radioPressed = false
		MumbleClearVoiceTargetPlayers(voiceTarget)
		addVoiceTargets(callData)
		TriggerEvent("pma-voice:radioActive", false)
		LocalPlayer.state:set("radioActive", false, true);
		playMicClicks(false)
		TriggerEvent("pma:animazioneRadio", false)
		TriggerServerEvent('pma-voice:setTalkingOnRadio', false)
	end
end, false)

Last updated