06.01.2016, 09:41
Hi guys, how can i check player facing angle (or any other function) and then SetPlayerPos(playerid, x, y(+5 or -5 depending on player facing angle),z);
Thanks for the answer.
Thanks for the answer.
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));
}