Configurable script that makes players blackout due to accidents when they are in a vehicle.
This script is fully configurable in the config.lua file.
Players can blackout due to rapid deceleration and/or due to vehicle damage, if enabled in the configuration file. You may also configure how long the player is blacked out, the threshold(s) required, and if controls are disabled when they’re blacked out.
The configuration file is listed below so you can see all of the options.
Download: Available on GitHub - https://github.com/SaltyGrandpa/salty_vehicleblackout Installation: Add it to your [resources] directory and add the resource to your server.cfg. This resource has no dependencies and should work with any/every framework.
config.lua:
Config = {}
-- Amount of Time to Blackout, in Miliseconds
-- 2000 = 2 seconds
Config.BlackoutTime = 2000
-- Enable blacking out due to vehicle damage
-- If a vehicle suffers an impact greater than the specified value, the player blacks out
Config.BlackoutFromDamage = true
Config.BlackoutDamageRequired = 25
-- Enable blacking out due to speed deceleration
-- If a vehicle slows down rapidly over this threshold, the player blacks out
Config.BlackoutFromSpeed = true
Config.BlackoutSpeedRequired = 45 -- Speed in MPH
-- Enable the disabling of controls if the player is blacked out
Config.DisableControlsOnBlackout = true
to be honest not the greatst what you can make ofc but i know you can do it better for my taste but thx for the release ofc and for you work it would be better that if you can make like heart diagram with sound and to disable control after a bigger crash and after 30sec he is comming back to himself i hope you understand what i mean
it would be nice to see this with a say seat belt implementation. no seat belt = longer time blacked out or possible death or flying out window? seat belt means short blackout or no black out at all etc. Might fork and add to this when i have time
Cool script, if anyone wants the screen to shake instead of blacking out replace this lines in the Client.lua file
local function blackout()
-- Only blackout once to prevent an extended blackout if both speed and damage thresholds were met
if not isBlackedOut then
isBlackedOut = true
-- This thread will black out the user's screen for the specified time
Citizen.CreateThread(function()
isBlackedOut = true
ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.1)
isBlackedOut = false
end)
end
end
Cool concept. If I have some extra time, I’ll add it in. Could just be a random chance upon entry of a car that you seatbelt, and based on that different things can happen
how could i put text on the screen when it happened saying “you were knocked out” and is it possible to have it go blurry for 5 seconds after you come back from the blackout?
really cool script. if you wanted to take it all the way implement the seat belt idea so they can put on a belt and if they choose not to put on a belt. a crash a high rate of speed should throw them thru the window and make them black out. and a crash at a high speed with a belt should only daze them for a few moments