18.02.2015, 08:41
Hello, I saw the GetXYInFrontOfPlayer function. I want to check the direction of X and Y, for that I need (I guess) the angle at which the X and Y will be in front of the player? Is there a way to check the angle at which the xy will be in front of the player. Thank you.
pawn Код:
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));
}