Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Автор: Randy | Author: Randy | vk.com/id136437037
- Float:GetDriftAngle(playerid) // Получаем угол заноса автомобиля | We get the car's skid angle
- {
- new RequiredCarID = GetPlayerVehicleID(playerid), Float:Veh_Z_Angle, Float:Veh_Velocity[3], Float:Speed_Angle, Float:Drift_Angle
- GetVehicleZAngle(RequiredCarID, Veh_Z_Angle)
- GetVehicleVelocity(RequiredCarID, Veh_Velocity[0], Veh_Velocity[1], Veh_Velocity[2])
- Speed_Angle = 360.0 - atan2(Veh_Velocity[0], Veh_Velocity[1])
- Drift_Angle = floatabs(Veh_Z_Angle - Speed_Angle)
- if(Drift_Angle < 0.0 || Drift_Angle > 180.0) Drift_Angle = 360.0 - Drift_Angle
- if(Drift_Angle > 90.0) Drift_Angle = 90.0
- if(Veh_Velocity[0] == 0 || Veh_Velocity[1] == 0 || Veh_Velocity[2] == 0) Drift_Angle = 0.0
- return floatabs(Drift_Angle)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement