23.08.2010, 01:46
pawn Code:
stock GetVehicleRotation(vehicleid,&Float:x,&Float:y,&Float:z)
{
new Float:Rot[4];
GetVehicleRotationQuat(vehicleid,Rot[0],Rot[1],Rot[2],Rot[3]);
x = atan2(2*((Rot[1]*Rot[2])+(Rot[0]+Rot[3])),(Rot[0]*Rot[0])+(Rot[1]*Rot[1])-(Rot[2]*Rot[2])-(Rot[3]*Rot[3]));
y = atan2(2*((Rot[2]*Rot[3])+(Rot[0]*Rot[1])),(Rot[0]*Rot[0])-(Rot[1]*Rot[1])-(Rot[2]*Rot[2])+(Rot[3]*Rot[3]));
z = asin(-2*((Rot[1]*Rot[3])+(Rot[0]*Rot[2])));
}

