[FIX] Fixing Lights on Emregency vehicles

Introduction

Hello Forums,

My name is Serena and I am here to help with fixing YOUR Emergency Lights this can either be because they are really DIM or they are all over the place and broken.

Picture

This is an really badly broken light system so how to fix this? I personally have had little broken lights in my server how-ever sometimes a vehicle will break when you add TO MUCH light to the server this can be by adding new vehicles or replacing vehicles.

Fixing Process

The fixing process doesn’t take to long but you just need to know what you are doing. Which for some that do NOT code can be hard to do. So let’s get in the 2 Sections that we will be covering. Dim lights (Barely to no glow) & Broken Lights (They are not on places supposed to be).

Dim Lights

Dim lights are an easy issue to fix you can install any visual pack or even a server sided visual pack. I personally always had ran a client side visual pack because if the way I play GTA but you can put it in your server to! Here is the code to make YOUR lights brighter in your server.

visualsettings.dat

car.headlight.day.emissive.on 180.00
car.headlight.night.emissive.on 105.00
car.headlight.day.emissive.off 0.000
car.headlight.night.emissive.off 0.000
car.taillight.day.emissive.on 200.0
car.taillight.night.emissive.on 150.0
car.taillight.day.emissive.off 0.00
car.taillight.night.emissive.off 0.000
car.indicator.day.emissive.on 250.00
car.indicator.night.emissive.on 220.00
car.indicator.day.emissive.off 0.00
car.indicator.night.emissive.off 0.000
car.reversinglight.day.emissive.on 35.00
car.reversinglight.night.emissive.on 15.00
car.reversinglight.day.emissive.off 0.000
car.reversinglight.night.emissive.off 0.000
car.defaultlight.day.emissive.on 2300.00
car.defaultlight.night.emissive.on 1500.00
car.defaultlight.day.emissive.off 0.00
car.defaultlight.night.emissive.off 0.000
car.brakelight.day.emissive.on 240.00
car.brakelight.night.emissive.on 180.00
car.brakelight.day.emissive.off 0.00
car.brakelight.night.emissive.off 0.000
car.middlebrakelight.day.emissive.on 210.00
car.middlebrakelight.night.emissive.on 160.00
car.middlebrakelight.day.emissive.off 0.00
car.middlebrakelight.night.emissive.off 0.000
car.extralight.day.emissive.on 350.00
car.extralight.night.emissive.on 160.00
car.extralight.day.emissive.off 0.000
car.extralight.night.emissive.off 0.00
car.emissiveMultiplier 2.00

client.lua

function stringsplit(inputstr, sep)

if sep == nil then

    sep = "%s"

end

local t={} ; i=1

for str in string.gmatch(inputstr, "([^"..sep.."]+)") do

    t[i] = str

    i = i + 1

end

return t

end

local function starts_with(str, start)

return str:sub(1, #start) == start

end

Citizen.CreateThread(function()

local settingsFile = LoadResourceFile(GetCurrentResourceName(), "visualsettings.dat")

local lines = stringsplit(settingsFile, "\n")

for k,v in ipairs(lines) do

    if not starts_with(v, '#') and not starts_with(v, '//') and (v ~= "" or v ~= " ") and #v > 1 then

        v = v:gsub("%s+", " ")

        local setting = stringsplit(v, " ")

        if setting[1] ~= nil and setting[2] ~= nil and tonumber(setting[2]) ~= nil then

            if setting[1] ~= 'weather.CycleDuration' then   

                Citizen.InvokeNative(GetHashKey('SET_VISUAL_SETTING_FLOAT') & 0xFFFFFFFF, setting[1], tonumber(setting[2])+.0)

            end

        end

    end

end

end)

resource.lua

files {

'visualsettings.dat'

}

client_script ‘client.lua’

So if you make a folder called visuals in your resources folder then add it to the server.cfg it will load and your lights will be brighter!

Vehicles Broken

Broken Lights are a common issue when installing LEO packs or EMS or any light pack that you can think off. Sometimes the codes of these ligths may interfere with othes and so they will break because 1 light takes priority over the other. How this works in a whole I am unsure about… But here is a quick guide.

  1. You open the folder of the vehicle that has broken lights.
  2. You open both the carcols.meta & carvariations.meta Files.
  • We will explain both files in it’s own section.
carcols
  1. You look for the vehicle that has the broken lights.
  2. You locate this line <id value="2101"/> it always consists of a number.
  3. You change this number to a random 6 string line. It would look like <id value="923478"/> for example. DO NOT Repeat already used numbers <id value="425133"/> Is invalid.
  4. Save he file and go to carvariations
carvariations
  1. You look for the vehicle like before.
  2. You locate this link <sirenSettings value="2101"/> of the vehicle that has the broken lights.
  3. You change the number in the sirenSettings value to be the same as in the carcols.meta
  4. Save the file and restart the resource.

If you did all steps correctly and restart the resource it may be fixed if it did not you may try again. For more info refer to below.

Other Details

It may take a few tries for the ligths to correctly fall in place again. I do NOT know why this is. All I know is that it sometimes may happen. Just restarting the resource is enough there is no need for a full server restart. There have only been 2 vehicles I had to remove due to it not wanting to fix.

Personally to view all these files I use Visual Studio Code. A good alternative is Notepad++

Video!

Here is the video guide!
As of 10:07 +2 4th of march.

(This video may still be procesing.)

CREDITS

I can not remember who made this pack please contact me if you are the creator and I will credit you!

3 Likes

You know that’s a great tutorial. Didn’t really help me since I have been fixing my lights in my server for over two years lol! But I’m sure it will help out others! Great job very detailed!

Hello!

No problem it was more of the fact that I don’t see alot of these type tutorials. Not on FiveM itself or on youtube! I have been fixing lights for 1.5 years now and thought to help out the commnuity by this post. It’s not very hard as explained but you do need to know what you are doing. There will be people who will benefit of this thank you for the comment!

  • Serena

No problem :grinning: my internet is out right now so thought I’d browse fivem on my phone but anyways like I said great tutorial! Hopefully it will help people in the end!

1 Like

I really appreciated this post. That being said, I’m running into a few vehicles that just refuse no matter what I do, to fix. sometimes the lights will suddenly flash on the screen, several feet away from the truck, other times it looks like they aren’t on at all. Any suggestions? It’s the libertyf150, libertyf250, libertyram and one other.

Hello, @Rio4201

I in my time as developer have not encountered this issue yet. I usually stick to the 6 digit rule. There for all my files have a number that can’t exceed 999999 and never duplicates either. So it would be 123456 if you’re lucky you can even do it with 7. I do know the pack you are referring to but make sure that no other vehicle uses the same number.

  • Regards,
    Nicole H. / Serena .

I actually came to understand that these are simply numbering assignments so that everything is neatly ordered accordingly in the files. Which is why when you look at certain .meta files for vehicles, you see that they are numbered very low, and the more vehicles you have and more additions you put in, the higher up they go. Interestingly enough, we went through all the trouble of reassigning index numbers only to discover that the biggest culprit wasn’t that the renumbering wasn’t working, but that we needed to restart the server. The lights fell right into place and everything worked correctly after the restart. Alot of wasted time for something that simply needed to be restarted. lol.