Hello!
Today I am bringing you a new part/update of the Advanced Vehicle System project I am currently working on. This part of the project contains a simple, yet nice and effective reverse light system. It is not fully finished yet, still need some improvements and features, but I managed to get it done "partially", so I can show it to you.
This is compatible with every vehicle that has the "vehiclelightson128" texture, which most of the time happens with modded vehicles. But it definitely does with default vehicles.
[RED] = Unaffected lights [GREEN] = Affected lights
In action:
Currently this script has 3 custom functions and 2 custom events, these are:
setVehicleLightsOn(vehicle, state) - This is a workaround for the default setVehicleOverrideLights function. [server] setVehicleReverseTexture(vehicle, state) - With this function you can toggle the reverse light texture on/off. [shared] isVehicleReversing(vehicle) - Returns true if the vehicle is reversing, false otherwise. [currently server only]
onVehicleStartReverse - Parameters: driver, lightState [server] onVehicleStopReverse - Parameters: driver, lightState [server]
driver: The player who drives the vehicle
lightState: The light state of the vehicle (true/false). This returns the value set by setVehicleLightsOn function. Always returns something.
The source of these events is the vehicle that starts/stops reversing.
These events are triggered when a vehicle starts/stops reversing.
More updates coming soon!
I always like to read suggestions, so feel free to comment your thoughts and what should I add/remove!
Thank you for reading, hope you like it!
Part of the Advanced Vehicle System project.