Backstabbing fail
#1

I made this up to get a player backstabbed when yeah.. the issuer is behind with the knife. Not working. >.<
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    if(GetPlayerWeapon(issuerid) == 4) {
        new Float:ang[1+1],Float:pos[2+1],Float:angle;
        GetPlayerFacingAngle(issuerid,ang[0]);
        GetPlayerFacingAngle(playerid,ang[1]);
        angle = ang[1]-ang[0];
        print("DEBUG");
        GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
        if(IsPlayerInRangeOfPoint(issuerid,0.5,pos[0],pos[1],pos[2]) && angle < 125.0) {
            print("KILLED");
            SetPlayerHealth(playerid,0);
        }
    }
    return 1;
}
Reply
#2

Bump!
Reply
#3

Have you tried to increase a range for a bit? Like make it 2.0 instead of 0.5?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)