SA-MP Forums Archive
Players not dying when killed? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Players not dying when killed? (/showthread.php?tid=261276)



Players not dying when killed? - ScottCFR - 12.06.2011

I was playing with a few people in my server, and I noticed when you killed someone they didn't respawn. OnPlayerDeath get's called, I've saw that. But, I can't figure out what's cause them to not die.

Thanks,
ScottCFR


Re: Players not dying when killed? - Cyanide - 12.06.2011

I did some basic searching and here's a solution:

pawn Код:
public OnPlayerDeath( playerid, killerid, reason )
{
     ClearAnimiations( playerid );
     SetPlayerHealth( playerid, 1.0 );
}



Re: Players not dying when killed? - Homerman - 12.06.2011

Maybe show us the code?


Re: Players not dying when killed? - Mauzen - 12.06.2011

Agree with Cyanide, some animations or fire can players cause to be still alive after OnPlayerDeath. They will die as soon as the animation/fire finished. Setting up their health to something > 0 will be recognized as respawn, so their old body is removed and fire/animations are reset, so the player really dies.


Re: Players not dying when killed? - ScottCFR - 12.06.2011

Okay, hopefully this works. I've been having problems with deathmatch areas. None of them really involve animations, or fire. But, thanks for the help.

- ScottCFR