Hi masters!
I want to make a little plugin to add some gore stuff on my serv.
I saw this plugin:
http://forums.alliedmods.net/showthread.php?p=475029
I like the idea, but I want to go beyond.
I want to add the complete death animation with a skeleton model I've done (not mine, only recompiled with death animations).
And I want the player to disintegrate (to see later) and replace with the skeleton model (death animations), only if is killed with AWP, but I want it working first.
How can I "known" why animation may be used?
Ex: if player is crouch, crouch_dead anim, if was haedshot, headshot animation.
And how can I "select" the animation from a model? (to use one model only).
Errors I've got trying (if the entity is created using a model):
* The animation is reproduced, but only default animation (no change if crouch, etc), played once and no corpse remainig on ground. Just disapears immediately ???
* Default animation looping for a while.
* No animation, just appears a freeze model and stay immobile (standing) for a while.
I'm wondering it's due creating entity instead of replacing it.
But... How can I replace the player model in realtime (taking care at the current animation)? I think it's the way, but I dunno if it's possible.
Any suggestion?
Attached the skeleton model (see with HLMV) and a screenshot, greetings.
PD. I found this, maybe useful stuff:
Code:
public client_PreThink( id )
{
// check some vars first and whatnot..
set_animation(id, 2); // 2 = grenade throwing, what is death?
}
public set_animation( id, seq )
{
entity_set_int(id, EV_INT_weaponanim, seq);
message_begin(MSG_ONE, SVC_WEAPONANIM, {0,0,0}, id);
write_byte(seq);
write_byte(entity_get_int(id, EV_INT_body));
message_end();
}