A modern realisation on seatbelt scripts, for additional roleplay and realism to your server.
Hover over anything underlined or a question mark ? for extra info.
(Optional) Copy config.default.lua, rename the copy to config.lua and edit it to your liking.
Add the following to your server.cfg:
ensure seatbelt
(Optional) add_ace group.police seatbelt.notify allow
Replace police with your LEO group.
This is optional if you donât use ACL - read Configuration.
Features
Modern Seatbelt does the following:
Buckle up with /seatbelt or K.
Keybinds can be changed in FiveM keybind settings.
Realistic sound effects for buckling & driving w/o SB.
Coming Soon
Features that are planned for Modern Seatbelt:
Complimentary scripts for compatible UI support.
Configuration
Note: Do not edit config.default.lua
Copy config.default.lua and rename the copy to config.lua.
Check config.lua for better details.
property
description
LeoCheck = 2
The method this script should use to check whether a player is an (on-duty) LEO. 1 = be inside a police vehicle; or 2 = have the seatbelt.notify ACL.
PlayerIdentifierType = 1
What type of LEO notifications should be shown? 1 = Player ID (i.e. âPlayer 7â) 2 = Seat position (i.e. âDriverâ, âPassengerâ, âRear left passengerâ, âFar rear left passengerâ) 3 = Username (i.e. âHagen Hyenaâ, â1D-32 Backer P.â)
Distance = 20
The amount of distance LEOs have to be to detect people not weaing a seatbelt.
@TehRamsus for their Seatbelt script, which inspired me to create Modern Seatbelt.
@Mercy3 for providing and giving permission of use of static/assets/{buckle,chime,unbuckle}.ogg files.
Licensed under MIT License. No code or assets of the inspiring work has been used.
The author of Seatbelt stated they would rework their original work but has not done so since Oct 25th, '21, hence my release.
Added a config.lua to allow customisation of the default keybind, distance and LEO alert.
Added custom vehicle config, remove seatbelts from seats or even make the script pretend theyâre always wearing one for specific vehicles.
Thereâs now a more varied selection of LEO alerts (previews soonâ˘ď¸):
Player ID. Rough example: Player 7 is not wearing a seatbelt in AXZB893.
Seat name. Rough example: Rear left passenger is not wearing a seatbelt in DTY178X.
Player username. Rough example: 1K-37 Hagen H. is not wearing a seatbelt in BVYIFFX.
Update Now
Simply do git pull if you cloned the repository using Git.
If you did it the manual way, download from here.
Is there anyway to adjust the sensitivity of the ejection from the car? For example right now I feel as if very light crashes cause the player to fly out of their vehicle, would there be a way to make it so that it would need to be a more intense crash in order for them to be ejected from the car?
If you like unrealism, you can change the hardcoded minimum speed for ejection (which is 50kmh) on this line, by changing the integer 50 to your desired speed.
Note: This does not change the force of inertia or velocity required for an ejection to occur, but only the minimum speed of when it can occur.
Hi @Griefs, good script I like it, one thing im struggling with though is how to change the notification at the top left to say the key I just changed the seatbelt too? Are you able to help with where that would be?
Greetings, I just wanted to recommend a few things if your willing to work on this script still are sounds ever going to be implemented? I really like the script just wish there was unbuckling and buckling sounds and maybe some chimes when your seatbelt Isnât on while driving? You could add it as a option in the config file as well. This is a really well made script love the detection system for LEO although id like to see a vehicle whitelist system to it rather then the entire emergency category to due fire/ems also getting seatbelt alerts when it should be primarily for LEO still works great! I feel like this would make it 10x better thanks for this amazing seatbelt script either way!
Sound will be implemented once I create them or find non-commercial licensed sounds online. Anyone can suggest sounds theyâve created or found online and I will implement them.
If you want alerts to be given to LEO only, you can create a pull request or issue with the framework you are using so it may be implemented. If youâre not using a common framework, you can monkey patch the code yourself: util.lua#L24
Thanks for the reply, I have sounds that could be used if your interested also I meant the alerts for vehicles in the sense when you open the Config.lua you could have a section called âalertvehiclewhitelistâ or something similar and in that table youâd do âVehiclespawnnameâ, etc if you understand what im trying to say by that I can provide images if youâd like so you have a better understanding.
I made these sounds a while ago about 7 months ago I made them for my friend and his developers they needed sounds for their seatbelt and I decided to take it upon myself and create some for them at the time I have no use for them anymore and considering I have them unused I feel like it can save you some time then creating/searching for sounds and Iâm not a expert when it comes to LUA so I cant implement this into the script.
Understandable. Iâll attribute the credits to your forum profile.
I appreciate the assistance and will implement this when available. OP will be updated and a reply sent proceeding the bump in version.