From f408e3a56a8c048c2379cdf7b8219a031498a859 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 20 May 2019 23:04:04 +0200 Subject: [PATCH 01/10] Proper hud natives --- client/main.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index e0797571..f273eea7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -14,10 +14,9 @@ local voice = {default = 5.0, shout = 12.0, whisper = 1.0, current = 0, level = function drawLevel(r, g, b, a) SetTextFont(4) - SetTextProportional(1) SetTextScale(0.5, 0.5) SetTextColour(r, g, b, a) - SetTextDropShadow(0, 0, 0, 0, 255) + SetTextDropshadow(0, 0, 0, 0, 255) SetTextEdge(1, 0, 0, 0, 255) SetTextDropShadow() SetTextOutline() From 70b56fb7c441b19dbd6fdcec9fa6cee8e91e2e22 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 31 May 2019 12:38:07 +0200 Subject: [PATCH 02/10] Remove unused text native --- client/main.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index f273eea7..59e36e29 100644 --- a/client/main.lua +++ b/client/main.lua @@ -17,7 +17,6 @@ function drawLevel(r, g, b, a) SetTextScale(0.5, 0.5) SetTextColour(r, g, b, a) SetTextDropshadow(0, 0, 0, 0, 255) - SetTextEdge(1, 0, 0, 0, 255) SetTextDropShadow() SetTextOutline() From 3177493519536c3d7de30324258d8fc98c762da3 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 7 Aug 2019 15:22:45 +0200 Subject: [PATCH 03/10] Optimized the code a bit --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 59e36e29..9f03719d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -63,7 +63,7 @@ Citizen.CreateThread(function() if NetworkIsPlayerTalking(PlayerId()) then drawLevel(41, 128, 185, 255) - elseif not NetworkIsPlayerTalking(PlayerId()) then + else drawLevel(185, 185, 185, 255) end end From 9e80de864f2632b058dce8077887deba0b60840d Mon Sep 17 00:00:00 2001 From: JHyeok Date: Tue, 3 Sep 2019 00:45:37 +0900 Subject: [PATCH 04/10] Add Korean Language --- __resource.lua | 1 + locales/ko.lua | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 locales/ko.lua diff --git a/__resource.lua b/__resource.lua index d314d63b..7d4e3ed8 100644 --- a/__resource.lua +++ b/__resource.lua @@ -12,6 +12,7 @@ client_scripts { 'locales/fr.lua', 'locales/pl.lua', 'locales/sv.lua', + 'locales/ko.lua', 'config.lua', 'client/main.lua' } diff --git a/locales/ko.lua b/locales/ko.lua new file mode 100644 index 00000000..c4c7fc64 --- /dev/null +++ b/locales/ko.lua @@ -0,0 +1,6 @@ +Locales ['ko'] = { + ['voice'] = '~y~목소리: ~s~%s', + ['normal'] = '보통', + ['shout'] = '외침', + ['whisper'] = '속삭임', +} From a791aebfd4d616ccaf9766a23b1fefd442bd56ed Mon Sep 17 00:00:00 2001 From: userMacieG Date: Fri, 11 Oct 2019 11:25:31 +0200 Subject: [PATCH 05/10] Update README.md --- README.md | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 1588f62b..fc5e3235 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,28 @@ # esx_voice -FXServer ESX Voice - - -#### Description This is a proximity voice controller script. The default control for this is `Left Shift + H` (QWERTY). -#### Download +## Download & Installation -**1) Using [fvm](https://github.com/qlaffont/fvm-installer)** +### Using [fvm](https://github.com/qlaffont/fvm-installer) ``` fvm install --save --folder=esx esx-org/esx_voice ``` -**2) Manually** -- Download https://github.com/ESX-Org/esx_voice/releases/latest -- Put it in resource/[esx] directory - -**3) Using Git** - +### Using Git ``` -cd resouces -git clone https://github.com/ESX-Org/esx_voice +cd resources +git clone https://github.com/ESX-Org/esx_voice [esx]/esx_voice ``` -#### Installation +### Manually +- Download https://github.com/ESX-Org/esx_voice/archive/master.zip +- Put it in the `[esx]` directory -1) Add `start esx_voice` to your server.cfg +## Installation +Add this into your `server.cfg` +``` +start esx_voice +``` - -#### Credits -Original Script by [aabbfive](https://github.com/aabbfive/voicecontroller) +## Credits +[aabbfive](https://github.com/aabbfive/voicecontroller) - Original author From bc4f9507178d80226bc781edbe1c2f3bd2cfca2e Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 4 Jan 2020 13:05:17 +0100 Subject: [PATCH 06/10] Minor repo changes --- README.md | 12 ++++++++++++ __resource.lua | 2 +- client/main.lua | 16 ++-------------- config.lua | 5 +++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index fc5e3235..162d2aef 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,15 @@ start esx_voice ## Credits [aabbfive](https://github.com/aabbfive/voicecontroller) - Original author + +# Legal +### License +esx_voice + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/__resource.lua b/__resource.lua index d314d63b..bbf4a86a 100644 --- a/__resource.lua +++ b/__resource.lua @@ -9,7 +9,7 @@ client_scripts { 'locales/br.lua', 'locales/en.lua', 'locales/fi.lua', - 'locales/fr.lua', + 'locales/fr.lua', 'locales/pl.lua', 'locales/sv.lua', 'config.lua', diff --git a/client/main.lua b/client/main.lua index 9f03719d..7b461c26 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,15 +1,3 @@ -local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, - ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, - ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, - ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, - ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, - ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, - ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, - ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, - ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 -} - local voice = {default = 5.0, shout = 12.0, whisper = 1.0, current = 0, level = nil} function drawLevel(r, g, b, a) @@ -20,7 +8,7 @@ function drawLevel(r, g, b, a) SetTextDropShadow() SetTextOutline() - BeginTextCommandDisplayText("STRING") + BeginTextCommandDisplayText('STRING') AddTextComponentSubstringPlayerName(_U('voice', voice.level)) EndTextCommandDisplayText(0.175, 0.92) end @@ -39,7 +27,7 @@ Citizen.CreateThread(function() while true do Citizen.Wait(1) - if IsControlJustPressed(1, Keys['H']) and IsControlPressed(1, Keys['LEFTSHIFT']) then + if IsControlJustPressed(1, 74) and IsControlPressed(1, 21) then voice.current = (voice.current + 1) % 3 if voice.current == 0 then NetworkSetTalkerProximity(voice.default) diff --git a/config.lua b/config.lua index ad83260a..1875b978 100644 --- a/config.lua +++ b/config.lua @@ -1,2 +1,3 @@ -Config = {} -Config.Locale = 'en' \ No newline at end of file +Config = {} + +Config.Locale = 'fr' From 39c7768f7aac5abfaf1727365c7c3781b556201d Mon Sep 17 00:00:00 2001 From: rex2630 Date: Sun, 19 Jan 2020 16:57:45 +0100 Subject: [PATCH 07/10] Replace __resource.lua with fxmanifest.lua --- __resource.lua => fxmanifest.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename __resource.lua => fxmanifest.lua (80%) diff --git a/__resource.lua b/fxmanifest.lua similarity index 80% rename from __resource.lua rename to fxmanifest.lua index e41f5e03..621dabd1 100644 --- a/__resource.lua +++ b/fxmanifest.lua @@ -1,4 +1,6 @@ -resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' +fx_version 'adamant' + +game 'gta5' description 'ESX Voice Controller' From 74f546cf13f423b5287c0cdbff6df9674cd37435 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 14 Apr 2020 16:53:41 +0200 Subject: [PATCH 08/10] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 162d2aef..929a4a3c 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ start esx_voice ``` ## Credits + [aabbfive](https://github.com/aabbfive/voicecontroller) - Original author # Legal From 5fdcc34c523a7e7c1422013aa3fc1b9b08da030c Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Fri, 15 May 2020 17:10:51 -0500 Subject: [PATCH 09/10] Update esx_voice Add feature for voice UI element to not show until loading screen is off --- client/main.lua | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/client/main.lua b/client/main.lua index 7b461c26..9c5a3b57 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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) From 87c48964f911e087fab4df842ae862951438ea79 Mon Sep 17 00:00:00 2001 From: HypeLevels <61633775+HypeLevels@users.noreply.github.com> Date: Tue, 1 Dec 2020 21:44:40 +0000 Subject: [PATCH 10/10] Update config.lua Changed default language to english as its the universal language --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index 1875b978..a3d6aa84 100644 --- a/config.lua +++ b/config.lua @@ -1,3 +1,3 @@ Config = {} -Config.Locale = 'fr' +Config.Locale = 'en'