pawn Код:
// Weapon Knockback
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
new
Float:px,
Float:py,
Float:pz,
Float:ix,
Float:iy,
Float:iz,
Float:angle;
GetPlayerPos(playerid, px, py, pz);
GetPlayerPos(issuerid, ix, iy, iz);
angle = absoluteangle(-(90-(atan2((fDestY - fPointY), (fDestX - fPointX)))));
SetPlayerVelocity(playerid, 0.35 * floatsin(-angle, degrees), 0.35 * floatcos(-angle, degrees), 0.1);
ApplyAnimation(playerid, "PED", "FALL_back", 4.0, 0, 1, 1, 1, 0, 1);
defer GetUp(playerid);
}
timer GetUp[1000](playerid)
{
ApplyAnimation(playerid, "PED", "getup", 4.0, 0, 1, 1, 0, 0, 1);
}
stock Float:absoluteangle(Float:angle)
{
while(angle < 0.0)angle += 360.0;
while(angle > 360.0)angle -= 360.0;
return angle;
}