samp-weapon-config icon indicating copy to clipboard operation
samp-weapon-config copied to clipboard

death animation is playing only for who is dying

Open Vel30 opened this issue 1 year ago • 0 comments

the wounded animation is applying normally for both players, however when a player in the wounded state receives a shot, the animation appears to be reapplied with each shot, however it remains normal for whoever is receiving the hits, and when the player dies, the animation applies normally for him, but it is not visible to whoever killed him, whoever killed him only sees him standing still

static BitArray: gPlayerWounded<MAX_PLAYERS>;

public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time) {
  if (!Bit_Get(gPlayerWounded, playerid)) {
    animlib = "sweet";
    animname = "sweet_injuredloop";
    anim_lock = true;
    respawn_time = 250;

    Bit_Let(gPlayerWounded, playerid);
    return 1;
  }

  Bit_Vet(gPlayerWounded, playerid);

  animlib = "wuzi";
  animname = "cs_dead_guy";
  return 1;
}

public OnPlayerDeathFinished(playerid, bool: cancelable) {
  return Bit_Get(gPlayerWounded, playerid);
}

Vel30 avatar Dec 09 '23 20:12 Vel30