Configuration
Spotlight uses a config.json file to store config values.
JSON syntax is important: missing ,s, or []s will break the file. Check your JSON syntax with this website.
Value List
Values Explained
Spotlight Distance
SpotlightDistance
This value controls the distance a spotlight will be drawn with.
Spotlight Brightness
SpotlightBrightness
This value controls the brightness a spotlight will be drawn with.
Spotlight Roundness
SpotlightRoundness
This value controls the roundness a spotlight will be drawn with.
Spotlight Radius
SpotlightRadius
This value controls the radius a spotlight will be drawn with.
Spotlight Falloff
SpotlightFallOff
This value controls the falloff a spotlight will be drawn with.
Spotlight Minimum Angle
SpotlightMinAngle
This value controls how far to the left a spotlight can be angled.
Spotlight Maximum Angle
SpotlightMaxAngle
This value controls how far to the right a spotlight can be angled.
Kick Cheaters
KickCheaters
If true, the script will kick players it thinks are abusing the script.
Even if false, script will log suspect players to the console.
Command
Command
The name of the command that can be used instead of the keybinds to toggle the spotlight.
Default Primary Keybind
DefaultPrimaryKey
The keyboard mapping name for the key to use for the primary keybind.
For a full list of options, see here.
Because FiveM's keymapping is used for the primary keybind, once a player joins the server for the first time while Spotlight is running, the keybind will be saved. To change the keybind for existing players, they must go to their in-game settings > keybinds > FiveM > Toggles vehicle spotlight.
Secondary Keybind
SecondaryKey
The control id to use for the secondary keybind - by default this is mapped to Sprint / Left Shift (21).
For a full list of options, see here.
Vehicle Extras Mapping
VehicleExtras
Configuring this optional value will allow the resource to set the correct extras on a vehicle when the spotlight is toggled on or off.
For example, if we have a vehicle with the spawn name police_car, and it has 4 spotlight extras as below:
- Extra 1: Driver spotlight flipped down
- Extra 2: Driver spotlight flipped up
- Extra 3: Passenger spotlight flipped down
- Extra 4: Passenger spotlight flipped down
The config for the above would look like so:
[
{
"ModelName": "police_car",
"DriversSide": true,
"DisabledExtra": 1,
"EnabledExtra": 2,
"EnableHighBeams": false
},
{
"ModelName": "police_car",
"DriversSide": false,
"DisabledExtra": 3,
"EnabledExtra": 4,
"EnableHighBeams": false
}
]
Vehicle Mod Mapping
VehicleMods
Configuring this optional value will allow the resource to use mod kits as spotlights, on vehicles that don't have existing functional spotlights. When configured, the resource will change the mod kit based on the spotlight on/off state (i.e., flipped up for on, down for off).
The steps required to add a vehicle mod are covered on here.
Vehicles with Persistent Spotlights
VehiclePersistents
For vehicles that have spotlights that are persistent or permanent, meaning that cannot be removed via extra or mod kits, they can be added to this config option.
All that is required is the vehicle model name, if the spotlight is the driver's or passenger's, and the position of the spotlight.
The config for the above would look like so:
[
{
"ModelName": "police_car",
"DriversSide": true,
"LightPosition": { "x": 1.0, "y": 1.0, "z": 1.0 },
"EnableHighBeams": false
}
]
To get the light position, use the Placement Tool.
Spotlight Ignoring
VehicleSpotlightIgnores
Configuring this optional value will tell the resource to ignore specific spotlights.
For example, if we have a vehicle with the spawn name police_car, and it has 4 functional 'spotlights'.
If however, one of these spotlights is part of the headlight assemble instead of a spotlight, you can tell the resource to ignore it.
Entries for this config option look like the below:
[
{
"ModelName": "police_car",
"SpotlightNumber": 2
}
]
ModelNameis the name of the vehicle model.SpotlightNumberis the spotlight index on that specific vehicle, use the/spotlight debugcommand to find it.
Custom Spotlight RGB Colors
VehicleCustomRGB
Configuring this optional value will tell the resource to use a specific RGB color value for designated model spotlights.
Entries for this config option look like the below:
[
{
"ModelName": "police_car",
"RGB": { "r": 255, "g": 0, "b": 255 }
}
]
ModelNameis the name of the vehicle model.RGBis the color code to use, see here.
r, g, and b must be lowercase.
Ignored Vehicle Classes
IgnoredVehicleClasses
Configuring this optional value will tell the resource to disallow spotlights on the listed vehicle classes.
This only applies for automatically detected spotlights; if a vehicle has an entry in VehicleExtras, VehicleMods, or VehiclePersistents, they will ignore this config option and work regardless.
Vehicle class list
The classes must be worded exactly as below.
For example, OffRoad cannot be Off-Road.
CompactsSedansSUVsCoupesMuscleSportsClassicsSportsSuperMotorcyclesOffRoadIndustrialUtilityVansCyclesBoatsHelicoptersPlanesServiceEmergencyMilitaryCommercialTrains
Entries for this config option look like the below:
[
"Cycles",
"Trains"
]
Ignored Vehicles
IgnoredVehicles
Configuring this optional value will tell the resource to disallow spotlights on the listed vehicles.
This config option takes priority overs, meaning even if a vehicle is listed in VehicleExtras, VehicleMods, or VehiclePersistents, if it is listed here, it will be disallowed.
Entries for this config option look like the below:
[
"police",
"police2"
]
Default Config File
{
"SpotlightDistance": "40",
"SpotlightBrightness": "8.5",
"SpotlightRoundness": "7",
"SpotlightRadius": "20",
"SpotlightFallOff": "30",
"SpotlightMinAngle": "-60",
"SpotlightMaxAngle": "65",
"KickCheaters": "false",
"Command": "spotlight",
"DefaultPrimaryKey": "LCONTROL",
"SecondaryKey": "21",
"VehicleExtras": [],
"VehicleMods": [],
"VehiclePersistents": [],
"VehicleSpotlightIgnores": [],
"VehicleCustomRGB": [],
"IgnoredVehicleClasses": [],
"IgnoredVehicles": []
}