Jump to content

Need help with vehicle rotation change


Recommended Posts

Hello, I Need some help, Although im not sure if it can be fixed, but Here the problem:

There is a downhill road in my map, and i made a code which rotates the car all the time

plveh = getPedOccupiedVehicle(getLocalPlayer()) 
    if plveh and getVehicleName(plveh) == "Infernus" then 
        rx1,ry1,rz1 = getVehicleRotation(plveh) 
        setVehicleRotation(plveh, rx1, ry1, rz1+20) 
    end 

So, it sets the rotation +20 normally, But because its downhill, it crashes some time with the road, I dont know if you get it.. In a straight road works fine, but here is downhill.. so could we fix it somehow? thanks.

Link to comment

if this is a race then, try:

plveh = getPedOccupiedVehicle(getLocalPlayer()) 
    if plveh and getVehicleName(plveh) == "Infernus" then 
        rx1,ry1,rz1 = getVehicleRotation(plveh) 
        setVehicleRotation(plveh, rx1, ry1, rz1+20) 
        setVehicleFrozen(plveh,true) 
    end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...