oscar-broman / samp-weapon-config

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

Death animation in Stream In #222

Open kolor4do opened 2 years ago

kolor4do commented 2 years ago

When one dead player is shown to another, the animation is not that of death. I believe this piece of code was made to fix this, but it's not working properly.

public OnPlayerStreamIn(playerid, forplayerid)
{
    // Send ped floor_hit_f
    if (s_IsDying[playerid]) {
        SendLastSyncPacket(playerid, forplayerid, .animation = 0x2e040000 + 1150);
    }

    return WC_OnPlayerStreamIn(playerid, forplayerid);
}
NexiusTailer commented 1 year ago

Seems I found the cause: SendLastSyncPacket doesn't set any animations at all if send it on any player (and no matter which anim ID I was trying to set with it). This is not Pawn.RakNet nor SKY implementation fault, because it doesn't work on both, so I doubt it needs to open an issue in SKY repo. I think native SendDeath will work to show a dead player for others (could be also done in Pawn.RakNet implementation), but I suppose Slice initially not used it because weapon-config can cancel any serverside death (for example, if you were killed by a player who used C-bug and it wasn't allowed, your death will be cancelled and health/armour will be restored). So, pretty doubtful that SendDeath can be cancelled for others as simple as it's now just by doing ClearAnimations for this "dead" player.