Anti Vehicle Flip and Air Control

vehicles
rp
realistic
realism

#1

[Anti Vehicle Flip]
This is a script to prevent you from being able to control your vehicle in the air. It also stops you being able to flip a car when it is on its back. Script was put together for GTA5Police.

[Features]

  • Prevents controlling the vehicle in the air
  • Prevents flipping your vehicle over when it is upside down
  • Makes vehicle unusable once it is flipped
  • Function to unflip the vehicle that can be used by mechanics or similar

[Installation]

  • Drop ‘blurr_antivehflip’ into resource folder
  • Add ‘blurr_antivehflip’ to start up in server config
  • Go into 'cl_antivehflip.lua` and add any blacklisted vehicles

[Downloads]
V1.2 - Download - Fully fixed some issues with cars being froze slightly off the ground or on one corner of the car. Added a function to reset the car. Call this function in the mechanic script or wherever. Will unflip it and unfreeze it.
V1.1 - Download - Fixes issue of cars being froze in mid air (Quick Fix).
V1.0 - Download - Initial Release

[Bugs / Issues / Suggestions]
Notify me if you find any bugs or issues, even if you are able to fix yourself. This way I can update it for anyone else. If you have any suggestions let me know and I will look into them!

[Credits]
Thank you to @Vespura, I used his air control script as a guide for a few things, FiveM and you guys/girls


#2

if a mecano fix the car. it still wont work when it is flipped back


#3

Remove destroyPedsVehicle(ped) or add to the mecano script a function that unfreezes the entity.

function enableVehicle(veh)
	FreezeEntityPosition(veh,false)
	SetVehicleEngineOn(veh,true)
end

#4

okey so i just add that somewere in the mecanon script? or does it need to be on an special place?


#5

Put it in the mechanic script and then call the enableVehicle() function when a mechanic repairs the vehicle.


#6

okey

20 (chars)…


#7

Update has been uploaded. V1.1 fixes a issue that caused cars to freeze in the air.


#8

V1.2 UPDATE
Fixed issue of car freezing like this…

Also added a function for resetting/flipping the car as a few people have asked about this.
Call resetVehicle(veh) in a command or menu item. I have only made the function, you’ll have to do the rest such as the event.


#9

572/5000
I put the function in the place where the mechanic uses to repair vehicle
local function ch_repair (player, choice)
local user_id = vRP.getUserId (player)
if user_id then
if vRP.tryGetInventoryItem (user_id, “repair kit”, 1, true) then
vRPclient._playAnim (player, false, {task = “WORLD_HUMAN_WELDING”}, false)
SetTimeout (15000, function ()
vRPclient._fixeNearestVehicle (player, 7)
vRPclient._stopAnim (player, false)
enableVehicle ()
end)
end
end
end
but this one is giving error after it repairs the vehicle and the vehicle does not start

Error resuming coroutine: modules/basic_garage.lua:360: attempt to call a nil value (global ‘FreezeEntityPosition’)
[ 332328] stack traceback:
[ 332328] modules/basic_garage.lua:360: in function ‘enableVehicle’
[ 332328] modules/basic_garage.lua:351: in function <modules/basic_garage.lua:348>


#10

Hello I do not see how you do it to continue after the reset I think I must be wrong in the way of inserting the code, a person could give me a clue?