[Free] Real Brake Lights

A simple script that enables brake lights while stopped on player vehicles.
I made this to pair with Ultimate Lighting Controller!

FEATURES

  • Syncs across vehicles
  • Great performance (0.01 - 0.02 both client and server)
  • /blackout command to disable effect

DOWNLOAD

VIDEO

:clap:

CREDITS
@MadsL for most of the logic added in v1.1.0

14 Likes

Thank you for the share !

1 Like

Hmm… Wouldn’t it be better to use statebags? And maybe also use low-level game events such as CEventNetworkPlayerEnteredVehicle instead of the while true loops? :thinking:

4 Likes

Definitely on the stage bags, did not think of that this time for some reason. I’m not particularly good at using state bags with entities so I could try to brush up on it and rework.

Using vehicle enter exit events are probably also a good idea to keep things stable and clean.

1 Like

Nice to hear! Btw, feel free to comment here or contact me if you need any help, best wishes! :smile:

2 Likes

i have a snippet that does this. want me to post it here.?

Great idea! Does this require your ULC script to use or can this be used by itself?

1 Like

No this is standalone!

does the snippet sync it between clients?

im not sure tbh would like to share it here tho to find out if what im useing is worth useing or if yours is more optimised. if its okay for me to share it

1 Like

Sure go for it

Citizen.CreateThread(function()
while true do
– Loop forever and update every frame
Citizen.Wait(0)

    -- Get player and vehicle player is in
    local player = GetPlayerPed(-1)
    local vehicle = GetVehiclePedIsIn(player, false)

    -- If player is in a vehicle and it's not moving
    if (vehicle ~= nil) and (GetEntitySpeed(vehicle) <= 0.25) then
        -- Set brake lights
        SetVehicleBrakeLights(vehicle, true)
    end
end

end)

idk why it came out like that lol

Yeah this would only change the client/player’s own vehicle, and only on their screen.

so i added yours to the server and client of my small resources folder and it was spamming my f8 menu slowly with GetNetworkobject: no object by ID 0. has there been a update or anything to fix this or has anyone else had this issue.?

1 Like

Probably just a bug in the handling of the table. It’s just a warning though, the worst part of it is the console printing.

I’ve not experienced it very consistently on my end, just once in a while. Whenever I get around to working on this again I’ll try to eliminate that.

Hey what\s your discord? invite link doesn’t work.

v1.1.0

  • Re-wrote resource to use state bags thanks to @MadsL
  • Added /blackout command that disables effect
    • effect is re-enabled once you start driving again

Find updated release here

1 Like

wheres the diffrence between the normal brakes in game ???

By default they don’t stay on when you come to a stop. It’s as if the vehicle was put in park immediately as soon as the vehicle stops.

Which gives me an idea actually! It would be cool if after some time, the lights turned off (as if the vehicle was put in park).

1 Like