Update esx_voice

Add feature for voice UI element to not show until loading screen is off
This commit is contained in:
ArkSeyonet
2020-05-15 17:10:51 -05:00
parent 74f546cf13
commit 5fdcc34c52
+24 -22
View File
@@ -23,36 +23,38 @@ AddEventHandler('onClientMapStart', function()
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
AddEventHandler('esx:loadingScreenOff', function()
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
if IsControlJustPressed(1, 74) and IsControlPressed(1, 21) then
voice.current = (voice.current + 1) % 3
if voice.current == 0 then
NetworkSetTalkerProximity(voice.default)
voice.level = _U('normal')
elseif voice.current == 1 then
NetworkSetTalkerProximity(voice.shout)
voice.level = _U('shout')
elseif voice.current == 2 then
NetworkSetTalkerProximity(voice.whisper)
voice.level = _U('whisper')
end
end
if IsControlJustPressed(1, 74) and IsControlPressed(1, 21) then
voice.current = (voice.current + 1) % 3
if voice.current == 0 then
NetworkSetTalkerProximity(voice.default)
voice.level = _U('normal')
elseif voice.current == 1 then
NetworkSetTalkerProximity(voice.shout)
voice.level = _U('shout')
elseif voice.current == 2 then
NetworkSetTalkerProximity(voice.whisper)
voice.level = _U('whisper')
end
end
if voice.current == 0 then
voice.level = _U('normal')
elseif voice.current == 1 then
voice.level = _U('shout')
elseif voice.current == 2 then
voice.level = _U('whisper')
if NetworkIsPlayerTalking(PlayerId()) then
drawLevel(41, 128, 185, 255)
else
drawLevel(185, 185, 185, 255)
end
end
if NetworkIsPlayerTalking(PlayerId()) then
drawLevel(41, 128, 185, 255)
else
drawLevel(185, 185, 185, 255)
end
end
end)
end)