18.02.2015, 08:49
It think this already does that...what exactly do you want with it ? check if a player is in front of you ?
Maybe you want something like this;
this checks the xy angle in front of you and the distance in that angle to be checked
Maybe you want something like this;
pawn Код:
stock GetXYSetAngle(playerid, &Float:x, &Float:y, Float:distance,Float:angle)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
a += angle;
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
this checks the xy angle in front of you and the distance in that angle to be checked