Midnight Dev
  • Vehicle Control Menu
    • Installation
    • Configuration
      • Fuel Script
      • Restrictions to Opening Menu
      • Keybinds and Allowed Controls
      • Restricted Passenger Control
      • Refresh Time
      • Hide Headlight/Neon Controls
    • Commands, Exports, Events
  • Neon Controller
    • Installation
    • Configuration
      • Keybinds and Allowed Controls
    • Commands, Exports, Events
  • Midnight Progress Bar
  • Midnight Menu and Input (Package)
Powered by GitBook
On this page
  • Default Keybinds
  • Allowed Controls
  1. Neon Controller
  2. Configuration

Keybinds and Allowed Controls

Default Keybinds

A default keybind can be assigned to all players to open and close the menu. This is configurable in the config file

shared/config.lua
-- The default keybind used to open/close the neon controller menu
-- Set this to nil if you dont want a keybind to be used
Config.DefaultKeybind = 'n'

As mentioned in the comments above, setting the default keybind to nil (not 'nil') will completely remove the key mapping. This is ideal if your server is already overloaded with keybinds from various scripts. This will mean that players will either have to use commands, or you must provide alternative methods using exports/event

IMPORTANT NOTE

Our script uses keymapping as an optimized alternative to continuously listening for keypresses every tick. This method allows players to map a keybind to a command, which they can configure individually under Settings > Key Bindings > FiveM, just like any other game keybind.

When the resource is first started on your server, the default keybind from the config file will be applied to all players. However, if a player customizes their keybind through the settings, their chosen keybind will remain unchanged even if the default keybind in the config is later updated. The updated default keybind will only apply to players who have not yet played on the server. Codesign has good documentation on this topic. https://docs.codesign.pro/coding-information/register-key-mapping


Allowed Controls

Controls that will be registered while the NUI is active (so that you can actually still utilize the vehicle while the control UI is open)

shared/config.lua
-- Keyboard controls that are enabled while the neon controller UI is open. 
-- See https://docs.fivem.net/docs/game-references/controls/ for all keys
Config.AllowedControls = {
    75,  -- exit vehicle (F)
    71,  -- accelerate vehicle (W)
    72,  -- deccelerate vehicle (S)
    59,  -- turn vehicle left/right (A/D)
    86,  -- honk (E)
    74,  -- toggle headlight (H)
    101, -- open vehicle roof (H)
    76,  -- handbrake (Spacebar)
    245, -- open chat (T)
    85,  -- use radio (Q)
}
PreviousConfigurationNextCommands, Exports, Events

Last updated 1 month ago