[SOLVED] ACT_RANGE_ATTACK1 Activity - Playing Animation
Hi, I've a problem with a plugin. I'm making a new knife, for that reason I block the primary and secondary attack by setting m_flNextPrimaryAttack and others, to get_gametime() + 999.0, so the player can't attack, and then I hook cmdstart for improve the next attack when IN_ATTACK button is pressed.
All things are ok, the attack, the tracelines, the takedamage, but now, I am trying to play player animation because the player stays like he isn't attacking. I tried with this code, in the code when user pressed IN_ATTACK button: Like Arkshine said: PHP Code:
I thought implementing Orpheu ( CBasePlayer::SetAnimation() ), I tried but I can't achieve this. Maybe anyone can help me? Greetings. |
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
SetAnimation is called all the time. Most of time ACT_WALK, but next animation should not be overwritten if m_Activity is set on ACT_RANGE_ATTACK1.
Technically the code should work. Maybe you will need to set m_fSequenceFinished to 0, because animation is overwritten if either not set on ACT_RANGE_ATTACK1 or either m_fSequenceFinished is on 1. It might be handled differently in CS, I've don't have fully decompiled the code yet. Though, It would be really easier, faster and reliable to call SetAnimation(). It think it has already been posted somewhere. |
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
Quote:
|
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
I saw that, but It blocks all sequences when the player is in prone position, I want to play the ref_shoot_knife or crouch_shoot_knife while it is walking, crouching, or whatever he is doing, without blocking these sequences, for that reason I couldn't achieve this.
|
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
You should have just to call SetAnimation() when you want, and make sure m_szAnimationExt is set to "knife".
|
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
So, If i do this:
PHP Code:
Edit: It worked! Thank you. Is it possible to play other animation ( not CS default animations ), like to do emotes for CS, and block attack, reload animations but not crouch, and walk, or swim, and at the same time play the new animation attached to the model file? |
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
m_szAnimExtention is used inside SetAnimation to format string like ref_shoot_knife, so it doesn't make to set it after.
set_pdata_string is char based, meaning the offset should be the full 1968 (492*4). |
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
Ok, I fixed these errores. Now I have a doubt, I was thinking on set player animation to a new sequence, like he is in defensive position, with knife pointing to his side, and to do that, I need to set this sequence and at the same time, don't block the walk, crouch, etc sequences, or that these animations doesn't replace the new sequence, therefore..., that the walk, crouch, swimming animations, would be mixed with the new sequence ( defensive position ).
|
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
Quote:
|
Re: ACT_RANGE_ATTACK1 Activity - Playing Animation
Thanks meTaLiCroSS.
Any solution for my doubt? |
| All times are GMT -4. The time now is 13:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.