SA-MP Forums Archive
Backstabbing fail - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Backstabbing fail (/showthread.php?tid=307114)



Backstabbing fail - Seven_of_Nine - 29.12.2011

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;
}



Re: Backstabbing fail - Seven_of_Nine - 29.12.2011

Bump!


Re: Backstabbing fail - Norck - 29.12.2011

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