Raised This Month: $51 Target: $400
 12% 

How to catch animation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
G[o]Q
Member
Join Date: Jan 2010
Location: Poland (Malopolska)
Old 09-01-2013 , 18:46   How to catch animation
Reply With Quote #1

Hi

I need solution about catching animation

example:

i would like to catch reload animation in glock and block or change it for shot animation but question is how do it?
G[o]Q is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-01-2013 , 19:33   Re: How to catch animation
Reply With Quote #2

Catch the reload event using Ham_Weapon_Reload and force a new animation by sending, for example, SVC_WEAPONANIM.

I'm not sure if there's a better way but I'm sure someone will correct me if there is.
__________________
Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-01-2013 , 19:45   Re: How to catch animation
Reply With Quote #3

Method seems ok, about SVC_WEAPONANIM, you can use Ham_CS_Weapon_SendWeaponAnim from hamsandwich updated.
You can also try to hook it to catch other animations.

I hope this ham version gonna be integrated in amxx, but atm there are no testers for some mods to confirm all is working.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
G[o]Q
Member
Join Date: Jan 2010
Location: Poland (Malopolska)
Old 09-02-2013 , 07:18   Re: How to catch animation
Reply With Quote #4

hmm i tested ham_ and it didn't work

i have a model with one "idle" animation (first in sequence) and I try change glock for them but glock has three "idle" animations and when i'm walking third animation("idle" for glock and "attack1 for my Model) is triggered

i would like to block it
G[o]Q is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-02-2013 , 13:13   Re: How to catch animation
Reply With Quote #5

May be easier to just edit the model?
Here's a solution:
Quote:
Originally Posted by bibu View Post
Try something like the following code. I still don't get why you want to replace anim. If you're already using a custom model, then it should show the anim already correctly. Correct me if it's wrong.

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define ANIM_TO_REPLACE 1
#define REPLACE_ANIM_WITH 1337

public plugin_init()
{
    
RegisterHam(Ham_CS_Weapon_SendWeaponAnim"weapon_entity""WeaponSendWeaponAnim")
}

public 
WeaponSendWeaponAnim(idiAnim/*, skiplocal*/)
{
    
// Check the animation to replace.
    
if(iAnim == ANIM_TO_REPLACE)
    {
        
// Replace animation with the value you want.
        
SetHamParamInteger(2REPLACE_ANIM_WITH)
    }

Requires Hamsandwich Updated.

Quote:
Originally Posted by ConnorMcLeod View Post
Method seems ok, about SVC_WEAPONANIM, you can use Ham_CS_Weapon_SendWeaponAnim from hamsandwich updated.
You can also try to hook it to catch other animations.

I hope this ham version gonna be integrated in amxx, but atm there are no testers for some mods to confirm all is working.
Are there advantages? Otherwise I would definitely use what's included in the default AMXx package.
__________________

Last edited by Black Rose; 09-02-2013 at 13:50.
Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-02-2013 , 14:10   Re: How to catch animation
Reply With Quote #6

Advantages are all missing virtual fonctions from default ham have been added, see thread for details.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-02-2013 , 15:56   Re: How to catch animation
Reply With Quote #7

No I mean if there's any advantage using Ham_CS_Weapon_SendWeaponAnim over SVC_WEAPONANIM?
__________________
Black Rose is offline
G[o]Q
Member
Join Date: Jan 2010
Location: Poland (Malopolska)
Old 09-02-2013 , 17:30   Re: How to catch animation
Reply With Quote #8

so i solved my problem
HTML Code:
if(get_cd(cd,CD_WeaponAnim) <3 ){
            set_cd(cd, CD_WeaponAnim, 0)
}
in updateClientData

but i have new problem i try set knife model for glock and everything is ok but if I set cl_righthand 1 then i have model after change in left hand.

Anybody knows why?

Last edited by G[o]Q; 09-02-2013 at 18:47.
G[o]Q is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-02-2013 , 18:28   Re: How to catch animation
Reply With Quote #9

Quote:
Originally Posted by Black Rose View Post
No I mean if there's any advantage using Ham_CS_Weapon_SendWeaponAnim over SVC_WEAPONANIM?
Not really since you won't send it hundred times a millisecond.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
G[o]Q
Member
Join Date: Jan 2010
Location: Poland (Malopolska)
Old 09-02-2013 , 18:49   Re: How to catch animation
Reply With Quote #10

Ham_CS_Weapon_SendWeaponAnim crashed my server server

so anybody knows why if I change model glock for model knife it's in left hand by default?
G[o]Q 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 14:18.


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