Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Config = {}
Config.VersionChecker = 0

--This is how you open the menu either via a command or button
--Button = 0 [Default] | Command = 1
Config.OpenMenu = 0
--Default = true |
Config.EnableButton = true

--This is the button that will open the menu (If chosen at Config.OpenMenu)
--Default = 244 [M] | To change the button check out https://docs.fivem.net/game-references/controls/
--Default = M | To change the button check out https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
--Controller Support for this resource is DISABLED!
Config.MenuButton = 244
Config.MenuButton = 'M'

--This is the command that will open the menu (If chosen at Config.OpenMenu)
Config.Command = 'semmenu'
Expand Down
20 changes: 7 additions & 13 deletions menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1072,28 +1072,22 @@ Citizen.CreateThread(function()
_MenuPool:ControlDisablingEnabled(false)
_MenuPool:MouseControlsEnabled(false)

if IsControlJustPressed(1, Config.MenuButton) and GetLastInputMethod(2) then
if not menuOpen then
Menu()
MainMenu:Visible(true)
else
_MenuPool:CloseAllMenus()
end
end
end
end)


if Config.EnableButton then
RegisterKeyMapping(Config.Command, 'Open Interaction Menu', 'keyboard', Config.MenuButton)
end

RegisterCommand(Config.Command, function(source, args, rawCommands)
if Config.OpenMenu == 1 then
if not menuOpen then
Menu()
MainMenu:Visible(true)
else
_MenuPool:CloseAllMenus()
end
end)

Citizen.CreateThread(function()
if Config.OpenMenu == 1 then
TriggerEvent('chat:addSuggestion', '/' .. Config.Command, 'Used to open SEM_InteractionMenu')
end
TriggerEvent('chat:addSuggestion', '/' .. Config.Command, 'Used to open SEM_InteractionMenu')
end)