Fixed menu button working when the power was off

This commit is contained in:
Dan
2020-02-22 12:03:51 +00:00
parent ab479eb3f3
commit 3f41e5b8f8

View File

@@ -1332,6 +1332,8 @@ end )
-- Runs when the user presses the menu button on the remote control
RegisterNUICallback( "menu", function()
-- Only run the codw if the radar has power
if ( RADAR:IsPowerOn() ) then
-- As the menu button is a multipurpose button, we first check to see if the menu is already open
if ( RADAR:IsMenuOpen() ) then
-- As the menu is already open, we then iterate to the next option in the settings list
@@ -1346,6 +1348,7 @@ RegisterNUICallback( "menu", function()
-- Play the standard audio beep
SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "beep" ) } )
end
end )
-- Runs when the JavaScript side sends the UI data for saving