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

Makes sense, try to send wanted animation with Ham_CS_Weapon_SendWeaponAnim right after PlaybackEvent.

Following code may acts a bit weird due to client prediction, but other method would do the same and be less efficient.

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

#pragma semicolon 1

#define PLUGIN "Change M4a1 shot animation"
#define VERSION "0.0.1"

new g_iEventM4A1;

new 
g_iOurCustomShotAnimationM4A1 7// whatever

public plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    
g_iEventM4A1 EF_PrecacheEvent(1"events/m4a1.sc");
}

public 
pfn_playbackevent(flagsideventid /* , Float:delay, Float:Origin[3], Float:Angles[3], Float:fparam1, Float:fparam2, iparam1, iparam2, bparam1, bparam2 */ )
{
    if( 
eventid == g_iEventM4A1 )
    {
        
ExecuteHamB(Ham_CS_Weapon_SendWeaponAnimidg_iOurCustomShotAnimationM4A10); // make sure last param is 0.
    
}

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline