#1

How can i detect if a player is aiming at another players back?


Thanks!
Reply
#2

I don't think it's possible but you can detect if he shot his back
Reply
#3

It is possible... i've seen it in a server myself.
Reply
#4

https://sampwiki.blast.hk/wiki/GetPlayerTargetPlayer - This is all I could find of about aimming, good luck lol.
Reply
#5

I know every function there is to know because i know that you are supposed to search before asking for help. GetPlayerTargetPlayer woulden't help me abit it just detects if the player is aiming at you it dosen't detect the point of view it just goes random.

EDIT: For the one who can help me i'd appricate it alot, you have no idea.. i really need this.
Reply
#6

bump
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)