4x4 system for cars [Standalone]

hello, this is a script that i made for RP servers and it is ready for publishing now. you can do what ever you want with the script, if you reupload it just give me a shoutout.

the script is made to control the vehicle wheels to make the vehicle 4x4 or 4x2 making it rear wheel drive,
Press LEFT CTRL to use it

note: the script doesnt work with some cars and that isnt because of the script its because of the car model not supporting 4x4, and mainly cars that wont work are sedan cars most SUV cars should work.

Requirements:
pNotify:

to make it work you need to get the cars [ gameName ] in the vehicles.meta and add it to the main.lua line 49, you can add as many as you want.

download it:
https://drive.google.com/open?id=1-5ylqPBNdeK5FHnpOEYhDC1ErHUtSL2z

if you have something that can improve it feel free to do it,
if you have any question ask below.

9 Likes

possible to build a version for show UI on all the time if drive car
and notif the player if i try to put fourwheeldrive and the vehicle is not ready for this ?

Sorry i dont understand you

It will be possible for you to have the script permanently displayed when the player is driving and when he tries to put the 4x4 a simple notification is sent to him if the vehicle is not capable of putting this in a 4x4 sorry google translation

So what you mean is if a car doesn’t support 4x4 it sends a notification to the player?

yes that would avoid having to add all the names in the script …

The notification part can be done but you would still have to add the names

1 Like

I currently have 786 vehicles for sale in the game stores believe that there would be a way to make the script work without being obliged to put in the list all the vehicles that may have the 4x4

Idont know about any other way but even if there is a way some of the cars wont like because of the problem that I mentioned in the description

what happens if you try to activate the 4x4 function on a basic vehicle that cannot do it?

go download it again i updated it and now if the vehicle does not support 4x4 and you press CTRL it will show a message.

yes it works well

you should let the HUD display permanently when the player is driving and when he can activate the 4x4 the color changes

you should also add a notification when the player activates the 4x4

however with the handling editor I can put the 4x4 vehicle why then your script tells me that I cannot …

Make sure you have pNotify

Did you add the vehicle gameName to the file?

after adding it works

would it be possible to make the limitation with the vehicle class
example the bike, boat or plane cannot activate the function but the other class yes (sport offroad ect)

bro can i have your car one the video plz

this is a DLC car try to spawn DRAFTER

just an idea

you press the key it changes you to
SetVehicleHandlingField (veh, ‘CHandlingData’, ‘fDriveBiasFront’, 0.400000)
with 4x4 color HUD
and notif

you press again he changes you to
SetVehicleHandlingField (veh, ‘CHandlingData’, ‘fDriveBiasFront’, 0.000000)
with HUD behind
and notif

you press again he changes you to
SetVehicleHandlingField (veh, ‘CHandlingData’, ‘fDriveBiasFront’, 0.100000)
with color HUD in front
and notif

and vehicles that are in an X class or that have the X name do not activate the script