Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Получает угол дрифта
- stock Float:GetVehicleDriftAngle(Float:x, Float:y, Float:a) {
- new Float:Angle = floatsqroot(x*x + y*y);
- if((asin(x/Angle)*-1) <= 0.0) Angle = 360.0 - acos(y/Angle);
- else Angle = acos(y/Angle);
- if(Angle > a) {
- if(Angle-a >180.0) return (360.0-Angle)+a;
- else return Angle-a;
- } else {
- if(a-Angle >180.0) return (360.0-a)+Angle;
- else return a-Angle;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment