How to get position just behind car.
#7

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Thats trigonometry. Im not sure about the exact angles as SA-MP angles always behave strange.

pawn Код:
//new Float:x, Float:y, Float:z, Float:rot;    // is Vehicle 1 position and rotation
new Float:cx, Float:cy, Float:cz; // is Vehicle 2 position
cx = x + floatsin(360.0 - (rot + 180.0), degrees) * distance_between_vehicles;    // "360.0 -" is to transform the samp angle to the mathematical one
cy = y + floatcos(360.0 - (rot + 180.0), degrees) * distance_between_vehicles;  //  "+ 180.0" is to point behind the other vehicle, else it would spawn in front of it
Thats a pretty common question, you could have searched
Thanks

You earned my respect sir. [Not Forum Respect]
Reply


Messages In This Thread
How to get position just behind car. - by MA_proking - 04.08.2014, 14:28
Re: How to get position just behind car. - by Diti1 - 04.08.2014, 15:07
Re: How to get position just behind car. - by MA_proking - 04.08.2014, 15:15
Re: How to get position just behind car. - by Stanford - 04.08.2014, 15:18
AW: How to get position just behind car. - by Nero_3D - 04.08.2014, 15:25
Re: How to get position just behind car. - by Mauzen - 04.08.2014, 15:26
Re: How to get position just behind car. - by MA_proking - 04.08.2014, 16:57

Forum Jump:


Users browsing this thread: 2 Guest(s)