Jump to content

changing car angle


HeresOtis

Recommended Posts

All is example.

 

How do you check if Car 1 is driving North, East, South, or West? I want Car 2's angle to be perpendicular to Car 1.

 

Like Car 1 is driving West, how to make Car 2 spawn with angle towards North/South, which is perpendicular?

Link to comment
Share on other sites

Try this out:

 

:CAR_ANGLE_SETwait 00174: 0@ = car $CAR_1 Z_angle 0174: 1@ = car $CAR_2 Z_angle0085: 1@ = 0@ // (int) 1@ -= 90 // or 270 doesn't matter.end

 

 

You can obviously change that to whatever you want and add it into your script. This stores the 1st car's angle to 0@ and 2nd car's angle to 1@ then takes 1@ and makes it the same integer or angle as 0@ and then takes 1@ (which is car 2's angle) and either takes it down by 90 or you can change it to 270 for the opposite direction.

 

Change the variables to your script's so you don't get mixed up.

Link to comment
Share on other sites

i'd make it this way:

 

:CAR_ANGLE_SETwait 000A5: 0@ = create_car #PONY at 0.0 0.0 0.0  // car_1 = 0@0174: 1@ = car 0@ Z_angle // angle of car_1 is 1@00A5: 2@ = create_car #PONY at 0.0 0.0 0.0 // car_2 = 2@000F: 1@ -= 90.0 // or 270.0 This will substract 90 or 270 degrees from car_1's z_angle 0175: set_car 2@ Z_angle_to 1@ 

 

Link to comment
Share on other sites

Can you just write a sample script where if Car 1 is driving Northeast, North, or Northwest, then Car 2 angle will be facing East?

And if Car 1 is driving Northeast, East, or Southeast, then Car 2 angle will be facing South?

Link to comment
Share on other sites

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.