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 Neon Controller download it

2

Add Resource to Server

  • Unzip the md-neoncontroller.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-neoncontroller anywhere after your framework is ensured. Alternatively, place the resource in any folder that is already ensured


Neon Controller Item Setup

Server owners must choose one of the following access methods:

  • Require the Item: Players must have the item in their inventory to access the neon controller menu. Follow the steps in INCLUDE ITEM

  • No Item Required (Default): Players can open the menu in any vehicle at any time without needing the item. Follow the steps in DON'T INCLUDE ITEM

Note: How players acquire this item (e.g., through shops or crafting) is entirely up to the server owner.

INCLUDE ITEM

1

Config

Set Config.RequiresItem as true. Follow the steps below to set up the item according to your framework

shared/config.lua
-- Whether the neon controller item is required to open the neon controller menu in a vehicle
Config.RequiresItem = true  
2

Adding Item

Follow the steps to add the item, depending on your inventory script/framework. This resources offers direct support for qb-inventory, ox_inventory and qs-inventory, however can be configured to work with any other third-party inventory script

QB-INVENTORY

Set Config

shared/config.lua
-- The inventory script to check if the player has the neon controller item. Not required if the config above is set to false
Config.InventoryScript = 'qb-inventory'

Adding the Item

  • Navigate to the qb-core resource directory and open up qb-core/shared/items.lua

  • Paste the following lines into the file and save it

  • ['neon_controller_device'] = { 
        name = 'neon_controller_device', 
        label = 'Coffee', 
        weight = 500, 
        type = 'item', 
        image = 'neon_controller_device.png', 
        unique = true, 
        useable = false, 
        shouldClose = false, 
        description = 'Unlocks advanced vehicle lighting control and animated effects for neon lights' 
    }

Adding the Image

  • Navigate to the qb-inventoryresource directory and find the qb-inventory/html/images folder

  • Add the image ('neon_controller_device.png') into the folder

Restart Your Server

OX_INVENTORY

Set Config

shared/config.lua
-- The inventory script to check if the player has the neon controller item. Not required if the config above is set to false
Config.InventoryScript = 'qb-inventory'

Adding the Item

  • Navigate to the ox-inventory resource directory and open upox-inventory/data/items.lua

  • Paste the following lines into the table defined in the return statement and save the file

    ['neon_controller_device'] = {
        label = 'Neon Controller Device',
        weight = 500,
        stack = false,
        description = 'Unlocks advanced vehicle lighting control and animated effects for neon lights'
    },

Adding the Image

  • Navigate to the ox-inventory/web/images folder

  • Add the image ('neon_controller_device.png') into the folder

Restart Your Server

QS_INVENTORY

Set Config

shared/config
-- The inventory script to check if the player has the neon controller item. Not required if the config above is set to false
Config.InventoryScript = 'qs-inventory'

Adding the Item

  • If using qb-core, navigate to the qb-core resource directory and open upqb-core/shared/items.lua.

  • If using esx, navigate to the qs-inventoryresource directory and open upqs-inventory/shared/items.lua.

  • Paste the following lines into the file and save it

     ['neon_controller_device'] = {
        name = 'neon_controller_device',
        label = 'Neon Controller Deice',
        weight = 500,
        type = 'item',
        image = 'neon_controller_device.png',
        unique = true,
        useable = false,
        shouldClose = false, 
        description = 'Unlocks advanced vehicle lighting control and animated effects for neon lights'
    }

Adding the Image

  • Navigate to the qs-inventory/html/images folder

  • Add the image ('neon_controller_device.png') into the folder

Restart Your Server

ANY OTHER INVENTORY

Set Config

shared/config.lua
-- The inventory script to check if the player has the neon controller item. Not required if the config above is set to false
Config.InventoryScript = 'other'

Add Custom Fuel Reading Code

  • Open up 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).

    • shared/server-functions.lua
      
      
      function checkForNeonControllerItem(player)
          local hasItem
      
          -- qb inventory
          if Config.InventoryScript == 'qb-inventory' then
              hasItem = exports['qb-inventory']:HasItem(item, amount)
      
          -- ox_inventory
          elseif Config.InventoryScript == 'ox_inventory' then
              hasItem = exports.ox_inventory:GetItemCount('neon_controller_device', {}, false) > 0
          -- qs-inventory        
          elseif Config.InventoryScript == 'qs-inventory' then
              hasItem = exports['qs-inventory']:Search('neon_controller_device') > 0
      
          -- any other inventory   
          elseif Config.InventoryScript == ' other' then
              -- If you are using any other inventory script, just add the code that checks if the player has a 'neon_controller_device' item
              -- Set the boolean result equal to hasItem
          end
      
          return hasItem
      end
    • Utilize exports or any means from your inventory script to check if the player has a 'neon_controller_device' item, and set it equal to the hasItem variable

3

Notification

Set Config.RequiresItem as true. Follow the steps below to set up according to your framework

shared/config.lua
-- Whether the neon controller item is required to open the neon controller menu in a vehicle
Config.RequiresItem = 'true'    
QB CORE

Set Config

shared/config.lua
-- The notification script used to inform the player if they do not have the neon controller item
Config.NotifyScript = 'qb-notify'
ESX_NOTIFY

Set Config

shared/config.lua
-- The notification script used to inform the player if they do not have the neon controller item
Config.NotifyScript = 'esx_notify'
OKOKNOTIFY

Set Config

shared/config.lua
-- The notification script used to inform the player if they do not have the neon controller item
Config.NotifyScript = 'okokNotify'
MYTHIC_NOTIFY

Set Config

shared/config.lua
-- The notification script used to inform the player if they do not have the neon controller item
Config.NotifyScript = 'mythic_notify'
ANY OTHER NOTIFY

Set Config

Add Custom Fuel Reading Code

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

  • Edit the last elseif statement in the notifyUnableToOpenNeonController function.

    • Utilize exports or any means from your notify script to notify the player that they do not have a neon controller item

DONT INCLUDE ITEM

1

Config

Set Config.RequiresItem as false. The rest of the configs can be left as is

shared/config.lua
-- Whether the neon controller item is required to open the neon controller menu in a vehicle
Config.RequiresItem = false

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 database.sql , using your database software.


Enabling Onesync

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

Last updated