View Single Post
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-12-2013 , 12:25   Re: How can i change the shot animation
Reply With Quote #15

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

Seems the best options, since pev_weaponanim gonna be set, and since that value gonna be used in UpdateClientData.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline