I'm writing a scenario that involves driving without working headlights as the sun is going down, and you have to rely on fog lights to see once it gets dark. (Disabling the headlights alone was a mess.) Problem is, electrics.setLightsState(n) exists to set the headlights to a certain state, but no such thing exists for fog lights, only electrics.toggle_fog_lights(). How can I tell if the vehicle's fog lights are already activated so that I can always enable them when the scenario is started or restarted?
Funny coincidence, a few days ago I've implemented direct set access for fog lights and lightbars. So after the next update you can set those values directly without any toggle logic.
Thanks meywue, I also was looking for the answer to this. That's great! The direct access to lightbars can be used to fix the annoying scenario bug(s) where you respawn at the wrong time and the toggle state gets flipped to the incorrect state. If only there was a brake interface (need to cut brake lines for scenarios like this one)... Thanks for all that you devs do.
Not to bump this thread, but how would I toggle the hazards if I wanted them to go off without user input?