[RELEASE] [ESX] [Colorfull HeadLights] by MilutuS

Hi
There is a simple script to include color healights in your cars

Instalation:

  1. Download script and upload to your server
  2. Add “start esx_swiatla_ui” in your server cfg
  3. Import database from filles

Usage:

  1. Give item “zarowki” to player
  2. Use this item from your inventory

Video Medal - #1 Game Capture Platform to Record and Share Gaming Clips & Videos

DOWNLOAD [GITHUB]

If you download this leave :heart: here for motivation

EDIT: 1.08.2021 script no working bcs navitves in fivem was changed

20 Likes

Uhmm that’s a different way of doing it. Using a tablet system kinda nice job

2 Likes

Thanks m8

kinda pointless BUT I kinda like it lol good job dude

1 Like

Why can’t people actually write an sql file rather than just dumping their database?

Your sql is wrong by the way. In updated versions of ESX, there is no “ID” column in the Items table. You don’t need to add that to support older installs like your own. It will create the ID if the column exist automatically. That’s why it’s called “auto_increment”
Change to:

INSERT INTO `items` (`name`, `label`, `limit`, `rare`, `can_remove`) VALUES 
('zarowki', 'Kolorowe Żarówki', '1', '0', '1');

CREATE TABLE `owned_vehicles_headlights` (
  `id` int(11) NOT NULL,
  `plate` text NOT NULL,
  `color` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `owned_vehicles_headlights`
  ADD PRIMARY KEY (`id`);


ALTER TABLE `owned_vehicles_headlights`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
7 Likes

Another stupid thing you did. Your github resource is called “esx_colorfullheadlights” and yet your GUI is looking for “esx_swiatla_ui”.

Rename your github resource to “esx_swiatla_ui” so that it works right.

4 Likes

you cann not ESC The Tablet when you do this the script is hannging with the mouse in the screen

5 Likes

Nieśmiertelny tablet Grzybka.

1 Like

Now there is an issue (not the OP’s fault) if you use inventoryhud. Two UI’s open at the same time, one will get stuck. Easy fix though…

esx_inventoryhud - client/main.lua
Find:

RegisterNUICallback(
    "UseItem",
    function(data, cb)
        TriggerServerEvent("esx:useItem", data.item.name)

        if shouldCloseInventory(data.item.name) then
            closeInventory()
        else
            Citizen.Wait(250)
            loadPlayerInventory()
        end

        cb("ok")
    end
)

Replace “loadPlayerInventory()”, with:

closeInventory()

This will close the inventory hud after you use an item.

In esx_swiatla_ui - client.lua,
Find:

if IsPedInVehicle(ped, car, false) then
		if not MenuGUI then

Below that add:

Citizen.Wait(1500)

This will pause the opening of the colored lights GUI for 1.5 seconds to allow inventory hud to first close.

5 Likes

I still get that error. Haven’t messed with it yet because it’s not breaking the script.

can you share your inventoryhud script i finde nowhere that script that will be great

Dear Elena

This lights are not visible for other players, right?

1 Like

@Emkq
the other players can see it. I tested it last night

2 Likes

but the script duplicate the car in our garage script :smiley:

I don’t think dude this script use other table in your database

yes. i deactivate the script and it happens again. now i have to work on our garage script xD

After i selected the color, in few seconds it goes back to normal color. How do i fix that ?
In DB shows the color id etc but on the car it’s normal color.

Error :


Bug : Also the color will be attached to the plate number…If you sell your car, the color, id, plate, stays in the DB .

1 Like

Tested this last night, seems to work perfectly, but, the thing is, seems like it’s only on my end, since the rest of the staff still see my lights as default :frowning: …any clues on why may this be happening ?

1 Like

Thx man.