diff --git a/_Resource/VoiceGPS/VoiceGPS_FiveM.Client.net.dll b/_Resource/VoiceGPS/VoiceGPS_FiveM.Client.net.dll index 170669f..50e4720 100644 Binary files a/_Resource/VoiceGPS/VoiceGPS_FiveM.Client.net.dll and b/_Resource/VoiceGPS/VoiceGPS_FiveM.Client.net.dll differ diff --git a/src/VoiceGPS-FiveM.Client/ClientScript.cs b/src/VoiceGPS-FiveM.Client/ClientScript.cs index 631b491..1089f01 100644 --- a/src/VoiceGPS-FiveM.Client/ClientScript.cs +++ b/src/VoiceGPS-FiveM.Client/ClientScript.cs @@ -10,19 +10,28 @@ namespace VoiceGPS_FiveM.Client public class ClientScript : BaseScript { private static Ped _playerPed; + private bool _justPlayed1000M, _justPlayed200M, _justPlayedFollowRoad, _justPlayedImmediate, _playedStartDriveAudio, _justPlayedRecalc, _voiceGpsEnabled, _welcomeShowed; + private bool _justPlayedArrived = true; + private int _lastDirection; + + // User editable variables // Default volume (between 0.1 and 1.0) private double _audioVolume = 0.7; - private bool _justPlayed1000M, _justPlayed200M, _justPlayedFollowRoad, _justPlayedImmediate, _playedStartDriveAudio, _justPlayedRecalc, _voiceGpsEnabled, _welcomeShowed; - private bool _justPlayedArrived = true; + private const Control ToggleVGPSKeybind = Control.DropAmmo; // F10 + private const bool IsKeybindEnabled = true; + + private const bool IsCommandEnabled = true; - private int _lastDirection; public ClientScript() { Chat("VGPS Loaded"); - EventHandlers.Add("vgps:toggleVGPS", new Action(ToggleVgps)); + EventHandlers.Add("vgps:toggleVGPS", + IsCommandEnabled + ? new Action(ToggleVgps) + : new Action(() => ShowNotification("~r~The command has been disabled. Please use the set keybind instead."))); // UNCOMMENT BELOW LINE TO REMOVE THE WELCOME MESSAGE //_welcomeShowed = true; @@ -41,7 +50,7 @@ private async Task OnTick() _welcomeShowed = true; } - if (Game.IsControlJustReleased(1, Control.DropAmmo)) + if (IsKeybindEnabled && Game.IsControlJustReleased(1, ToggleVGPSKeybind)) { ToggleVgps(); }