By adding your steam, discord, or fivem id to admin via Cofig, you can authorize players to “add_lightbar_perm id number” in the game, if you leave the number blank, you can only access the lightbar menu by typing 1 instead of number, authorizing the player to use the “add_lightbar_perm” command. bkz: adminIdentities = { "fivem:1082143", "discord:668001028939055124" }, – fivem id, discrod id or hex id
After you have been authorized to add lightbar to the vehicle, use /addlb, go to the vehicle and press E to access the menu.
Left CONTROL to turn on the siren lights, use the H key to turn on the sounds and the Left ALT key to change the tone, and you can change the keys from the game to the keybinds settings
Features
You can use the built-in authorization system to access the menu or disable the authorization system via config
You can add lightbar to any tool, set or remove locations at any time
exports.nakres_lightbar:loadLightbarInCar(vehicle); you can add the code to the vehicle spawned function of your garage script to reproduce the created lightbars
Fully optimized 0.0 to 0.1 resmons
A standalone version that does not require any framework , all data is retained in the json data
it does not need an extra authorization system, it has its own authorization system, after defining the authorization from config.lua, you can authorize the person you want using the authorization code in the game, the necessary explanations are located in config.lua.
The local vehicle variable you created already takes the vehicle you are in. What you need to do is to pass the newly created vehicle object as a parameter in the code block that creates the vehicle when it is retrieved from the garage for the garage script you are using. I provided an example of how to do this for qb-garages in a previous response, and you can adjust it accordingly for your own garage script.