Raised This Month: $ Target: $400
 0% 

How to hook animation ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bos93
Veteran Member
Join Date: Jul 2010
Old 09-25-2012 , 09:33   How to hook animation ?
Reply With Quote #1

PHP Code:
enum 
{
    
KNIFE_IDLE 0,
    
KNIFE_SLASH1,
    
KNIFE_SLASH2,
    
KNIFE_DRAW,
    
KNIFE_STAB,
    
KNIFE_STAB_MISS,
    
KNIFE_MIDSLASH1,
    
KNIFE_MIDSLASH2

Emit_Sound ?

Is there a better idea?

Or

Draw anim - Ham_Item_Deploy

SLASH - Ham_Weapon_PrimaryAttack

But,how to hook STAB , MISS , MIDSLASH ?

I blocked all the animations,I need to play new animations
__________________

Last edited by Bos93; 09-25-2012 at 10:29.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Old 09-25-2012, 10:28
Bos93
This message has been deleted by Bos93.
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-25-2012 , 10:55   Re: How to hook animation ?
Reply With Quote #2

You would need to hook CBasePlayerWeapon::SendWeaponAnim(), with either Hamsandwich (the updated version), or Orpheu/Rage.
__________________
Arkshine is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 09-25-2012 , 11:09   Re: How to hook animation ?
Reply With Quote #3

Arkshine,thanks.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Old 09-25-2012, 13:33
fl0werD
This message has been deleted by Arkshine. Reason: English please.
Old 09-25-2012, 13:37
fl0werD
This message has been deleted by Arkshine. Reason: English please.
csoldjb
Member
Join Date: Dec 2010
Old 09-26-2012 , 07:57   Re: How to hook animation ?
Reply With Quote #4

you can also try register_message(SVC_WEAPONANIM,"Message_Weap onAnim") and use get_msg_arg_int to get animation.
csoldjb is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 09-26-2012 , 08:46   Re: How to hook animation ?
Reply With Quote #5

csoldjb, get_msg_arg_int( number ? )

How do I know all the arguments?
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-26-2012 , 13:17   Re: How to hook animation ?
Reply With Quote #6

Quote:
Originally Posted by Bos93 View Post
csoldjb, get_msg_arg_int( number ? )

How do I know all the arguments?
Did you know that that the animatsions are numbers.
Example in player model we have
dummy = 0
idle = 1
run = 2
...

with this get_msg_arg_int you get all information what do you need.
in there we have
PHP Code:
enum  

    
KNIFE_IDLE 0// int 0
    
KNIFE_SLASH1,  // int 1
    
KNIFE_SLASH2,   // int 2
    
KNIFE_DRAW,  // ...
    
KNIFE_STAB
    
KNIFE_STAB_MISS
    
KNIFE_MIDSLASH1
    
KNIFE_MIDSLASH2  // int 7

// use format
value = get_msg_arg_int()

Last edited by .Dare Devil.; 09-26-2012 at 13:17.
.Dare Devil. is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 09-26-2012 , 15:20   Re: How to hook animation ?
Reply With Quote #7

Quote:
Originally Posted by csoldjb View Post
you can also try register_message(SVC_WEAPONANIM,"Message_Weap onAnim") and use get_msg_arg_int to get animation.
I remember that I tried to hook SVC WEAPONANIM, but it even didnt printed the debug results, so I am not sure if it can be hooked
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-26-2012 , 15:22   Re: How to hook animation ?
Reply With Quote #8

It can be hooked. It's a message sent from the game, it will work but it would be more simple and efficient to hook the virtual function SendWeaponAnim instead. (Ham or Orpheur/Rage)
__________________

Last edited by Arkshine; 09-26-2012 at 15:24.
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode