Lemonadio

GetVehicleDriftAngle

May 8th, 2013
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.45 KB | None | 0 0
  1. // Получает угол дрифта
  2. stock Float:GetVehicleDriftAngle(Float:x, Float:y, Float:a) {
  3.     new Float:Angle = floatsqroot(x*x + y*y);
  4.     if((asin(x/Angle)*-1) <= 0.0) Angle = 360.0 - acos(y/Angle);
  5.     else Angle = acos(y/Angle);
  6.  
  7.     if(Angle > a) {
  8.         if(Angle-a >180.0) return (360.0-Angle)+a;
  9.         else return Angle-a;
  10.     } else {
  11.         if(a-Angle >180.0) return (360.0-a)+Angle;
  12.         else return a-Angle;
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment