BigETI

IsPlayerWheelie

Apr 18th, 2012
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.83 KB | None | 0 0
  1. stock GetVehicleRotation(vehicleid, &Float:x, &Float:y, &Float:z)
  2. {
  3.     new Float:quat_w, Float:quat_x, Float:quat_y, Float:quat_z;
  4.     GetVehicleRotationQuat(vehicleid, quat_w, quat_x, quat_y, quat_z);
  5.     x = atan2(2*((quat_x*quat_y)+(quat_w+quat_z)), (quat_w*quat_w)+(quat_x*quat_x)-(quat_y*quat_y)-(quat_z*quat_z));
  6.     y = atan2(2*((quat_y*quat_z)+(quat_w*quat_x)), (quat_w*quat_w)-(quat_x*quat_x)-(quat_y*quat_y)+(quat_z*quat_z));
  7.     z = asin(-2*((quat_x*quat_z)+(quat_w*quat_y)));
  8. }
  9.  
  10. stock IsVehicleWheelie(vehicleid)
  11. {
  12.     new Float:rot[3];
  13.     GetVehicleRotation(vehicleid, rot[0], rot[1], rot[2]);
  14.     if((rot[1] >= 30.0 && rot[1] < 90.0) || (rot[1] <= -30.0 && rot[1] > -90.0)) return 1;
  15.     return 0;
  16. }
  17.  
  18. stock IsPlayerWheelie(playerid)
  19. {
  20.     if(!IsPlayerInAnyVehicle(playerid)) return 0;
  21.     return IsVehicleWheelie(GetPlayerVehicleID(playerid));
  22. }
Advertisement
Add Comment
Please, Sign In to add comment