Vehicle Spotlight System (px_spotlight) | Advanced spotlight management system

ezgif-2-d3ee751ff8


What does it do?

Implemented with the exclusive FiveM state-bag system, this resource adds an essential tool to your police roleplay toolkit - an advanced spotlight system.

  • Mouse-guided beam for navigation, with customizable rotation radius
  • Passenger controllable, allowing partners to manage the spotlight on their side
  • Fluid and synchronized movement across all players, casting realistic light
  • Spotlight lock mode for focused illumination and coverage of blind spots
  • Dynamic tracking mode for vehicles, animals, and pedestrians
  • User-friendly interface in the bottom-right corner, displaying current mode and details
  • Remains activated even after exiting the vehicle
  • Switch between strobe and passive mode
  • Customizable spotlight position via simple UI
  • Spotlight intensity, offsets and parameters are fully configurable
  • Seamless integration with all FiveM roleplay frameworks
  • Easy installation with drag-and-drop functionality
  • Use the /editspotlight command to adjust spotlight position

:ballot_box_with_check: This resource conforms to all recommended development practices for FiveM.

We have ensured that it is lightweight, uses state bags and implements functionality for native keybindings. When idle, px_spotlight consumes 0.00% of all resource manager tick CPU time.

No snails were injured in the making :hushed:.


Video Preview

The video preview demonstrates all functionality, configuration options and locale support.

:camera: Direct Link: FiveM - Vehicle Spotlight System on YouTube

Showcase Server

We also offer a showcase server to try out our resources for free. You can connect using the Cfx.re join link below, or by typing connect showcase.phynix.gg directly into your F8 client console.

  • To spawn a police vehicle, use the command /veh sheriff2.
  • Use /settime 23 to set the current time to night.

:joystick: Direct Link: Connect to Phynix Project Showcase

The server can also be found by searching for “Phynix Project Showcase” on the FiveM server list.


Purchase

:shopping_cart: Direct Link: Vehicle Spotlight System on the Phynix Project Webstore

For any issues with the resource or your purchase, please leave a comment below. You may also send me a direct message on the Cfx.re forums. Contact us by email: support@phynix.gg.

Code is accessible Partially (configuration & UI)
Subscription-based No
Lines (approximately) 1000
Requirements None
Support Yes (comments or DM)
Languages Lua, JS, HTML, JSON

Installation

No prior coding knowledge is required. The resource comes with a full configuration file giving complete freedom over specific actions. Supports multiple languages through locale files. To install:

  1. Drag and drop the extracted px_spotlight folder into your resources directory.

  2. Add the line ensure px_spotlight to the bottom of your server.cfg file.

  3. Start your server and enjoy your new resource.

Specifically, you can find configuration options in px_spotlight/shared/config.lua. You can either create your own locale within px_spotlight/locale, or edit the existing locale en_US_.lang to change language. That’s pretty neat. :safety_pin:

Dependencies

No additional resources are required, this script is fully standalone. :eggplant: .


Changelog

Version Date Notes
1.0.0 06/12/2023 Initial Release
1.0.1 07/12/2023 Bug fixes & optimizations

Please post any questions below. Be nice :slightly_smiling_face: . Enjoy!

4 Likes

how’re you syncing it without network event overflow? My best guess would be state bags

1 Like

Hi @nathangladney,

As mentioned in our initial post, we use state bags to synchronise state between clients.

Let me know if you have any further questions. :slightly_smiling_face:

Thanks.

As always, very talented work from Distritic! Definitely would recommend for those seeking immersion in their gameplay!

1 Like

Hey awesome release whats the resmon?

1 Like

Hi @FurmaZ,

You can try out this script on our showcase server, and check the values for your machine specifically.

  • To spawn a police vehicle, use the command /veh sheriff2.
  • Use /settime 23 to set the current time to night.

:joystick: Direct Link: Connect to Phynix Project Showcase


For my machine, the values are:

  • 0ms when idle
  • 0.08-0.15ms when running (with vehicles in your scope)

Please note that the running value will always be relatively high due to time taken to graphically render a light using DRAW_SPOTLIGHT_WITH_SHADOW. Naturally graphical rendering (especially with shadows) is expensive, and it would not be possible to draw the light otherwise. This value will also depend on your hardware specification.

As such, changes in implementation would not reduce this overhead. The implementation is already incredibly optimized and primarily event-driven, without any loops or processes running unnecessarily.

1 Like

goated always coming out with straight heat

1 Like