Installation and Setup
Installation
Follow the steps below to claim your resource and install it
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
Add Resource to Server
Unzip the
md-neoncontroller.zipfolder and place the extracted folder into your servers resources folder (or any sub folder)Open your servers
server.cfgfile and writeensure md-neoncontrolleranywhere 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
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
-- 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-coreresource directory and open upqb-core/shared/items.luaPaste 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 theqb-inventory/html/imagesfolderAdd the image (
'neon_controller_device.png') into the folder
Restart Your Server
OX_INVENTORY
Set 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 = 'qb-inventory'Adding the Item
Navigate to the
ox-inventoryresource directory and open upox-inventory/data/items.luaPaste 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/imagesfolderAdd the image (
'neon_controller_device.png') into the folder
Restart Your Server
QS_INVENTORY
Set 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-coreresource 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/imagesfolderAdd the image (
'neon_controller_device.png') into the folder
Restart Your Server
ANY OTHER INVENTORY
Set 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 = 'other'Add Custom Fuel Reading Code
Open up the shared functions file found in
shared/functions.luaEdit the last elseif statement in the given
GetFuelLevelfunction.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
hasItemvariable
Notification
Set Config.RequiresItem as true. Follow the steps below to set up according to your framework
-- Whether the neon controller item is required to open the neon controller menu in a vehicle
Config.RequiresItem = 'true' QB CORE
Set Config
-- 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
-- The notification script used to inform the player if they do not have the neon controller item
Config.NotifyScript = 'esx_notify'OKOKNOTIFY
Set Config
-- The notification script used to inform the player if they do not have the neon controller item
Config.NotifyScript = 'okokNotify'MYTHIC_NOTIFY
Set Config
-- 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.luaEdit the last elseif statement in the
notifyUnableToOpenNeonControllerfunction.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
Database Setup
Installing oxmysql
This resource uses oxmysql for all database interactions. To install, follow the instructions listed at https://overextended.dev/oxmysql.
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