29.12.2011, 09:43
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;
}