And here you go, tested and confirmed working on a few of my servers. Here's a crummy video for a headsup.
https://www.youtube.com/watch?v=cARP...ature=youtu.be
Here's what I did. I cleaned up a lot of code, there were a few mistakes I noticed which I took care of. Stuff that was stopping the events from ever firing and such.
Code:
if (!IsValidClient(victim))
{
return Plugin_Continue;
}
if (!IsValidClient(attacker))
{
return Plugin_Continue;
}
if (attacker==victim)
{
return Plugin_Continue;
}
Which was better written out as
Code:
if (!IsValidClient(attacker)){ return Plugin_Handled; }
Then, your custom kill was incorrect.
Code:
// Doesn't seem to work.
if (customkill == TF_CUSTOM_BURNING)
It should have been this, as it goes by the int not the string. I also included some other kill scenarios.
Code:
// Burning, Burning Flare, Burning Arrow, Flare Pellet
if (customkill == 3 || customkill == 8 || customkill == 17 || customkill == 53)
For your aerial death issue, I added in a kill clause.
Code:
if (victimClass == TFClass_Pyro || !(GetEntityFlags(victim) & FL_ONGROUND)) //Will not fire if the victim is a pyro or died in the sky.
For your burning prop_dynamic issue, I borrowed some code from Sarge, with his permission.
The final bit is that when the animation ends, it is replaced with a new
tf_ragdoll that immediately fizzles up the phlog ash effect!
Code:
SetEntProp(Ent, Prop_Send, "m_bBecomeAsh", 1);
I called this a _clean version, as I stripped out a lot of the other code. The test command is gone, this runs solely on death now and will not stun / later un-stun players later. This code was also removed to protect spies, spies using the dead ringer will live, but leave behind a burning spy corpse as normal as if they normally died. I changed as bit of the plugin_continue bit on the death catch in order to stop problems with the killfeed.
So basically now...
You die -> Original ragdoll killed -> New model -> Animation -> Model is killed -> New ragdoll -> bBecomeAsh -> new ragdoll killed.
It's without errors, and so far tested it seems to be without problems. I would like to see a second opinion on the way the final ragdoll gets made, the animation doesn't have a graceful end so it's kind of weird to watch a ragdoll pop in out of existence at the end, but it does immediately burn up so it's not too big of an issue.