01.03.2014, 11:25
You sir clearly have not enough scripting knowledge to tell 'MattTucker' is correct or not.
In fact he is right you can use GetPlayerTargetPlayer. What MattTucker failed to mention is that it will only solve part of the problem. You could combine GetPlayerTargetPlayer with functions like these;
and
In fact he is right you can use GetPlayerTargetPlayer. What MattTucker failed to mention is that it will only solve part of the problem. You could combine GetPlayerTargetPlayer with functions like these;
pawn Код:
stock GetXYBehindPlayer(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);
}
a +=180;
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
pawn Код:
stock IsPlayerBehindPlayer(playerid,targetid,Float:distance,Float:range)
{
if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid))return 0;
{
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);//my pos
GetXYBehindPlayer(targetid,x,y,distance);
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))return 1;
}
return 0;
}