[FREE] [RELEASE] Tyre damage (Force vehicle to stop when tyres have popped)

Version 1.1.2 --Created by StaceyBee–
Created 20/2/22
Updated 20/3/22

–[[ INTRO]]–

Here is a basic script to force player vehicles to stop once the tyres have been popped.
With many settings to choose from like the amount of tyres needed to pop before it stops, how you want to stop the vehicle, etc.

–[[ INSTALL ]]–
Drag folder into your resource folder, ensure tyredamage in server.cfg.

–[[ SETTINGS ]]–

By default the script will set the vehicles HANDBRAKE once ALL of the tyres are popped.
Admin and Mech both will be set to true by default so all players will have full control of script.
Open client.lua and edit the settings in the cfg table.

On: --Turn the script on/off

Amt: --Amount of tyres needed to be popped before vehicle stops.
–Possible variables:
–“all”: All tyres needed to be popped.
–“half”: Half of all tyres needed to be popped.
–“quarter”: A quarter of all tyres needed to be popped.
–“3/4”: Three quarters of all tyres needed to be popped.
–Numbers 1 - 6: Specific amount of tyres.

Event: --What to do once the tyres are popped.
–Possible variables:

  • –“engine”: Turn engine off.
  • –“handbrake”: Activate handbrake.
  • –“grip”: Lose traction.
  • –“fire”: Set vehicle on fire.
  • –“explode”: Destroy vehicle. (This is considered by script to be a “fun” based event).
  • –“launch”: Just for fun. Launches vehicle into air.
  • –“gravity”: Another fun one. Lose all effects of gravity.
  • –“crash”: More fun. Accelerator stuck open and you will have no control of steering.
  • –“random”: Any of the normal events picked at random. (see cfg.ev)
  • –“randomfun”: Include fun based events. (see cfg.evf)
  • –“custom”: Edit cfg.custom below to add custom functions.

Custom: --An easy way for users to add their own events without having to edit the base script.
–Remove the --[[ & --]] from the custom lines to use custom functions. If you are adding more than one dont forget to put a… --…comma between the functions after the }. Custom functiions will be chosen at random if there is more than one.

Timer: --Add a timer before vehicle stops. (multiplied by 100, timer will increase 1 per frame until it reaches value) (nil or 0+)

Breakable Engine: --Set engine health to 0.0 once tyres have popped. (will start to decrease if you crash)

Fixable: --If set to true then script will auto-detect when a vehicle has been repaired by other scripts. False will mean that only .players assigned as an admin or mechanic on their client script can reset vehicles using \tyfix.

Hazards: --Enable hazard lights once vehicle is disabled. (turn signals)

Admin: --Is client assigned as an admin. Admin can also use all mechanic features.

  • login: --/command to sign in as an admin.
  • Password: --Password to sign in as an admin. (ex: /tylogin password1)

Mech: --Is client assigned as a mechanic? Mechanics can fix vehicles using command /tyfix.

  • mLogin: --/command to sign in as an mechanic.
  • mPwd: --Password to sign in as an mechanic. (ex: /tymech password2)

Unique: --Add vehicles with a unique amount of tyres. (id = veh-hash, wh = wheel-ID’s)
–For example the “Raptor” has 2 wheels on the front and 1 wheel on back.

Except: --Blacklisted vehicles that cant be stopped if tyres are popped. By default cop cars, boats and helicopters are ignored.
–Numbers will ignore the whole vehicle class (example: 14 will ignore all boats)
–Strings will ignore the specific vehicles (example: “fbi” will ignore the FBI car)

Test: --Enable test/debug mode. (enables you to pop tyres one by one and then reset)

  • On: --Activate test mode.

  • But: --Buttom to press to pop tyres (use “dpad.” + button, example: dpad.r), see top of client script for button names)

  • Dbug: --Show vehicle & tyre info

NOTE: Type /tyi in chat to see all commands in console. (you have to be admin to do this)

–[[ DOWLOAD ]]–

Github: TyreDamage


–{ CHANGELOG }–

1.0.0 (19-10-2019) - Basic script created to help somebody on forums.
- Script was created on a train home from work and untested. Was only intended to point the OP in the right direction. I was also new to FiveM.
[REQUEST] Stop the car when the tire punctures

1.0.1 (18-2-2022) - Forum user had edited script and messaged me asking me for help. –https://forum.cfx.re/uploads/short-url/yQQsOezhzn3ipxobpwdlWDj5P4m.rar

1.1.0 (20-2-2022) - Official release. Script was remastered. Lots of features added, intended to be used in game rather than as an example.

