Installation and Setup

Installation

Follow the steps below to claim your resource and install it

1

Download Resource

  • Access the official Cfx.re portal and log in with the same Cfx.re account you used to make the purchase

  • In the list of granted assets, find Midnight-VehicleMenu download it

2

Add Resource to Server

  • Unzip the md_carcontrol.zip folder and place the extracted folder into your servers resources folder (or any sub folder)

  • Open your servers server.cfg file and write ensure md-carcontrol anywhere after your framework is ensured. Alternatively, place the resource in any folder that is already ensured


Fuel Script Integration

The vehicle control UI displays the current fuel level. This resource offers direct support for cdn-fuel and legacy-fuel. It can also run standalone (no fuel script required) or be configured to work with any other third-party fuel script.

NO FUEL SCRIPT

Set Config

shared/client-functions.lua
-- The fuel script used to display the vehicles fuel on the UI.
-- Supported: cdn-fuel, legacy-fuel, ox_fuel, nil.  Check documentation to learn how to include any other script
Config.FuelScript = nil
OX_FUEL

Set Config

shared/client-functions.lua
-- The fuel script used to display the vehicles fuel on the UI.
-- Supported: cdn-fuel, legacy-fuel, ox_fuel, nil.  Check documentation to learn how to include any other script
Config.FuelScript = 'ox_fuel'
CDN-FUEL

Set Config

shared/config.lua
Config.FuelScript = 'cdn-fuel'
LEGACY-FUEL

Set Config

ANY OTHER FUEL SCRIPT

Set Config

Add Custom Fuel Reading Code

  • Open the shared functions file found in shared/functions.lua

  • Edit the last elseif statement in the givenGetFuelLevel function.

    • The vehicle being checked is provided as a paramater (veh).

    • Utilize exports or any means from your custom fuel script to check how much fuel the vehicle has, and return the amount as a number between 0 and 100


Database Setup

1

Installing oxmysql

This resource uses oxmysql for all database interactions. To install, follow the instructions listed at https://overextended.dev/oxmysql.

2

Initializing The Table

Execute the following SQL code found in user_settings.sql , using your database software.


Enabling Onesync

Follow this Guide to enable OneSync on your server. This is required to ensure proper synchronization of indicators between players.

Last updated