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;
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.
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.
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 …any clues on why may this be happening ?