Raised This Month: $ Target: $400
 0% 

How can i change the shot animation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andyt0621
New Member
Join Date: May 2013
Old 05-11-2013 , 04:32   How can i change the shot animation
Reply With Quote #1

i tried to use SeadWeaponAnim in TraceAttack_Post,PrimaryAttack_Post,CurWeapon ..
but all cant work properly..
even if i see the new anim..
i will see the original shot anim flashed/appeared before the new anim

or can someone teach me how to make a fake shot hole with smoke..
i can use CD_flNextAttack to block shot anim but i dont know how to make a bullet hole that is same to a real shot hole

sorry to my poor english

Last edited by andyt0621; 05-11-2013 at 04:34.
andyt0621 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-11-2013 , 06:47   Re: How can i change the shot animation
Reply With Quote #2

Could you upload the model?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-11-2013 , 08:46   Re: How can i change the shot animation
Reply With Quote #3

- ClientUpdatePost
- Check your animation and set new animation with CD_WeaponAnim
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
andyt0621
New Member
Join Date: May 2013
Old 05-11-2013 , 09:45   Re: How can i change the shot animation
Reply With Quote #4

Quote:
Originally Posted by bibu View Post
Could you upload the model?
i think it is not related to the model animation order

Quote:
Originally Posted by Bos93 View Post
- ClientUpdatePost
- Check your animation and set new animation with CD_WeaponAnim
i see this: http://forums.alliedmods.net/showthread.php?t=88823 and try the following code
Code:
register_forward(FM_UpdateClientData , "UpdateClientData");

public UpdateClientData( id, iSendWeapons, cd_handle )
{
    new anim = get_cd( cd_handle , CD_WeaponAnim );
    if(3<= anim <= 5 ) // shot animation number
    {
        set_cd( cd_handle , CD_WeaponAnim , 3);
        return FMRES_OVERRIDE;
    }
    return FMRES_IGNORED;
}
it is not working because CD_WeaponAnim/pev_weaponanim cant return shot anim(3-5) but it can return idle,reload,draw
and then i tried this
Code:
register_forward(FM_UpdateClientData , "UpdateClientData");

public UpdateClientData( id, iSendWeapons, cd_handle )
{
    if(g_attack[id]) // return 1 when Ham_Weapon_PrimaryAttack and be 0 in Post
    {
        set_cd( cd_handle , CD_WeaponAnim , 3);
        return FMRES_OVERRIDE;
    }
    return FMRES_IGNORED;
}
it also not working
i think CD_WeaponAnim is a useless thing
andyt0621 is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-11-2013 , 10:49   Re: How can i change the shot animation
Reply With Quote #5

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

public plugin_init( )
{
    
register_forwardFM_UpdateClientData"UpdateClientData__Post", ._post true );
}

public 
UpdateClientData__PostpPlayerSendWeaponsCD_Handle )
{
    static 
iAnimiAnim get_cdCD_Handle CD_WeaponAnim );
    
    switch( 
iAnim 
    {
        case 
345set_cdCD_Handle CD_WeaponAnim );
    }
    
    return 
FMRES_HANDLED;

__________________

Last edited by Bos93; 05-11-2013 at 10:50.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
bibu
Veteran Member
Join Date: Sep 2010
Old 05-11-2013 , 13:38   Re: How can i change the shot animation
Reply With Quote #6

Can't you hook with ham SendWeaponAnim?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-11-2013 , 13:43   Re: How can i change the shot animation
Reply With Quote #7

Yes, but I think it is better UpdateClientData
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
andyt0621
New Member
Join Date: May 2013
Old 05-11-2013 , 23:34   Re: How can i change the shot animation
Reply With Quote #8

Quote:
Originally Posted by Bos93 View Post
PHP Code:
#include < amxmodx >
#include < fakemeta >

public plugin_init( )
{
    
register_forwardFM_UpdateClientData"UpdateClientData__Post", ._post true );
}

public 
UpdateClientData__PostpPlayerSendWeaponsCD_Handle )
{
    static 
iAnimiAnim get_cdCD_Handle CD_WeaponAnim );
    
    switch( 
iAnim 
    {
        case 
345set_cdCD_Handle CD_WeaponAnim );
    }
    
    return 
FMRES_HANDLED;

iAnim cant return shot anim..
i see it by using client_print

Quote:
Originally Posted by bibu View Post
Can't you hook with ham SendWeaponAnim?
can you give me an example please

Last edited by andyt0621; 05-11-2013 at 23:57.
andyt0621 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-12-2013 , 05:51   Re: How can i change the shot animation
Reply With Quote #9

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)
    }

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.

Last edited by bibu; 05-12-2013 at 06:06.
bibu is offline
Old 05-12-2013, 07:49
Bos93
This message has been deleted by Bos93. Reason: don't test
bibu
Veteran Member
Join Date: Sep 2010
Old 05-12-2013 , 09:29   Re: How can i change the shot animation
Reply With Quote #10

What? There is seriously no problem to use SendWeaponAnim...
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Reply


Thread Tools
Display Modes

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 19:00.


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