stock ConvertNonNormaQuatToEuler(Float: qw, Float: qx, Float:qy, Float:qz, &Float:heading, &Float:attitude, &Float:bank){ new Float: sqw = qw*qw; new Float: sqx = qx*qx; new Float: sqy = qy*qy; new Float: sqz = qz*qz; new Float: unit = sqx + sqy + sqz + sqw; // if normalised is one, otherwise is correction factor //a*n~ëe` normalised, - îäe`í, â i\"?îo`e`âíîi` n~ëó÷a`a* - i\"îe^a`ça`o`a*ëü e^î??a*e^öe`e` new Float: test = qx*qy + qz*qw; if (test > 0.499*unit) { // singularity at north pole - în~îáa*ííîn~o`ü ía` n~a*âa*?íîi` i\"îë?n~a* heading = 2*atan2(qx,qw); attitude = 3.141592653/2; bank = 0; return 1; } if (test < -0.499*unit) { // singularity at south pole - în~îáa*ííîn~o`ü ía` ??íîi` i\"îë?n~a* heading = -2*atan2(qx,qw); attitude = -3.141592653/2; bank = 0; return 1; } heading = atan2(2*qy*qw - 2*qx*qz, sqx - sqy - sqz + sqw); attitude = asin(2*test/unit); bank = atan2(2*qx*qw - 2*qy*qz, -sqx + sqy - sqz + sqw); return 1;}stock GetVehicleRotation(vehicleid,&Float:heading, &Float:attitude, &Float:bank){ new Float:quat_w,Float:quat_x,Float:quat_y,Float:quat_z; GetVehicleRotationQuat(vehicleid,quat_w,quat_x,quat_y,quat_z); ConvertNonNormaQuatToEuler(quat_w,quat_x,quat_z,quat_y, heading, attitude, bank); bank = -1*bank; return 1;}/// GetVehicleRotation(vID, X, Y, Z);
new Float: vPos[ 4 ];GetVehiclePos( GetPlayerVehicleID( playerid ), vPos[ 0 ], vPos[ 1 ], vPos[ 2 ] );GetVehicleZAngle( GetPlayerVehicleID( playerid ), vPos[ 3 ] );vPos[ 0 ] += ( 2 * floatsin( -vPos[ 3 ], degrees ) );vPos[ 1 ] += ( 2 * floatcos( -vPos[ 3 ], degrees ) );
Esetleg ? stock ConvertNonNormaQuatToEuler(Float: qw, Float: qx, Float:qy, Float:qz, &Float:heading, &Float:attitude, &Float:bank){ new Float: sqw = qw*qw; new Float: sqx = qx*qx; new Float: sqy = qy*qy; new Float: sqz = qz*qz; new Float: unit = sqx + sqy + sqz + sqw; // if normalised is one, otherwise is correction factor //a*n~ëe` normalised, - îäe`í, â i\"?îo`e`âíîi` n~ëó÷a`a* - i\"îe^a`ça`o`a*ëü e^î??a*e^öe`e` new Float: test = qx*qy + qz*qw; if (test > 0.499*unit) { // singularity at north pole - în~îáa*ííîn~o`ü ía` n~a*âa*?íîi` i\"îë?n~a* heading = 2*atan2(qx,qw); attitude = 3.141592653/2; bank = 0; return 1; } if (test < -0.499*unit) { // singularity at south pole - în~îáa*ííîn~o`ü ía` ??íîi` i\"îë?n~a* heading = -2*atan2(qx,qw); attitude = -3.141592653/2; bank = 0; return 1; } heading = atan2(2*qy*qw - 2*qx*qz, sqx - sqy - sqz + sqw); attitude = asin(2*test/unit); bank = atan2(2*qx*qw - 2*qy*qz, -sqx + sqy - sqz + sqw); return 1;}stock GetVehicleRotation(vehicleid,&Float:heading, &Float:attitude, &Float:bank){ new Float:quat_w,Float:quat_x,Float:quat_y,Float:quat_z; GetVehicleRotationQuat(vehicleid,quat_w,quat_x,quat_y,quat_z); ConvertNonNormaQuatToEuler(quat_w,quat_x,quat_z,quat_y, heading, attitude, bank); bank = -1*bank; return 1;}/// GetVehicleRotation(vID, X, Y, Z);
Ezt nézd meg. [/quote]Ezt meg nem értem elsõ ránézésre de azér tmég egykétszer átolvasom köszi