Spotlight - Enhanced Sync

A spotlight script for FiveM/FivePD. Syncing is done through a builtin FiveM system and requires no server-side events.

Download v1.2.3

NEW IN v1.2.3:

  • Spotlights can now be controlled from directly outside the last vehicle a player entered.
  • Destroyed vehicles no longer retain their spotlight.
  • Added a config option for disabling the “Spotlight: on/off” message (show_message)
  • Fixed a bug which caused spotlights to not sync properly.

INSTALLATION::

Just drag and drop the “spotlight” folder from the .zip file into the resources folder and add “ensure spotlight” to server.cfg

Demo Video

Controls:

The default keybindings are:

  • L: Toggle spotlight
  • Page Up: Aim spotlight up
  • Page Down: Aim spotlight down
  • Delete: Aim spotlight left
  • End: Aim spotlight right

All keys can be changed in the game’s options menu, under the FiveM tab in keybindings.

License: GNU Lesser General Public License v2.1
Source: GitHub - michaelcerne/spotlight: FiveM/FivePD Spotlight script

26 Likes

Great script I just tested it.

Suggestion: Make it so that you can only move the spotlight when really close to the car (from outside). As currently you can move it even if you are not near the vehicle.

Will add a range check next update. Thanks for the feedback.

Please when you add the range check, add also a config for keybindings, as some of us already have those keys used by other things ^^

You can already change the keybinds in:

Esc > Settings > Keybindings > FiveM

I mean the script keys, as in my server, for example, Del is vMenu’s key, and Pg Up is Vehicle Interaction Menu, so I’d like to customize the keys used by this script to other keys…in the script, not in FiveM as it would change my other script’s keys too…

1 Like

It’s not a default keybind. These are separate and don’t interfere with any other keys so there is no point for a config file to change the keybinds when you already can.

1 Like

good release.

so you are saying that if someone has noclip mode (vmenu) on page down it wont matter. Because when you hit “L” to toggle light it takes over anything thing that might have been bound to page down…

vmenu + page down = no clip
vmenu + spotlight + pagedown = Aim spotlight down

Great release!

Any chance you can get it to work for a passenger in the vehicle as its only visible in the passengers eyes

That’s odd. vMenu uses the old key system from the dark ages, haha. I’ll see if there’s anything I can do on my end, but it might be worth a shot to reach out to them on their issue tracker.

Thanks for the feedback.

Sorry, could you elaborate a little bit? You’re only seeing the spotlight when you’re in a vehicle as a passenger?

You can change the spotlight keys completely independently of other script’s keys. I do see the appeal in being able to set a different default, though, so players don’t even have to worry about going into their settings.

1 Like

Nice! Good work :slight_smile:

you should made a config to change the keybinds at the very least

Config coming in v1.1!

If you are a passenger in the vehicle and press “L” for the light - only the passenger will see the light and no one else will.

Thanks for the update. I’ve created an issue for you and I’ll get it sorted out.

Is there a way to increase and decrease the brightness?

I spent some time converting this to lua earlier today, just to find out that GetAllVehicles() native is broken for lua :rage:

1 Like