15.12.2013, 11:37
(
Последний раз редактировалось Opah; 15.12.2013 в 22:59.
)
How Can I get XYZ in front of player like when flying a plane and heading down to the ground ??
new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Try this function.
pawn Код:
|
Search for Quaternion Converter, or use GetVehicleRotationQuat and wikipedia (goto: For Euler angles)
|