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

Death animation in Stream In

Open kolor4do opened this issue 3 years ago • 1 comments

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

kolor4do avatar Nov 11 '21 14:11 kolor4do

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.

NexiusTailer avatar Sep 18 '22 20:09 NexiusTailer