Don't "die" upon death? - 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)
+--- Thread: Don't "die" upon death? (
/showthread.php?tid=614584)
Don't "die" upon death? -
TheBigFive - 10.08.2016
Hey.
I was wondering how I am supposed to prevent people from respawning once they are dead. Instead I'd like to apply an animation, and make them go into a "wounded state" kind of. How is this possible? I assume I'll somehow have to stop the player from taking damage at 2 percent health for instance, or how does it work? And how to constantly check that without affect the performance of the server in a bad way? Any suggestions?
Because right now once they die, they die - respawn quickly, then getting teleported back to their previous position and an animation gets applied. I'd like the animation to be applied, and that's it. No respawn.
Re: Don't "die" upon death? -
Spmn - 10.08.2016
If you don't mind using memory hacking plugins, then give weapon-config.inc a try.
Re: Don't "die" upon death? -
TakeiT - 10.08.2016
make OnPlayerDeath return 0 if I remember correctly.
Re: Don't "die" upon death? -
Hargrave - 10.08.2016
Quote:
Originally Posted by TakeiT
make OnPlayerDeath return 0 if I remember correctly.
|
How does that make you able to apply an anim?
Re: Don't "die" upon death? -
TakeiT - 10.08.2016
Quote:
Originally Posted by Hargrave
How does that make me able to apply an anim?
|
I'm not 100% on this but I THINK it bypasses the default shake and respawn. Just looking at my script, though I also have a custom health system so it's only called in explosions etc
Re: Don't "die" upon death? -
NaS - 10.08.2016
For this you must create a server-sided health system and make the players invulnerable so there's no way to actually die (except in vehicles, clнmb bug or knife).
Then use OnPlayerGiveDamage (weapon damage towards others) and OnPlayerTakeDamage (explosions, fall damage etc) to handle damages. If your custom health reaches zero upon any damage you can then freeze the player and apply an animation.
I bet there's already an include doing this. Maybe without the dying animation but that wouldn't be too hard to add.
Another way (probably buggy and ugly) would be instantly respawn the player on death (set spectating on & off or similar) and put him back to the spot he died and apply an animation. Wouldn't require a custom damage/health system but, as I already said, it's probably laggy and doesn't look good.