Spotlight - Enhanced Sync

You know we can have the spotlight actually move on vehicles now the model moves with the light, I really don’t see a need for this script anymore as that is outdated!

That’s been added for the next release. Stay tuned.

1 Like

Having options is good, and this script is going to have much more customization in the future.

1 Like

If anyone is interested in the broken lua version, here it is.
client.lua (5.1 KB)

Once GetAllVehicles() native is fixed for lua (if it gets fixed) this script should work just fine.

What’s New in Version 1.1.0

fxmanifest.lua now contains a config for customizing certain aspects of the script:

emergency_only 'true' -- Only allow spotlight usage in emergency vehicles ('true'/'false')
remote_control 'true' -- Allow players to aim the spotlight in the last vehicle they entered ('true'/'false')
brightness_level '30' -- Brightness of the spotlight once it's "warmed up" ('{positive number}')
aim_range_left '90' -- How far left from center the spotlight can be aimed in degrees ('{positive number}')
aim_range_right '30' -- How far right from center the spotlight can be aimed in degrees ('{positive number}')

An update checker has also been added to alert server owners of new releases in the console.

Very cool, that’s the whole reason why I re-wrote it in lua, so that people could easily change settings without having to recompile it. Still pissed about that damn GetAllVehicles() not working lol.

Edit: You forgot to include changing the keybinds.

i was just trying to get confirmations on how the key bindings work,

Yeah, I’ve got keybind customization disabled for now due to the way FiveM handles keybinds. When you change keybinds on one server running the script, it’ll change them for every server running them that you play on (it’s stored locally, on your machine).

Only thing I can think of is randomizing the resource name for each server so FiveM won’t sync the keybinds, but that seems like a weird solution. Not sure yet. Let me know if you’ve got ideas.

See the above post. Individual players can customize their own keybinds that persist between every server.

I think you’re over thinking this. As the resource SHOULD NOT carry over from server to server as the cache should and will be different.

Also, this isn’t a client-side installed script so, you’re not correct in the above statement.

Nope, it’s actually stored on your local machine in %appdata%\citizenfx\fivem.cfg. That’s how the new system works. I didn’t decide that.

Quick question, will this/is there a way for this to work with the polmav? Thanks for the great script

Working on that as we speak.

Well here’s the thing, I don’t care about other people’s servers, so it really has no effect on me. But personal feelings aside, if a user went to another server with this resource, why wouldn’t that server push the new binds to the client like it does everything else?

I’m failing to see why having this bind configurable is an issue.

Nope doesnt work

There’s virtually no way for me to change the keybind per server as far as I’m aware unless I generate a random resource name for every single download (which I can’t).

Again, why does this even need to be done? The binds will just be overwritten. Never in the history of fivem has this been an issue with ANY other resource. And there is nothing special in your code making it any different. I’m not trying to be rude, I’m just pointing out the fact that you’re making a non-existent issue, an issue for no reason.

IsControlJustPressed

Works the same in all languages.

Using the native you suggested, clients wouldn’t be able to change the keybinds on their own, and we’d be leaving controller users or those with alternate keyboards in the dust.

I just looked at the FiveM cookbook and it says they’re trying to implement “gbinds” which are like the current system but not saved on the client. Hopefully that gets implemented soon, and I’ll add support ASAP.

Why not?

You could make a chat command to change the binds, having it save server side, eliminating the need to save it client-side. And in all honesty, nothing should be saved and relied upon client-side ever.

I’m not even a fan of leaving it up to the end user to be able to change such binds as this, because they could fuck it up and overlap another bind and not know how to fix it later.

1 Like

I would prefer setting the keybindings server sided over client side. it makes things simpler as i can produce a excel sheet of all the server keybindings but,
The keybindings are not showing up in the pause menu, so i can not change them. as well as no light actives either way.
dont know if its something i did