oscar-broman / samp-weapon-config

A more consistent and responsive damage system with many new features
Apache License 2.0
93 stars 83 forks source link

death animation is playing only for who is dying #279

Open Vel30 opened 7 months ago

Vel30 commented 7 months ago

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