Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: DilsonTB on March 20, 2012, 01:50:21 pm
-
I made a /c parkcar so i need to get the angle of the vehicle but when i am out of it, the angle show me rightly, when i am inside it show me like this 0.0000000 and its the variable to the north, So please help me any idea of take the vehicle angle.
PLEASE
-
A vehicle's z-angle cannot be retrieved in r2.
-
You can do /s and read it from the chatbox.
-
Well as i said before i want to make it to fix the Angle 0.00000000 on my list of vehs that i have...... I already did the whole script of saving coords, model, color etc but i need to know how to fix it to add it to /c parkcar so.... Any other way?
-
There is a complicated method. Though I would not guarantee its accuracy.
Fetch X,Y pos of the car.
Lets call them X1, Y1.
Accelerate the car in forward direction (without turning).
Stop the car.
Fetch X,Y pos again.
Call them X2, Y2.
Angle = tan-1 [ (Y2 - Y1)/(X2 - X1) ]
You can use a timer to get X2, Y2 while you are driving.
-
Well, the angle (if in radians) would have to be converted to a degree measure out of 360. Regardless, that wouldn't capture the facing (vehicle z) angle.
(http://i.imgur.com/COftd.jpg)
-
+ tan is periodic for (-Pi/2, Pi/2) so it will return the same value for 0 degrees and 180, so without more IFs, he won't get the angle anyway.
I really thinks that /s should do everything, cmon! I use it sometimes even if I need some player pos + angle for single player modifications ::).
Or have you thought about player angle? If it works, just set your character, return it;s angle and set it to your car.