Midnight Vehicle Control Menu
Midnight Vehicle Control is a standalone script that provides a simple and intuitive interface to manage your vehicle controls in your FiveM server.
Last updated
Midnight Vehicle Control is a standalone script that provides a simple and intuitive interface to manage your vehicle controls in your FiveM server.
Last updated
All frameworks are supported as this script is fully standalone
Download the resource from your .
Unzip the md_vehiclecontrol.zip
folder and place this folder in your server's resource folder.
Ensure the script in your server.cfg
file by writing ensure md_vehiclecontrol,
(or make sure the script is placed in a folder that is already ensured)
Follow the next step to configure your fuel setup, and that is all!
The vehicle control UI displays the amount of fuel a vehicle has. By default, the script will be standalone, using the FiveM native to retrieve the fuel level for the vehicle.
If you wish to use a fuel script, you need to specify the script in the config file, by editing the following line.
If you do not wish to use any fuel script, simply set the config to 'none' or 'standalone'. You are now done setting up the script.
We have configured this script to be compatible with cdn-fuel and legacy-fuel, straight out of the box.
If you are using cdn-fuel, set this config to 'cdn-fuel'
If you are legacy-fuel, set this config to 'legacy-fuel'
If you are using any other fuel script, you must set this config to 'other' and configure the GetFuelLevel(veh)
function in[shared/functions.lua]
The comments are self explanatory. If you are using a fuel script other than cdn-fuel or legacy-fuel, you should place the code that returns the vehicles fuel amount in the last elseif
statement
If the fuel script you use is limited to a certain framework, this script will be too.
By default, anybody in the vehicle can open the menu (with passengers having limited access compared to the driver). However, in certain situations, such as when a passenger may be in handcuffs, you may not want them to be control the vehicle. To account for any restrictions similar to these, you can edit the openCCAfterCheck(veh)
function in[shared/functions.lua
A default keybind can be assigned to all players to open and close the script. This is configurable in the config file
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/events (mentioned later in this documentation)
Players can use commands in the chat to open, close and toggle the vehicle control UI. The default commands are listed below.
/openCC
Open Vehicle Control Menu
/closeCC
Close Vehicle Control Menu
/toggleCC
Toggle Vehicle Control Menu
You may change these commands in the config file
The events used to open and close the vehicle control UI. These can be called from any script, such as a radial menu.
If you would like to use exports rather than events
This config determines how frequently the vehicle control UI will be updated, defining the delay time in miliseconds between each update tick. For example, if a door is torn off a vehicle, a lower refresh time will cause the UI to disable the corresponding door button more quickly. However, it's important to note that while a shorter refresh time improves responsiveness, it will also consume more server resources. The default value of 500ms will result in a good balance between responsiveness, while consuming 0.02 to 0.04 resmon (while the UI is open)
There are many advanced neon and headlight controller scripts developed by FiveM scripters (including our very own advanced controller script, coming soon!). The vehicle control menu includes a basic neon and headlight controller with simple toggle functionality and the ability to change colors.
If you have a more advanced script for handling neons installed on your server, you can set the Config.HideNeonControl
configuration option to true. Doing so will hide the built-in controller from this script, helping to avoid feature duplication and reduce repetitiveness in the user interface. Same can be done for headlights
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)
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.
For most vehicles, passengers can typically control their own windows and doors. However, for larger vehicles like buses, prison buses, tour buses, and other similar types of buses, it would be more realistic for passengers to have no control over the windows or doors. This configuration allows you to specify which vehicles this rule should apply to. To add a vehicle, add the MODEL NAME of the vehicle from the (in capital letters)
Join our for support. You can create a ticket for assistance or general inquiries.