[Release] Lightbar Menu Script: Attatch Lightbars to ANY vehicle w/ Sirens

Version 0.2
Last Updated 4/18/2021

Over the course of several months, I have developed a menu that allows you to add lightbars on any vehicle you want. The basic premise is that you drive a vehicle to designated areas, (Defaultly garages as all police departments) hit F6. You will be met with a menu and are able to select which type of lightbar you wish to spawn. Then, use your Arrow Keys and other keys indicated by the hint to move and rotate the lightbar. When you have placed it where you want it to be attached, simply hit SPACE and it will be attached. You may add multiple lightbars to the same vehicle and they are usable by all players. I have previously been holding off on releasing this script, as I intended this to be used privately, however, have recently changed my mind.

DOWNLOAD LINK:

Videos and Images

Demonstration Video

Key Bindings

Open Menu: F6
Move Forward: Up Arrow Key
Move Backward: Down Arrow Key
Move Left: Left Arrow Key
Move Right: Right Arrow Key
Move Up: Page Up
Move Down: Page Down
Flip: INS and DEL (Above arrow keys)
Cancel Lightbar Placement: Backspace
Confirm Placement: Space bar
Activate Lights: Q
Activate Horn: E
Activate Sirens: G
Cycle Siren Tones: Left Control

Installation

Simply Drag into your resources folder and add both resources to your startup list in the server config
Note Make sure you start the NativeUI resource before the others and start all three of them in order for everything to work properly.

EXTREMELY IMPORTANT: Currently, the menu is accessible by all players, meaning that anyone can use it. In order to defeat this, you must replace the commented out if statement on line 435 with whatever your server uses to check if the player is an on duty officer.

Note for ESX users: I believe the following line should work, but I am not familiar with ESX, so donā€™t quote me on it.

if(ESX.TriggerServerCallback(ā€˜esx_service:isInServiceā€™, function(isInService)) then

Someone commented that this might work also, but yet again, not sure:

if(ESX.GetPlayerData().job.name == ā€œpoliceā€ or ESX.GetPlayerData().job.name == ā€œcnpā€) then

Additional Notes

This script has not been tested on a large scale and consequently may have minor glitches. Please report these so they can be fixed. If you have any questions as to how to do something, feel free to ask.
Finally, I have invested many months into making this work and brainstorming ideas. Please do not pass this off as your own.

Important:

Locations where menu is accessible by default:



Updates

Unfortunately, I have not had much time to continue working on this script, so it might be rather out of date. Several comments have suggested that this script has issues running one OneSync servers, which very well might be the case considering I only ever tested this on a default, 32 slot server. I will attempt to look into this and possibly fix it shortly.

Update 0.2:

  • Added additional ESX compatibility statement to installation notes
48 Likes

Wow! Really clever idea I love it! I suggest adding a video of the menu also so we can see what we are working with before we download it.

2 Likes

Thank you! I will be uploading a video of it shortly once fivem is back up and running smoothly. Currently canā€™t launch my game.

2 Likes

Holy shit, this is amazing. I love this!

2 Likes

I seem to be having trouble trying to open the script, is there any mods that conflict with it?

1 Like

Unfortunately it does not work. All resources started fine but nothing comes up after hitting F6 :frowning:

Hmmmm.

1 Like

All works perfectly for me , a realy good script and perfect for my undercover police :heart_eyes:

2 Likes

it works but the light bars dont spawn

and the lights wont move around

Is it possible to add an ESX Option so only Police Officers can open it?

2 Likes

It is possible, but you have to code it for yourself as I guess.

Just look at the code from esx_scenemenu thatā€™s basically it just be smart and paste it in the lightbar script ^^ :slight_smile:

So I have tired all Police Departments and i can not get the menu to open. Any help would be great and thank you.

1 Like

This script looks amazing! But I just have one small problem. Is it possible to change the key-bind for the menu to open? I want to change this one mainly because it conflicts with another menu we use in the server, which I donā€™t know where is in the filesā€¦ :confused: But Iā€™d love if someone knew where to change the key-bind. Thank you, nice script. :slight_smile:

Same problem

Suggestion under installation tab might work, I haveā€™t used ESX, so I donā€™t know the proper commands, but if you look around Iā€™m sure you can find it if my thing doesnā€™t work.

It will take a second, it has to download them

It only works at certain locations, I have added a section that indicates said locations where the menu is accessable

Is it possibly you can add a picture of what the menu looks like?