#7

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;

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));
}
and
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;
}
Reply


Messages In This Thread
How - by Maime - 28.02.2014, 10:38
Re: How - by MattTucker - 28.02.2014, 10:56
Re: How - by Maime - 28.02.2014, 14:43
Re: How - by MattTucker - 28.02.2014, 15:46
Re: How - by Maime - 28.02.2014, 18:08
Re: How - by Maime - 01.03.2014, 11:18
Re: How - by AIped - 01.03.2014, 11:25

Forum Jump:


Users browsing this thread: 1 Guest(s)