Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
FrazzIe committed Sep 3, 2020
2 parents 9ea65a4 + 7190666 commit d2f6653
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,15 @@ Citizen.CreateThread(function()
end

if IsControlJustPressed(0, mumbleConfig.controls.proximity.key) then
if mumbleConfig.controls.speaker.key ~= mumbleConfig.controls.proximity.key or ((not mumbleConfig.controls.speaker.secondary == nil) and IsControlPressed(0, mumbleConfig.controls.speaker.secondary) or true) then
local secondaryPressed = true

if mumbleConfig.controls.speaker.key ~= mumbleConfig.controls.proximity.key or mumbleConfig.controls.speaker.secondary == nil then
secondaryPressed = false
else
secondaryPressed = IsControlPressed(0, mumbleConfig.controls.speaker.secondary) and (playerData.call > 0)
end

if not secondaryPressed then
local voiceMode = playerData.mode

local newMode = voiceMode + 1
Expand Down Expand Up @@ -753,12 +761,18 @@ Citizen.CreateThread(function()
end

if mumbleConfig.callSpeakerEnabled then
if ((not mumbleConfig.controls.speaker.secondary == nil) and IsControlPressed(0, mumbleConfig.controls.speaker.secondary) or true) then
if IsControlJustPressed(0, mumbleConfig.controls.speaker.key) then
if playerCall > 0 then
SetVoiceData("callSpeaker", not playerData.callSpeaker)
playerData.callSpeaker = not playerData.callSpeaker
end
local secondaryPressed = false

if mumbleConfig.controls.speaker.secondary ~= nil then
secondaryPressed = IsControlPressed(0, mumbleConfig.controls.speaker.secondary)
else
secondaryPressed = true
end

if IsControlJustPressed(0, mumbleConfig.controls.speaker.key) and secondaryPressed then
if playerData.call > 0 then
SetVoiceData("callSpeaker", not playerData.callSpeaker)
playerData.callSpeaker = not playerData.callSpeaker
end
end
end
Expand Down

0 comments on commit d2f6653

Please sign in to comment.