1.1.1 (27-2-2022) - Bugs fixed and more features added.
- Features added:
- Admin/Password system to allow users access to commands that control the script.
- A mechanic and repair system that either detects and resets vehicles as they are repaired by other scripts, …
or it will only let players assigned as an admin and mechanic reset vehicles.
- Added a unique table to handle vehicles with unique amount of wheels.
- Added a blacklist to ignore certain vehicles by script.
- Optional timer added between when tyres are finished popping and when event is triggered.
- Option to easily add own events without having to edit base code.
- Command added for test mode.
- Many new commands added
- Some export functions to control script from your own resourses.
- Command /tyi to print all commands to console.

    - Events added:
    -	"random"	--Pick any of the normal events at random
    -	"randomfun"	--Pick any of the normal + fun events at random
    -	"custom"	--User defined events.
    -	"gravity"	--I was just messing around. Lose gravity (fun based)
    -	"crash"		--Accelerator stuck open and no control of steering, also car will still accelerate after player has exited because never gonna give 			  		  	you up lol. (fun based)
    -	"traction"	--"grip" is now named "traction".
    -	"explode"	--"explode" is now considered to only be a fun based event by script.
    
    - Bugs fixed:
    -	Fixed bug where vehicles cannot be reset when they are repaired.
    -	"quarter" amt is now calculated correctly.
    -	Script will now calculate when vehicles dont exist correctly.
    -	Script will no longer break when using a vehicle with strange amount of wheels (3 or 5 or whatever)

1.1.2 (20.3.22) - Added class detector to ignore specific classes.

9 Likes

Hey,
after Repair the Car doesnt change status

id like to say if i turn on Handbrake or Grip the Car after Repair it continue with them

1 Like

Why would you default to set the car on fire because it’s tyres are popped :upside_down_face:

I think if there was a 30 -60 second delay, fire would be realistic. Driving on the rims creates a lot of sparks IRL and those sparks igniting grease, plastic/fiberglass body panels and other flamable sources under the vehicle is actually something that happens.

1 Like

Ok I will look into it and update. Thanks for the feedback :slight_smile:

:joy: Good point. This was intended to be focused more on gameplay rather than realism. The fire was a last min addition that I quickly added. The idea behind it was so that the driver can still have full control over the vehicle for a bit after police/players have popped all tyres so they can plan ahead and keep the chase interesting rather than just instantly stop in a predictable manner.
Oh also the only reason it is default is because I didn’t change it to anything else after I had finished testing it

Ahh don’t get me started. I tried many ways to set the vehicle on fire, the idea was to slowly set it alight from one of the wheels or wheel arches but I couldn’t get a attached fire prop to actually set the vehicle on fire, also SetEntityOnFire() (or something like that) only worked on specific vehicles like arena wars vehicles. I did consider just adding a delay timer but decided against as it was still pretty unrealistic, I will implement in a timer into the script and update for people to try, but GTA fire just doesnt seem advanced enough for this to be desirable, it seems burning tyres only keep the vehicle burning and doing damage, I was able to set tyres alight easily, but this isn’t great when you want to set it alight once the tyre has gone. :joy:

1 Like

preview?

1 Like

Any update about that? I want to use it but after repair it’s still broken.

1 Like

No i wait on it

Hi guys sorry about the slow replies, I have been really busy with work lately and haven’t been on here. Okay so I am about to sit down update the script and add a few more features and also include the suggestions on this thread. Give me an hour and it should be done.

I will try to get around to making a preview today if I have the time.

Hi all. Script has just been updated and you’re requests have been implemented.
This is a major update and many new features have been added.
(^See description and changelog above^)

1 Like

But does not work when Driving on the rims and the rims creates a lot of sparks that car realistic inflamed.

Hi dude. I will look into your problem asap. Can I have some more info please?
How are your tyres getting to their rim state? Like what are you using to pop the tyres?

Welcome to the forum btw :hugs:

i have a problem when i try put only 1 tire, doesnt work (with the config) nice script buddy!
imagen_2022-03-20_030937

I have problem with boat, when i put half tires, the boat can’t work

Hi Hamktz, please remove the quotation marks so that the value is an integer and it should work fine :slight_smile:

So put 1 instead of “1”

1 Like

Oof sorry boats didn’t even cross my mind when creating this script. I will update the script and allow it to ignore whole classes. But for now can you just put a comma at the end of whatever you have in your “except” table, and add this after:

“dinghy”,“dinghy2”,“dinghy3”,“dinghy4”,“jetmax”,“marquis”,“seashark”,“seashark2”,“seashark3”,“speeder”,“speeder2”,“squalo”, “submersible”,“submersible2”,“suntrap”,“toro”,“toro2”,“tropic”,“tropic2”,“tug”,“avisa”,“dinghy5”,“kosatka”,“longfin”,“patrolboat”

so by default it would look like this if you havent already changed anything in that table:

	except = {				--<	Blacklisted vehicles that cant be stopped if tyres are popped.
		"fbi", "fbi2", "police", "police2", "police3", "police4", "policeb", "policeold1", "policeold2", "policet", "pranger", "riot", "riot2", "sheriff", "sheriff2",
		"dinghy","dinghy2","dinghy3","dinghy4","jetmax","marquis","seashark","seashark2","seashark3","speeder","speeder2","squalo", "submersible","submersible2","suntrap","toro","toro2","tropic","tropic2","tug","avisa","dinghy5","kosatka","longfin","patrolboat"
	},
1 Like

Hi I just updated the script so that it can ignore whole vehicle classes.
In the “except” table, you can put strings (example: “fbi”) to ignore specific vehicles,
and you can put numbers (example: 14, which is boats) to ignore classes.
By default the script will ignore cop cars, boats and helicopters.

This is the only thing updated so if you added the boats to the except table like in the comment above, it will work fine, but if you have any issues please update your script with the latest one.

You can find the class ID’s in the description of this native:
GetVehicleClass()

Thanks for your feedback :slight_smile:

1 Like